Merge "Update battery saver schedule to show warning"
This commit is contained in:
committed by
Android (Google) Code Review
commit
db1c8a5fed
@@ -7,6 +7,7 @@ import android.content.Context;
|
||||
import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
import android.provider.Settings.Global;
|
||||
import android.provider.Settings.Secure;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -54,4 +55,13 @@ public class BatterySaverScheduleRadioButtonsControllerTest {
|
||||
assertThat(mController.getDefaultKey())
|
||||
.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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user