Merge "Get auto-battery saver threshold max from global setting" into pi-dev

This commit is contained in:
TreeHugger Robot
2018-03-09 03:51:41 +00:00
committed by Android (Google) Code Review
2 changed files with 41 additions and 1 deletions

View File

@@ -99,4 +99,24 @@ public class AutoBatterySeekBarPreferenceControllerTest {
assertThat(Settings.Global.getInt(mContext.getContentResolver(),
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL, 0)).isEqualTo(TRIGGER_LEVEL);
}
@Test
public void testOnPreferenceChange_changeMax() {
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL_MAX, 50);
mController.updateState(mPreference);
assertThat(mPreference.getMax()).isEqualTo(50);
}
@Test
public void testOnPreferenceChange_noChangeMax() {
Settings.Global.putInt(mContext.getContentResolver(),
Settings.Global.LOW_POWER_MODE_TRIGGER_LEVEL_MAX, 0);
mController.updateState(mPreference);
assertThat(mPreference.getMax()).isEqualTo(100);
}
}