Update Battery settings main page string (1/2)

- Update Battery usage preference summary string
 - Update Battery saver preference summary string
 - Update Adaptive preference column string
 Screenshot: https://screenshot.googleplex.com/6FVaoeHjTSFs2o6.png

Bug: 183689347
Test: make RunSettingsRoboTests -j40
Change-Id: I72c5ebb5d3fd189db7c40c645b8dab4367d154ba
This commit is contained in:
Wesley.CW Wang
2021-03-25 20:13:15 +08:00
parent f1e41c0bd9
commit 2ce80cdb6b
5 changed files with 16 additions and 30 deletions

View File

@@ -105,7 +105,8 @@ public class BatterySaverControllerTest {
Settings.Global.AUTOMATIC_POWER_SAVE_MODE,
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
assertThat(mBatterySaverController.getSummary()).isEqualTo("Based on your routine");
assertThat(mBatterySaverController.getSummary()).
isEqualTo("Will turn on based on your routine");
}
@Test

View File

@@ -63,31 +63,20 @@ public class BatteryManagerPreferenceControllerTest {
}
@Test
public void updateState_smartBatteryOnWithRestrictApps_showSummary() {
mController.updateSummary(mPreference, true /* smartBatteryOn */, 2);
public void updateState_smartBatteryWithRestrictApps_showSummary() {
mController.updateSummary(mPreference, 2);
assertThat(mPreference.getSummary()).isEqualTo("2 apps restricted");
}
@Test
public void updateState_smartBatteryOnWithoutRestriction_showSummary() {
public void updateState_smartBatteryWithoutRestriction_showSummary() {
when(mFeatureFactory.powerUsageFeatureProvider.isSmartBatterySupported()).thenReturn(true);
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, ON);
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo("On / Detecting when apps drain battery");
}
@Test
public void updateState_smartBatteryOff_showSummary() {
when(mFeatureFactory.powerUsageFeatureProvider.isSmartBatterySupported()).thenReturn(true);
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, OFF);
mController.updateState(mPreference);
assertThat(mPreference.getSummary()).isEqualTo("Off");
assertThat(mPreference.getSummary()).isEqualTo("Detecting when apps drain battery");
}
}