Yifan Hong | 830cdb1 | 2021-01-11 20:47:23 -0800 | [diff] [blame] | 1 | // 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 | |
| 15 | cc_defaults { |
| 16 | name: "libhealth_aidl_common_defaults", |
Yifan Hong | e32a8ea | 2021-10-20 21:54:20 -0700 | [diff] [blame^] | 17 | recovery_available: true, |
Yifan Hong | 830cdb1 | 2021-01-11 20:47:23 -0800 | [diff] [blame] | 18 | vendor: true, |
| 19 | shared_libs: [ |
| 20 | "libbase", |
| 21 | "libbinder_ndk", |
| 22 | "libcutils", |
| 23 | "liblog", |
| 24 | "libutils", |
| 25 | "android.hardware.health-V1-ndk", |
| 26 | |
| 27 | // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo. |
| 28 | "libhidlbase", |
| 29 | ], |
| 30 | static_libs: [ |
| 31 | "libbatterymonitor", |
| 32 | "libhealthloop", |
| 33 | |
| 34 | // TODO(b/177269435): remove when BatteryMonitor works with AIDL HealthInfo. |
| 35 | "android.hardware.health-translate-ndk", |
| 36 | ], |
| 37 | } |
| 38 | |
| 39 | // AIDL version of libhealth2impl. |
| 40 | // A helper library for health HAL implementation. |
| 41 | // HAL implementations can link to this library and extend the Health class. |
| 42 | cc_library_static { |
| 43 | name: "libhealth_aidl_impl", |
| 44 | defaults: [ |
| 45 | "libhealth_aidl_common_defaults", |
| 46 | ], |
| 47 | export_include_dirs: ["include"], |
| 48 | export_static_lib_headers: [ |
| 49 | "libbatterymonitor", |
| 50 | ], |
| 51 | srcs: [ |
| 52 | "health-convert.cpp", |
| 53 | "HalHealthLoop.cpp", |
| 54 | "Health.cpp", |
| 55 | "LinkedCallback.cpp", |
| 56 | ], |
| 57 | visibility: [ |
| 58 | ":__subpackages__", |
| 59 | "//hardware/interfaces/tests/extension/health:__subpackages__", |
| 60 | ], |
| 61 | } |
| 62 | |
| 63 | // AIDL version of android.hardware.health@2.1-service. |
| 64 | // Default binder service of the health HAL. |
| 65 | cc_binary { |
| 66 | name: "android.hardware.health-service.example", |
| 67 | relative_install_path: "hw", |
| 68 | init_rc: ["android.hardware.health-service.example.rc"], |
| 69 | vintf_fragments: ["android.hardware.health-service.example.xml"], |
| 70 | defaults: [ |
| 71 | "libhealth_aidl_common_defaults", |
| 72 | ], |
| 73 | static_libs: [ |
| 74 | "libhealth_aidl_impl", |
| 75 | ], |
| 76 | srcs: ["main.cpp"], |
| 77 | } |