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        "LowBatteryShutdownMetrics.cpp",
18        "StatsHelper.cpp"
19    ],
20
21    cflags: [
22        "-Wall",
23        "-Werror",
24    ],
25
26    static_libs: [
27        "libbatterymonitor",
28    ],
29
30    export_shared_lib_headers: [
31        "android.frameworks.stats-V1-ndk_platform",
32        "pixelatoms-cpp",
33    ],
34
35    shared_libs: [
36        "android.frameworks.stats-V1-ndk_platform",
37        "libbase",
38        "libbinder_ndk",
39        "libcutils",
40        "libutils",
41        "pixelatoms-cpp",
42    ],
43}
44
45cc_test {
46    name: "HealthTestCases",
47
48    compile_multilib: "both",
49    multilib: {
50        lib32: {
51            suffix: "32",
52        },
53        lib64: {
54            suffix: "64",
55        },
56    },
57
58    srcs: [
59        "test/TestBatteryDefender.cpp",
60    ],
61
62    local_include_dirs: [
63        "include/pixelhealth",
64    ],
65
66    static_libs: [
67        "libgmock",
68        "libpixelhealth",
69        "libbatterymonitor",
70    ],
71
72    shared_libs: [
73        "libbase",
74        "libcutils",
75        "libutils",
76    ],
77
78    test_suites: [
79        "device-tests",
80    ],
81    vendor: true,
82}
83