blob: 08ee77380128946ecddb407887c5f95f1af30897 [file] [log] [blame]
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +00001/*
2 * Copyright (C) 2021 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "hardware_interfaces_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["hardware_interfaces_license"],
24}
25
26cc_library_static {
27 name: "libsensorsexampleimpl",
28 vendor: true,
29 shared_libs: [
30 "libbase",
Grace Chengbc2a1b72021-11-09 14:26:23 +000031 "libfmq",
32 "libpower",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000033 "libbinder_ndk",
Vladimir Komsiyski08315cc2022-12-06 13:26:09 +010034 "android.hardware.sensors-V2-ndk",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000035 ],
36 export_include_dirs: ["include"],
37 srcs: [
38 "Sensors.cpp",
Grace Chengbc2a1b72021-11-09 14:26:23 +000039 "Sensor.cpp",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000040 ],
41 visibility: [
42 ":__subpackages__",
43 "//hardware/interfaces/tests/extension/sensors:__subpackages__",
44 ],
45}
46
47cc_binary {
48 name: "android.hardware.sensors-service.example",
49 relative_install_path: "hw",
Jooyung Han621461b2023-12-11 13:38:14 +090050 installable: false, // install APEX below
51
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000052 vendor: true,
53 shared_libs: [
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000054 "libbinder_ndk",
Grace Chengbc2a1b72021-11-09 14:26:23 +000055 "liblog",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000056 ],
57 static_libs: [
Jooyung Han621461b2023-12-11 13:38:14 +090058 "android.hardware.common-V2-ndk",
59 "android.hardware.common.fmq-V1-ndk",
60 "android.hardware.sensors-V2-ndk",
61 "android.system.suspend-V1-ndk",
62 "libbase",
63 "libcutils",
64 "libfmq",
65 "libpower",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000066 "libsensorsexampleimpl",
Jooyung Han621461b2023-12-11 13:38:14 +090067 "libutils",
Arthur Ishiguroc7ac0b22021-10-13 16:12:37 +000068 ],
69 srcs: ["main.cpp"],
70}
Jooyung Han621461b2023-12-11 13:38:14 +090071
72prebuilt_etc {
73 name: "sensors-default.rc",
74 src: "sensors-default.rc",
75 installable: false,
76}
77
78prebuilt_etc {
79 name: "sensors-default.xml",
80 src: "sensors-default.xml",
81 sub_dir: "vintf",
82 installable: false,
83}
84
85// Default vendor APEX for android.hardware.sensors.
86// Custom implementations may use override_apex based on this APEX.
87apex {
88 name: "com.android.hardware.sensors",
89 manifest: "apex_manifest.json",
90 key: "com.android.hardware.key",
91 certificate: ":com.android.hardware.certificate",
92 file_contexts: "file_contexts",
93 updatable: false,
94 vendor: true,
95
96 binaries: ["android.hardware.sensors-service.example"],
97 prebuilts: [
98 "sensors-default.rc", // init rc
99 "sensors-default.xml", // vintf fragment
100 "android.hardware.sensor.ambient_temperature.prebuilt.xml",
101 "android.hardware.sensor.barometer.prebuilt.xml",
102 "android.hardware.sensor.gyroscope.prebuilt.xml",
103 "android.hardware.sensor.hinge_angle.prebuilt.xml",
104 "android.hardware.sensor.light.prebuilt.xml",
105 "android.hardware.sensor.proximity.prebuilt.xml",
106 "android.hardware.sensor.relative_humidity.prebuilt.xml",
107 ],
108}