1// Copyright (C) 2019 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
15package {
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
24cc_defaults {
25    name: "android.hardware.health@2.1-impl-defaults",
26    relative_install_path: "hw",
27
28    shared_libs: [
29        "libbase",
30        "libcutils",
31        "libhidlbase",
32        "liblog",
33        "libutils",
34        "android.hardware.health@2.1",
35        "android.hardware.health@2.0",
36    ],
37
38    static_libs: [
39        "android.hardware.health@1.0-convert",
40        "libbatterymonitor",
41        "libhealthloop",
42        "libhealth2impl",
43    ],
44}
45
46// Default passthrough implementation of the health@2.1 HAL.
47// Passhtrough implementations of the health@2.1 HAL must be installed in
48// vendor in order to support charger.
49// Passhtrough implementations of the health@2.1 HAL must be installed in
50// recovery in order to allow recovery to check battery status.
51// See README.md for details.
52cc_library_shared {
53    name: "android.hardware.health@2.1-impl",
54    stem: "android.hardware.health@2.0-impl-2.1",
55
56    // Only vendor and recovery variants are allowed, not core.
57    vendor: true,
58    recovery_available: true,
59
60    defaults: ["android.hardware.health@2.1-impl-defaults"],
61
62    srcs: [
63        "impl.cpp",
64    ],
65
66    // No vintf_fragments because both -impl and -service should have been
67    // installed.
68}
69
70// Default binderized service of the health@2.1 HAL.
71// This binderized implementation dlopen()s the passthrough implementation,
72// so there is no need to implement your own.
73cc_binary {
74    name: "android.hardware.health@2.1-service",
75    vendor: true,
76    defaults: ["android.hardware.health@2.1-impl-defaults"],
77    init_rc: ["android.hardware.health@2.1-service.rc"],
78
79    srcs: [
80        "service.cpp",
81    ],
82
83    vintf_fragments: [
84        "android.hardware.health@2.1.xml"
85    ],
86
87    overrides: [
88        "healthd",
89    ],
90}
91