Clean up the KEY_ROUTINE from the Settings

Fix: 258603978
Test: make RunSettingsRoboTests
Change-Id: I65033ca18953b57317af64418bb0b18d48eaacd8
This commit is contained in:
ykhung
2022-11-15 15:06:18 +08:00
parent a2f5c5a24e
commit 3cf14b682e
2 changed files with 8 additions and 37 deletions

View File

@@ -52,7 +52,7 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
assertThat(mController.getDefaultKey())
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
}
@Test
@@ -73,14 +73,6 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
}
@Test
public void setDefaultKey_any_defaultsToNoScheduleIfWarningNotSeen() {
Secure.putString(
mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, "null");
mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
assertThat(mController.getDefaultKey())
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
}
@Test
public void setDefaultKey_percentage_shouldSuppressNotification() {
@@ -95,17 +87,4 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
assertThat(result).isEqualTo(1);
}
@Test
public void setDefaultKey_routine_shouldSuppressNotification() {
Secure.putInt(
mContext.getContentResolver(), Secure.LOW_POWER_WARNING_ACKNOWLEDGED, 1);
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
mController.setDefaultKey(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
final int result = Settings.Secure.getInt(mResolver,
Secure.SUPPRESS_AUTO_BATTERY_SAVER_SUGGESTION, 0);
assertThat(result).isEqualTo(1);
}
}