diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-22 23:09:36 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2019-06-22 23:09:36 +0000 |
commit | 5bfef25158dceda6c26161f958a06fa6700ae712 (patch) | |
tree | e08c2f9852d8903443c5d879d4cb3bf254fc26a2 | |
parent | ea75085d14e83bd28c4d0b36094a14f704d24d47 (diff) | |
parent | d9bcba51b9996843cde086f1a04dff5fc630774c (diff) | |
download | interfaces-android10-c2f2-release.tar.gz |
Snap for 5681502 from d9bcba51b9996843cde086f1a04dff5fc630774c to qt-c2f2-releaseandroid-10.0.0_r9android-10.0.0_r8android-10.0.0_r7android-10.0.0_r14android-10.0.0_r13android-10.0.0_r12android10-c2f2-s2-releaseandroid10-c2f2-s1-releaseandroid10-c2f2-release
Change-Id: Id6e14e7da44f0743d63c671f2ff16b4b71ddb373
-rw-r--r-- | light/1.0/default/Android.bp | 31 | ||||
-rw-r--r-- | light/1.0/default/impl.cpp | 43 |
2 files changed, 68 insertions, 6 deletions
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 @@ cc_binary { "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)}; +} |