2021-02-17 04:02:14 +01:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2023-01-10 07:50:52 +01:00
|
|
|
cc_defaults {
|
|
|
|
name: "libbatterymonitor_defaults",
|
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",
|
2023-01-10 07:50:52 +01:00
|
|
|
],
|
|
|
|
header_libs: ["libhealthd_headers"],
|
|
|
|
export_header_lib_headers: ["libhealthd_headers"],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_defaults {
|
|
|
|
name: "libhealthd_charger_ui_defaults",
|
|
|
|
vendor_available: true,
|
|
|
|
export_include_dirs: [
|
|
|
|
"include",
|
|
|
|
"include_charger",
|
|
|
|
],
|
|
|
|
|
|
|
|
static_libs: [
|
|
|
|
"libcharger_sysprop",
|
|
|
|
"libhealthd_draw",
|
|
|
|
"libhealthloop",
|
|
|
|
"libminui",
|
|
|
|
],
|
|
|
|
|
|
|
|
shared_libs: [
|
|
|
|
"libbase",
|
|
|
|
"libcutils",
|
|
|
|
"liblog",
|
|
|
|
"libpng",
|
|
|
|
"libsuspend",
|
|
|
|
"libutils",
|
|
|
|
],
|
|
|
|
|
|
|
|
header_libs: [
|
|
|
|
"libhealthd_headers",
|
|
|
|
],
|
|
|
|
|
|
|
|
srcs: [
|
|
|
|
"healthd_mode_charger.cpp",
|
|
|
|
"AnimationParser.cpp",
|
|
|
|
],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
vendor: {
|
|
|
|
exclude_static_libs: [
|
|
|
|
"libcharger_sysprop",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_headers {
|
|
|
|
name: "libhealthd_headers",
|
|
|
|
vendor_available: true,
|
|
|
|
recovery_available: true,
|
|
|
|
export_include_dirs: ["include"],
|
|
|
|
header_libs: ["libbatteryservice_headers"],
|
|
|
|
export_header_lib_headers: ["libbatteryservice_headers"],
|
|
|
|
}
|
|
|
|
|
|
|
|
cc_library_static {
|
|
|
|
name: "libbatterymonitor",
|
|
|
|
defaults: ["libbatterymonitor_defaults"],
|
2023-01-21 07:33:55 +01:00
|
|
|
srcs: ["BatteryMonitor.cpp"],
|
2023-01-10 07:50:52 +01:00
|
|
|
static_libs: [
|
2023-11-18 05:33:25 +01:00
|
|
|
"android.hardware.health-V3-ndk",
|
2022-03-01 21:12:34 +01:00
|
|
|
],
|
|
|
|
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
|
|
|
],
|
2023-01-10 07:50:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(b/251425963): remove when android.hardware.health is upgraded to V2.
|
|
|
|
cc_library_static {
|
|
|
|
name: "libbatterymonitor-V1",
|
|
|
|
defaults: ["libbatterymonitor_defaults"],
|
2023-01-21 07:33:55 +01:00
|
|
|
srcs: ["BatteryMonitor_v1.cpp"],
|
2023-01-10 07:50:52 +01:00
|
|
|
static_libs: [
|
|
|
|
"android.hardware.health-V1-ndk",
|
|
|
|
],
|
|
|
|
whole_static_libs: [
|
|
|
|
// Need to translate HIDL to AIDL to support legacy APIs in
|
|
|
|
// BatteryMonitor.
|
|
|
|
"android.hardware.health-translate-V1-ndk",
|
|
|
|
],
|
2017-06-01 23:34:29 +02:00
|
|
|
}
|
2017-09-20 02:57:50 +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",
|
2023-01-10 07:50:52 +01:00
|
|
|
defaults: ["libhealthd_charger_ui_defaults"],
|
2019-07-03 20:40:08 +02:00
|
|
|
|
|
|
|
static_libs: [
|
2023-11-18 05:33:25 +01:00
|
|
|
"android.hardware.health-V3-ndk",
|
2021-10-21 02:15:32 +02:00
|
|
|
"android.hardware.health-translate-ndk",
|
2019-07-03 20:40:08 +02:00
|
|
|
],
|
|
|
|
|
2023-01-10 07:50:52 +01:00
|
|
|
export_static_lib_headers: [
|
2023-11-18 05:33:25 +01:00
|
|
|
"android.hardware.health-V3-ndk",
|
2019-07-03 20:40:08 +02:00
|
|
|
],
|
2023-01-10 07:50:52 +01:00
|
|
|
}
|
2019-07-03 20:40:08 +02:00
|
|
|
|
2023-01-10 07:50:52 +01:00
|
|
|
// TODO(b/251425963): remove when android.hardware.health is upgraded to V2.
|
|
|
|
cc_library_static {
|
|
|
|
name: "libhealthd_charger_ui-V1",
|
|
|
|
defaults: ["libhealthd_charger_ui_defaults"],
|
2021-10-21 02:15:32 +02:00
|
|
|
|
2023-01-10 07:50:52 +01:00
|
|
|
static_libs: [
|
2021-10-21 02:15:32 +02:00
|
|
|
"android.hardware.health-V1-ndk",
|
2023-01-10 07:50:52 +01:00
|
|
|
"android.hardware.health-translate-V1-ndk",
|
2021-10-21 02:15:32 +02:00
|
|
|
],
|
|
|
|
|
2023-01-10 07:50:52 +01:00
|
|
|
export_static_lib_headers: [
|
|
|
|
"android.hardware.health-V1-ndk",
|
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",
|
2023-11-18 05:33:25 +01:00
|
|
|
"android.hardware.health-V3-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",
|
|
|
|
],
|
|
|
|
}
|