Merge "Clean up the KEY_ROUTINE from the Settings"

This commit is contained in:
YK Hung
2022-11-15 15:25:04 +00:00
committed by Android (Google) Code Review
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);
}
}