diff options
author | Vic Yang <victoryang@google.com> | 2019-06-20 14:49:25 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-06-20 14:49:25 -0700 |
commit | d9bcba51b9996843cde086f1a04dff5fc630774c (patch) | |
tree | e08c2f9852d8903443c5d879d4cb3bf254fc26a2 | |
parent | ea75085d14e83bd28c4d0b36094a14f704d24d47 (diff) | |
parent | faad30bd20482bde152798bfdc2a8719ed1c7d7f (diff) | |
download | interfaces-android10-qpr1-mainline-release.tar.gz |
Add hardware.google.light@1.0-impl libraryandroid-mainline-10.0.0_r7android-mainline-10.0.0_r5android-mainline-10.0.0_r4android10-qpr1-mainline-release
am: faad30bd20
Change-Id: I125c5adc856c10816c1ef14356ff0cb28a4476a8
-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)}; +} |