blob: cb78e772c101c8cebdea293ac0181c31d064b28d [file] [log] [blame]
Yifan Hong830cdb12021-01-11 20:47:23 -08001// Copyright (C) 2021 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15cc_defaults {
16 name: "libhealth_aidl_common_defaults",
17 vendor: true,
18 shared_libs: [
19 "libbase",
20 "libbinder_ndk",
21 "libcutils",
22 "liblog",
23 "libutils",
24 "android.hardware.health-V1-ndk",
25
26 // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
27 "libhidlbase",
28 ],
29 static_libs: [
30 "libbatterymonitor",
31 "libhealthloop",
32
33 // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
34 "android.hardware.health-translate-ndk",
35 ],
36}
37
38// AIDL version of libhealth2impl.
39// A helper library for health HAL implementation.
40// HAL implementations can link to this library and extend the Health class.
41cc_library_static {
42 name: "libhealth_aidl_impl",
43 defaults: [
44 "libhealth_aidl_common_defaults",
45 ],
46 export_include_dirs: ["include"],
47 export_static_lib_headers: [
48 "libbatterymonitor",
49 ],
50 srcs: [
51 "health-convert.cpp",
52 "HalHealthLoop.cpp",
53 "Health.cpp",
54 "LinkedCallback.cpp",
55 ],
56 visibility: [
57 ":__subpackages__",
58 "//hardware/interfaces/tests/extension/health:__subpackages__",
59 ],
60}
61
62// AIDL version of android.hardware.health@2.1-service.
63// Default binder service of the health HAL.
64cc_binary {
65 name: "android.hardware.health-service.example",
66 relative_install_path: "hw",
67 init_rc: ["android.hardware.health-service.example.rc"],
68 vintf_fragments: ["android.hardware.health-service.example.xml"],
69 defaults: [
70 "libhealth_aidl_common_defaults",
71 ],
72 static_libs: [
73 "libhealth_aidl_impl",
74 ],
75 srcs: ["main.cpp"],
76}