blob: 9fc8b7def61a90cb6691590985595c223fb22f4c [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
Bob Badoura88d5b12021-10-28 17:18:27 -070015package {
16 // See: http://go/android-license-faq
17 // A large-scale-change added 'default_applicable_licenses' to import
18 // all of the 'license_kinds' from "hardware_interfaces_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["hardware_interfaces_license"],
22}
23
Yifan Hong830cdb12021-01-11 20:47:23 -080024cc_defaults {
25 name: "libhealth_aidl_common_defaults",
26 vendor: true,
27 shared_libs: [
28 "libbase",
29 "libbinder_ndk",
30 "libcutils",
31 "liblog",
32 "libutils",
33 "android.hardware.health-V1-ndk",
34
35 // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
36 "libhidlbase",
37 ],
38 static_libs: [
39 "libbatterymonitor",
40 "libhealthloop",
41
42 // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo.
43 "android.hardware.health-translate-ndk",
44 ],
45}
46
47// AIDL version of libhealth2impl.
48// A helper library for health HAL implementation.
49// HAL implementations can link to this library and extend the Health class.
50cc_library_static {
51 name: "libhealth_aidl_impl",
52 defaults: [
53 "libhealth_aidl_common_defaults",
54 ],
55 export_include_dirs: ["include"],
56 export_static_lib_headers: [
57 "libbatterymonitor",
58 ],
59 srcs: [
60 "health-convert.cpp",
61 "HalHealthLoop.cpp",
62 "Health.cpp",
63 "LinkedCallback.cpp",
64 ],
65 visibility: [
66 ":__subpackages__",
67 "//hardware/interfaces/tests/extension/health:__subpackages__",
68 ],
69}
70
71// AIDL version of android.hardware.health@2.1-service.
72// Default binder service of the health HAL.
73cc_binary {
74 name: "android.hardware.health-service.example",
75 relative_install_path: "hw",
76 init_rc: ["android.hardware.health-service.example.rc"],
77 vintf_fragments: ["android.hardware.health-service.example.xml"],
78 defaults: [
79 "libhealth_aidl_common_defaults",
80 ],
81 static_libs: [
82 "libhealth_aidl_impl",
83 ],
84 srcs: ["main.cpp"],
85}