From 43b37c51fade289e009c2eae861a9aad14ec179e Mon Sep 17 00:00:00 2001 From: hmz007 Date: Sun, 8 May 2022 12:08:15 +0800 Subject: [PATCH] android: healthd: Support to disable battery log v2 Signed-off-by: hmz007 --- .../interfaces/health/utils/libhealthloop/HealthLoop.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hardware/interfaces/health/utils/libhealthloop/HealthLoop.cpp b/hardware/interfaces/health/utils/libhealthloop/HealthLoop.cpp index 3f4b5bc5963..23b948b0a79 100644 --- a/hardware/interfaces/health/utils/libhealthloop/HealthLoop.cpp +++ b/hardware/interfaces/health/utils/libhealthloop/HealthLoop.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -240,7 +241,11 @@ int HealthLoop::InitInternal() { // AdjustUeventWakealarmPeriods(). Init(&healthd_config_); - WakeAlarmInit(); + if (property_get_bool("ro.boot.log_battery", true)) + WakeAlarmInit(); + else + KLOG_WARNING(LOG_TAG, "battery monitor disabled\n"); + UeventInit(); return 0;