Merge "Fixes incorrect Settings usages in ContextualAdaptiveSleepSliceTest" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-03-20 03:40:00 +00:00
committed by Android (Google) Code Review

View File

@@ -66,7 +66,7 @@ public class ContextualAdaptiveSleepSliceTest {
mContext = spy(RuntimeEnvironment.application); mContext = spy(RuntimeEnvironment.application);
mContextualAdaptiveSleepSlice = spy(new ContextualAdaptiveSleepSlice(mContext)); mContextualAdaptiveSleepSlice = spy(new ContextualAdaptiveSleepSlice(mContext));
Settings.System.putInt(mContext.getContentResolver(), Settings.System.ADAPTIVE_SLEEP, 0); Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ADAPTIVE_SLEEP, 0);
doReturn(mPackageManager).when(mContext).getPackageManager(); doReturn(mPackageManager).when(mContext).getPackageManager();
doReturn(mSharedPreferences).when(mContext).getSharedPreferences(eq(PREF), anyInt()); doReturn(mSharedPreferences).when(mContext).getSharedPreferences(eq(PREF), anyInt());
doReturn(true).when(mContextualAdaptiveSleepSlice).isSettingsAvailable(); doReturn(true).when(mContextualAdaptiveSleepSlice).isSettingsAvailable();
@@ -124,7 +124,7 @@ public class ContextualAdaptiveSleepSliceTest {
@Test @Test
public void getSlice_DoNotShowIFTurnedOn() { public void getSlice_DoNotShowIFTurnedOn() {
Settings.System.putInt(mContext.getContentResolver(), Settings.System.ADAPTIVE_SLEEP, 1); Settings.Secure.putInt(mContext.getContentResolver(), Settings.Secure.ADAPTIVE_SLEEP, 1);
final Slice slice = mContextualAdaptiveSleepSlice.getSlice(); final Slice slice = mContextualAdaptiveSleepSlice.getSlice();