Rename battery saver schedule mode apis
The APIs that back these settings got renamed so this CL just refactors all the calls to use the new names. Test: robotests still pass Bug: 126944845 Change-Id: I2975c7c79998823058db2c0ced2e5cf02216a106
This commit is contained in:
@@ -62,7 +62,7 @@ public class BatterySaverSchedulePreferenceControllerTest {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0);
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Global.AUTOMATIC_POWER_SAVER_MODE, PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Global.AUTOMATIC_POWER_SAVE_MODE, PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
|
||||
mController.updateState(mPreference);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class BatterySaverSchedulePreferenceControllerTest {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, TRIGGER_LEVEL);
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Global.AUTOMATIC_POWER_SAVER_MODE, PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Global.AUTOMATIC_POWER_SAVE_MODE, PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
|
||||
mController.updateState(mPreference);
|
||||
|
||||
@@ -87,7 +87,7 @@ public class BatterySaverSchedulePreferenceControllerTest {
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, TRIGGER_LEVEL);
|
||||
Settings.Global.putInt(mContext.getContentResolver(),
|
||||
Global.AUTOMATIC_POWER_SAVER_MODE, PowerManager.POWER_SAVER_MODE_DYNAMIC);
|
||||
Global.AUTOMATIC_POWER_SAVE_MODE, PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
|
||||
mController.updateState(mPreference);
|
||||
|
||||
|
@@ -31,16 +31,16 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
|
||||
@Test
|
||||
public void getDefaultKey_routine_returnsCorrectValue() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_DYNAMIC);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
assertThat(mController.getDefaultKey())
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_ROUTINE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getDefaultKey_automatic_returnsCorrectValue() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 5);
|
||||
assertThat(mController.getDefaultKey())
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_PERCENTAGE);
|
||||
@@ -48,8 +48,8 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
|
||||
@Test
|
||||
public void getDefaultKey_none_returnsCorrectValue() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0);
|
||||
assertThat(mController.getDefaultKey())
|
||||
.isEqualTo(BatterySaverScheduleRadioButtonsController.KEY_NO_SCHEDULE);
|
||||
|
@@ -39,16 +39,16 @@ public class BatterySaverScheduleSeekBarControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateSeekBar_routineMode_hasCorrectProperties() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_DYNAMIC);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_DYNAMIC);
|
||||
mController.updateSeekBar();
|
||||
assertThat(mController.mSeekBarPreference.isVisible()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateSeekBar_percentageMode_hasCorrectProperties() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 5);
|
||||
mController.updateSeekBar();
|
||||
assertThat(mController.mSeekBarPreference.isVisible()).isTrue();
|
||||
@@ -56,8 +56,8 @@ public class BatterySaverScheduleSeekBarControllerTest {
|
||||
|
||||
@Test
|
||||
public void updateSeekBar_noneMode_hasCorrectProperties() {
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVER_MODE,
|
||||
PowerManager.POWER_SAVER_MODE_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.AUTOMATIC_POWER_SAVE_MODE,
|
||||
PowerManager.POWER_SAVE_MODE_TRIGGER_PERCENTAGE);
|
||||
Settings.Global.putInt(mResolver, Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0);
|
||||
mController.updateSeekBar();
|
||||
assertThat(mController.mSeekBarPreference.isVisible()).isFalse();
|
||||
|
Reference in New Issue
Block a user