1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5cc_library {
6    name: "libpixelhealth",
7    vendor: true,
8    export_include_dirs: ["include"],
9
10    srcs: [
11        "BatteryDefender.cpp",
12        "BatteryMetricsLogger.cpp",
13        "BatteryThermalControl.cpp",
14        "ChargerDetect.cpp",
15        "CycleCountBackupRestore.cpp",
16        "DeviceHealth.cpp",
17        "HealthHelper.cpp",
18        "LowBatteryShutdownMetrics.cpp",
19        "StatsHelper.cpp"
20    ],
21
22    cflags: [
23        "-Wall",
24        "-Werror",
25    ],
26
27    static_libs: [
28        "libbatterymonitor",
29    ],
30
31    whole_static_libs: [
32        "android.hardware.health-translate-ndk",
33        "android.hardware.health@1.0-convert",
34    ],
35
36    export_shared_lib_headers: [
37        "android.frameworks.stats-V1-ndk",
38        "android.hardware.health-V3-ndk",
39        "libpixelatoms_defs",
40    ],
41
42    shared_libs: [
43        "android.frameworks.stats-V1-ndk",
44        "android.hardware.health-V3-ndk",
45        "libbase",
46        "libbinder_ndk",
47        "libcutils",
48        "libhidlbase",
49        "libpixelatoms_defs",
50        "libutils",
51    ],
52}
53
54cc_test {
55    name: "HealthTestCases",
56
57    compile_multilib: "both",
58    multilib: {
59        lib32: {
60            suffix: "32",
61        },
62        lib64: {
63            suffix: "64",
64        },
65    },
66
67    srcs: [
68        "test/TestBatteryDefender.cpp",
69    ],
70
71    local_include_dirs: [
72        "include/pixelhealth",
73    ],
74
75    static_libs: [
76        "libgmock",
77        "libhidlbase",
78        "libpixelhealth",
79        "libbatterymonitor",
80    ],
81
82    shared_libs: [
83        "libbase",
84        "libcutils",
85        "libutils",
86    ],
87
88    test_suites: [
89        "device-tests",
90    ],
91    vendor: true,
92}
93