Hook up Adaptive Battery to new flag.

APP_STANDBY_ENABLED is controlled by server side to do experiment.
Before this CL, Adaptive Battery is hooked up to this flag, so
even though if user turns it off, it may be turned on by server.

Add a high level ADAPTIVE_BATTERY_MANAGEMENT_ENABLED to control
the feature in settings UI side.

Bug: 78153913
Test: RunSettingsRoboTests
Change-Id: I1a18d622ddc31ec4d45db918bf981516fbb926c1
This commit is contained in:
Lei Yu
2018-04-19 10:46:37 -07:00
parent 1257466d0b
commit df5beee68b
7 changed files with 19 additions and 14 deletions

View File

@@ -107,10 +107,12 @@ public class SmartBatteryPreferenceControllerTest {
}
private void putSmartBatteryValue(int value) {
Settings.Global.putInt(mContentResolver, Settings.Global.APP_STANDBY_ENABLED, value);
Settings.Global.putInt(mContentResolver,
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, value);
}
private int getSmartBatteryValue() {
return Settings.Global.getInt(mContentResolver, Settings.Global.APP_STANDBY_ENABLED, ON);
return Settings.Global.getInt(mContentResolver,
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, ON);
}
}