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