2021-02-17 04:02:14 +01:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2017-07-11 01:05:51 +02:00
|
|
|
cc_library_headers {
|
|
|
|
name: "libhealthd_headers",
|
|
|
|
vendor_available: true,
|
2018-07-10 22:02:18 +02:00
|
|
|
recovery_available: true,
|
2017-07-11 01:05:51 +02:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
header_libs: ["libbatteryservice_headers"],
|
|
|
|
export_header_lib_headers: ["libbatteryservice_headers"],
|
|
|
|
}
|
2017-06-01 23:34:29 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libbatterymonitor",
|
|
|
|
srcs: ["BatteryMonitor.cpp"],
|
2017-11-29 23:24:50 +01:00
|
|
|
cflags: ["-Wall", "-Werror"],
|
2017-06-01 23:34:29 +02:00
|
|
|
vendor_available: true,
|
2018-07-10 22:02:18 +02:00
|
|
|
recovery_available: true,
|
2017-06-01 23:34:29 +02:00
|
|
|
export_include_dirs: ["include"],
|
|
|
|
shared_libs: [
|
|
|
|
"libutils",
|
|
|
|
"libbase",
|
2019-10-07 20:18:04 +02:00
|
|
|
|
2022-03-01 21:12:34 +01:00
|
|
|
// Need HealthInfo definition from headers of these shared
|
|
|
|
// libraries. Clients don't need to link to these.
|
2019-10-07 20:18:04 +02:00
|
|
|
"android.hardware.health@2.1",
|
2022-03-01 21:12:34 +01:00
|
|
|
"android.hardware.health-V1-ndk",
|
|
|
|
],
|
|
|
|
whole_static_libs: [
|
|
|
|
// Need to translate HIDL to AIDL to support legacy APIs in
|
|
|
|
// BatteryMonitor.
|
|
|
|
"android.hardware.health-translate-ndk",
|
2017-06-01 23:34:29 +02:00
|
|
|
],
|
|
|
|
header_libs: ["libhealthd_headers"],
|
|
|
|
export_header_lib_headers: ["libhealthd_headers"],
|
|
|
|
}
|
2017-09-20 02:57:50 +02:00
|
|
|
|
2018-04-04 23:08:57 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "android.hardware.health@2.0-service_defaults",
|
2017-09-20 02:57:50 +02:00
|
|
|
|
2017-11-29 23:24:50 +01:00
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
2017-09-20 02:57:50 +02:00
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"android.hardware.health@2.0-impl",
|
|
|
|
"android.hardware.health@1.0-convert",
|
2018-01-20 00:53:25 +01:00
|
|
|
"libhealthservice",
|
2018-01-11 01:14:28 +01:00
|
|
|
"libhealthstoragedefault",
|
2017-09-20 02:57:50 +02:00
|
|
|
"libbatterymonitor",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"libhidlbase",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
"android.hardware.health@2.0",
|
|
|
|
],
|
|
|
|
}
|
2017-09-26 02:25:00 +02:00
|
|
|
|
2018-04-04 23:08:57 +02:00
|
|
|
cc_binary {
|
|
|
|
name: "android.hardware.health@2.0-service",
|
|
|
|
defaults: ["android.hardware.health@2.0-service_defaults"],
|
2018-05-01 23:59:43 +02:00
|
|
|
|
2018-07-10 22:07:08 +02:00
|
|
|
vendor: true,
|
|
|
|
relative_install_path: "hw",
|
|
|
|
init_rc: ["android.hardware.health@2.0-service.rc"],
|
|
|
|
srcs: [
|
|
|
|
"HealthServiceDefault.cpp",
|
|
|
|
],
|
2017-09-26 02:25:00 +02:00
|
|
|
}
|
2018-09-11 19:46:35 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libhealthd_charger_nops",
|
2019-10-09 02:27:11 +02:00
|
|
|
recovery_available: true,
|
2018-09-11 19:46:35 +02:00
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"healthd_mode_charger_nops.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
|
|
|
|
header_libs: [
|
|
|
|
"libhealthd_headers",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
2019-10-09 02:27:11 +02:00
|
|
|
"libhealthloop",
|
|
|
|
"libhealth2impl",
|
2018-09-11 19:46:35 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
2019-10-09 02:27:11 +02:00
|
|
|
"android.hardware.health@2.1",
|
2018-09-11 19:46:35 +02:00
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
}
|
2019-07-03 20:07:37 +02:00
|
|
|
|
|
|
|
sysprop_library {
|
|
|
|
name: "charger_sysprop",
|
2019-10-09 02:27:11 +02:00
|
|
|
recovery_available: true,
|
2019-07-03 20:07:37 +02:00
|
|
|
srcs: ["charger.sysprop"],
|
|
|
|
property_owner: "Platform",
|
|
|
|
api_packages: ["android.sysprop"],
|
|
|
|
}
|
2019-07-03 20:40:08 +02:00
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libhealthd_draw",
|
2021-10-21 07:18:16 +02:00
|
|
|
vendor_available: true,
|
2019-07-03 20:40:08 +02:00
|
|
|
export_include_dirs: ["."],
|
|
|
|
static_libs: [
|
|
|
|
"libcharger_sysprop",
|
|
|
|
"libminui",
|
|
|
|
],
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
],
|
|
|
|
header_libs: ["libbatteryservice_headers"],
|
|
|
|
|
|
|
|
srcs: ["healthd_draw.cpp"],
|
2021-10-21 07:18:16 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
vendor: {
|
|
|
|
exclude_static_libs: [
|
|
|
|
"libcharger_sysprop",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2019-07-03 20:40:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
2021-10-21 02:15:32 +02:00
|
|
|
name: "libhealthd_charger_ui",
|
2021-10-21 07:18:16 +02:00
|
|
|
vendor_available: true,
|
2021-10-21 02:15:32 +02:00
|
|
|
export_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"include_charger",
|
|
|
|
],
|
2019-07-03 20:40:08 +02:00
|
|
|
|
|
|
|
static_libs: [
|
2021-10-21 02:15:32 +02:00
|
|
|
"android.hardware.health-V1-ndk",
|
|
|
|
"android.hardware.health-translate-ndk",
|
2019-07-03 20:40:08 +02:00
|
|
|
"libcharger_sysprop",
|
|
|
|
"libhealthd_draw",
|
2019-10-09 02:27:11 +02:00
|
|
|
"libhealthloop",
|
2019-07-03 20:40:08 +02:00
|
|
|
"libminui",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libpng",
|
|
|
|
"libsuspend",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
2021-10-21 02:15:32 +02:00
|
|
|
header_libs: [
|
|
|
|
"libhealthd_headers",
|
|
|
|
],
|
|
|
|
|
|
|
|
export_static_lib_headers: [
|
|
|
|
"android.hardware.health-V1-ndk",
|
|
|
|
],
|
|
|
|
|
2019-07-03 20:40:08 +02:00
|
|
|
srcs: [
|
|
|
|
"healthd_mode_charger.cpp",
|
|
|
|
"AnimationParser.cpp",
|
|
|
|
],
|
2021-10-21 07:18:16 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
vendor: {
|
|
|
|
exclude_static_libs: [
|
|
|
|
"libcharger_sysprop",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2019-07-03 20:40:08 +02:00
|
|
|
}
|
2019-10-09 02:27:11 +02:00
|
|
|
|
2021-10-21 02:15:32 +02:00
|
|
|
cc_library_static {
|
|
|
|
name: "libhealthd_charger",
|
|
|
|
export_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"include_charger",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"android.hardware.health@1.0-convert",
|
2021-10-27 07:51:29 +02:00
|
|
|
"libcharger_sysprop",
|
2021-10-21 02:15:32 +02:00
|
|
|
"libhealth2impl",
|
|
|
|
"libhealthd_charger_ui",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"android.hardware.health@2.1",
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"healthd_mode_charger_hidl.cpp",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2019-10-09 02:27:11 +02:00
|
|
|
cc_defaults {
|
|
|
|
name: "charger_defaults",
|
2021-10-21 02:15:32 +02:00
|
|
|
local_include_dirs: [
|
|
|
|
"include_charger",
|
|
|
|
],
|
2019-10-09 02:27:11 +02:00
|
|
|
|
|
|
|
cflags: [
|
|
|
|
"-Wall",
|
|
|
|
"-Werror",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
// common
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"libhidlbase",
|
|
|
|
"liblog",
|
|
|
|
"libutils",
|
|
|
|
|
|
|
|
// system charger only
|
|
|
|
"libpng",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
// common
|
|
|
|
"android.hardware.health@1.0-convert",
|
2021-10-21 02:15:32 +02:00
|
|
|
"android.hardware.health-V1-ndk",
|
2019-10-09 02:27:11 +02:00
|
|
|
"libbatterymonitor",
|
|
|
|
"libcharger_sysprop",
|
|
|
|
"libhealthd_charger_nops",
|
|
|
|
"libhealthloop",
|
|
|
|
"libhealth2impl",
|
|
|
|
|
|
|
|
// system charger only
|
|
|
|
"libhealthd_draw",
|
|
|
|
"libhealthd_charger",
|
2021-10-21 02:15:32 +02:00
|
|
|
"libhealthd_charger_ui",
|
2019-10-09 02:27:11 +02:00
|
|
|
"libminui",
|
|
|
|
"libsuspend",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_binary {
|
|
|
|
name: "charger",
|
|
|
|
defaults: ["charger_defaults"],
|
|
|
|
recovery_available: true,
|
|
|
|
srcs: [
|
|
|
|
"charger.cpp",
|
|
|
|
"charger_utils.cpp",
|
|
|
|
],
|
2021-12-13 23:01:14 +01:00
|
|
|
shared_libs: [
|
|
|
|
"android.hardware.health@2.0",
|
|
|
|
"android.hardware.health@2.1",
|
|
|
|
],
|
2019-10-09 02:27:11 +02:00
|
|
|
|
|
|
|
target: {
|
|
|
|
recovery: {
|
|
|
|
// No UI and libsuspend for recovery charger.
|
|
|
|
cflags: [
|
|
|
|
"-DCHARGER_FORCE_NO_UI=1",
|
|
|
|
],
|
|
|
|
exclude_shared_libs: [
|
|
|
|
"libpng",
|
|
|
|
],
|
|
|
|
exclude_static_libs: [
|
|
|
|
"libhealthd_draw",
|
|
|
|
"libhealthd_charger",
|
2021-10-21 02:15:32 +02:00
|
|
|
"libhealthd_charger_ui",
|
2019-10-09 02:27:11 +02:00
|
|
|
"libminui",
|
|
|
|
"libsuspend",
|
|
|
|
],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "charger_test",
|
|
|
|
defaults: ["charger_defaults"],
|
|
|
|
srcs: ["charger_test.cpp"],
|
2021-12-13 23:01:14 +01:00
|
|
|
static_libs: [
|
|
|
|
"android.hardware.health@1.0",
|
|
|
|
"android.hardware.health@2.0",
|
|
|
|
"android.hardware.health@2.1",
|
|
|
|
],
|
2019-10-09 02:27:11 +02:00
|
|
|
}
|
2020-08-06 01:25:33 +02:00
|
|
|
|
|
|
|
cc_test {
|
|
|
|
name: "libhealthd_charger_test",
|
2020-08-08 01:27:49 +02:00
|
|
|
defaults: ["charger_defaults"],
|
|
|
|
srcs: [
|
|
|
|
"AnimationParser_test.cpp",
|
|
|
|
"healthd_mode_charger_test.cpp"
|
2020-08-06 01:25:33 +02:00
|
|
|
],
|
|
|
|
static_libs: [
|
2021-12-13 23:01:14 +01:00
|
|
|
"android.hardware.health@1.0",
|
|
|
|
"android.hardware.health@2.0",
|
|
|
|
"android.hardware.health@2.1",
|
2020-08-08 01:27:49 +02:00
|
|
|
"libgmock",
|
2020-08-06 01:25:33 +02:00
|
|
|
],
|
2020-08-06 01:30:43 +02:00
|
|
|
test_suites: [
|
|
|
|
"general-tests",
|
|
|
|
"device-tests",
|
|
|
|
],
|
2020-08-08 01:27:49 +02:00
|
|
|
data: [
|
|
|
|
":libhealthd_charger_test_data",
|
|
|
|
],
|
|
|
|
require_root: true,
|
2020-08-06 01:25:33 +02:00
|
|
|
}
|
2020-08-06 03:24:25 +02:00
|
|
|
|
|
|
|
// /system/etc/res/images/charger/battery_fail.png
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "system_core_charger_res_images_battery_fail.png",
|
|
|
|
src: "images/battery_fail.png",
|
|
|
|
relative_install_path: "res/images/charger",
|
|
|
|
filename: "battery_fail.png",
|
|
|
|
}
|
|
|
|
|
|
|
|
// /system/etc/res/images/charger/battery_scale.png
|
|
|
|
prebuilt_etc {
|
|
|
|
name: "system_core_charger_res_images_battery_scale.png",
|
|
|
|
src: "images/battery_scale.png",
|
|
|
|
relative_install_path: "res/images/charger",
|
|
|
|
filename: "battery_scale.png",
|
|
|
|
}
|
|
|
|
|
|
|
|
phony {
|
|
|
|
name: "charger_res_images",
|
|
|
|
required: [
|
|
|
|
"system_core_charger_res_images_battery_fail.png",
|
|
|
|
"system_core_charger_res_images_battery_scale.png",
|
|
|
|
],
|
|
|
|
}
|
2021-10-27 02:20:25 +02:00
|
|
|
|
2022-08-26 15:54:13 +02:00
|
|
|
// /vendor/etc/res/images/default/charger/battery_fail.png
|
2021-10-27 02:20:25 +02:00
|
|
|
prebuilt_etc {
|
|
|
|
name: "system_core_charger_res_images_battery_fail.png_default_vendor",
|
|
|
|
src: "images/battery_fail.png",
|
2022-08-26 15:54:13 +02:00
|
|
|
relative_install_path: "res/images/default/charger",
|
2021-10-27 02:20:25 +02:00
|
|
|
vendor: true,
|
|
|
|
filename: "battery_fail.png",
|
|
|
|
}
|
|
|
|
|
2022-08-26 15:54:13 +02:00
|
|
|
// /vendor/etc/res/images/default/charger/battery_scale.png
|
2021-10-27 02:20:25 +02:00
|
|
|
prebuilt_etc {
|
|
|
|
name: "system_core_charger_res_images_battery_scale.png_default_vendor",
|
|
|
|
src: "images/battery_scale.png",
|
2022-08-26 15:54:13 +02:00
|
|
|
relative_install_path: "res/images/default/charger",
|
2021-10-27 02:20:25 +02:00
|
|
|
vendor: true,
|
|
|
|
filename: "battery_scale.png",
|
|
|
|
}
|
|
|
|
|
|
|
|
phony {
|
|
|
|
name: "charger_res_images_vendor",
|
|
|
|
required: [
|
|
|
|
"system_core_charger_res_images_battery_fail.png_default_vendor",
|
|
|
|
"system_core_charger_res_images_battery_scale.png_default_vendor",
|
|
|
|
],
|
|
|
|
}
|