summaryrefslogtreecommitdiff
path: root/health
diff options
context:
space:
mode:
authorStephane Lee <stayfan@google.com>2020-10-08 23:14:26 -0700
committerStephane Lee <stayfan@google.com>2020-12-14 12:09:16 -0800
commit97b50b8ba6a40943c9f8503ddd4cadb730ca7595 (patch)
tree5224cf2e3a6e397eb17d5412916dd03b2f46c185 /health
parent7a44a823d24de58aaa5cb749145576b6b6c4602f (diff)
downloadpixel-97b50b8ba6a40943c9f8503ddd4cadb730ca7595.tar.gz
Enable Battery Defender on user builds
Test: Ensure that 'atest HealthTestCases' runs successfully Bug: 175614345 Merged-In: Ie126fcf3d97c53c09e27341e2a51a6adb48af555 Change-Id: Ie126fcf3d97c53c09e27341e2a51a6adb48af555 (cherry picked from commit bd322427ed652987db3aa3fca86060ca98a8356d)
Diffstat (limited to 'health')
-rw-r--r--health/BatteryDefender.cpp3
-rw-r--r--health/include/pixelhealth/BatteryDefender.h1
-rw-r--r--health/test/TestBatteryDefender.cpp12
3 files changed, 1 insertions, 15 deletions
diff --git a/health/BatteryDefender.cpp b/health/BatteryDefender.cpp
index 37283da5..277f75a6 100644
--- a/health/BatteryDefender.cpp
+++ b/health/BatteryDefender.cpp
@@ -151,9 +151,8 @@ bool BatteryDefender::isBatteryDefenderDisabled(const int vendorStart, const int
const bool isDefaultVendorChargeLevel = isDefaultChargeLevel(vendorStart, vendorStop);
const bool isExplicitlyDisabled =
android::base::GetBoolProperty(kPropBatteryDefenderDisable, false);
- const bool isDebuggable = android::base::GetBoolProperty(kPropDebuggable, false);
- return isExplicitlyDisabled || (isDefaultVendorChargeLevel == false) || (isDebuggable == false);
+ return isExplicitlyDisabled || (isDefaultVendorChargeLevel == false);
}
void BatteryDefender::addTimeToChargeTimers(void) {
diff --git a/health/include/pixelhealth/BatteryDefender.h b/health/include/pixelhealth/BatteryDefender.h
index 30512c2f..42d8a55a 100644
--- a/health/include/pixelhealth/BatteryDefender.h
+++ b/health/include/pixelhealth/BatteryDefender.h
@@ -89,7 +89,6 @@ class BatteryDefender {
const char *const kPropBatteryDefenderState = "vendor.battery.defender.state";
const char *const kPropBatteryDefenderDisable = "vendor.battery.defender.disable";
const char *const kPropBatteryDefenderThreshold = "vendor.battery.defender.threshold";
- const char *const kPropDebuggable = "ro.debuggable";
const char *const kPropBootmode = "ro.bootmode";
// Default thresholds
diff --git a/health/test/TestBatteryDefender.cpp b/health/test/TestBatteryDefender.cpp
index 11ce12fe..5edd4f4d 100644
--- a/health/test/TestBatteryDefender.cpp
+++ b/health/test/TestBatteryDefender.cpp
@@ -142,13 +142,11 @@ const char *kPropChargeLevelVendorStop = "persist.vendor.charge.stop.level";
const char *kPropBatteryDefenderState = "vendor.battery.defender.state";
const char *kPropBatteryDefenderDisable = "vendor.battery.defender.disable";
const char *kPropBatteryDefenderThreshold = "vendor.battery.defender.threshold";
-const char *kPropDebuggable = "ro.debuggable";
static void enableDefender(void) {
ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStart, _, _, _)).WillByDefault(Return(0));
ON_CALL(*mock, GetIntProperty(kPropChargeLevelVendorStop, _, _, _)).WillByDefault(Return(100));
ON_CALL(*mock, GetBoolProperty(kPropBatteryDefenderDisable, _)).WillByDefault(Return(false));
- ON_CALL(*mock, GetBoolProperty(kPropDebuggable, _)).WillByDefault(Return(true));
}
static void powerAvailable(void) {
@@ -202,16 +200,6 @@ TEST_F(BatteryDefenderTest, DisableNonDefaultLevels) {
battDefender.update();
}
-TEST_F(BatteryDefenderTest, DisableDebuggable) {
- BatteryDefender battDefender;
-
- // Enable Battery Defender
- EXPECT_CALL(*mock, GetBoolProperty(kPropDebuggable, _)).WillOnce(Return(false));
-
- EXPECT_CALL(*mock, SetProperty(kPropBatteryDefenderState, "DISABLED"));
- battDefender.update();
-}
-
TEST_F(BatteryDefenderTest, DisableExplicit) {
BatteryDefender battDefender;