Snap for 5681502 from d9bcba51b9996843cde086f1a04dff5fc630774c to qt-c2f2-release

Change-Id: Id6e14e7da44f0743d63c671f2ff16b4b71ddb373
diff --git a/light/1.0/default/Android.bp b/light/1.0/default/Android.bp
index 1dc781c..a931501 100644
--- a/light/1.0/default/Android.bp
+++ b/light/1.0/default/Android.bp
@@ -14,18 +14,14 @@
 // limitations under the License.
 //
 
-cc_binary {
-    name: "hardware.google.light@1.0-service",
+cc_defaults {
+    name: "hardware.google.light_defaults",
     relative_install_path: "hw",
-    defaults: ["hidl_defaults"],
-    init_rc: ["hardware.google.light@1.0-service.rc"],
     vendor: true,
     srcs: [
         "Light.cpp",
         "LightExt.cpp",
-        "service.cpp",
     ],
-
     shared_libs: [
         "liblog",
         "libbase",
@@ -37,3 +33,26 @@
         "hardware.google.light@1.0",
     ],
 }
+
+cc_library_shared {
+    name: "hardware.google.light@1.0-impl",
+    defaults: [
+        "hardware.google.light_defaults",
+        "hidl_defaults"
+    ],
+    srcs: [
+        "impl.cpp",
+    ],
+}
+
+cc_binary {
+    name: "hardware.google.light@1.0-service",
+    defaults: [
+        "hardware.google.light_defaults",
+        "hidl_defaults"
+    ],
+    init_rc: ["hardware.google.light@1.0-service.rc"],
+    srcs: [
+        "service.cpp",
+    ],
+}
diff --git a/light/1.0/default/impl.cpp b/light/1.0/default/impl.cpp
new file mode 100644
index 0000000..75f8653
--- /dev/null
+++ b/light/1.0/default/impl.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <hardware/lights.h>
+#include <hidl/LegacySupport.h>
+#include <hardware/google/light/1.0/ILight.h>
+#include "LightExt.h"
+
+namespace android {
+namespace hardware {
+namespace light {
+namespace V2_0 {
+namespace implementation {
+
+extern ILight* HIDL_FETCH_ILight(const char* /* name */);
+
+}  // namespace implementation
+}  // namespace V2_0
+}  // namespace light
+}  // namespace hardware
+}  // namespace android
+
+using hardware::google::light::V1_0::ILight;
+using hardware::google::light::V1_0::implementation::LightExt;
+
+extern "C" ILight *HIDL_FETCH_ILight(const char * /*instance*/) {
+  return new LightExt{
+      android::hardware::light::V2_0::implementation::HIDL_FETCH_ILight(
+          nullptr)};
+}