Merge "Fixes 'no ripple effect' issue for screen attention setting" into sc-dev

This commit is contained in:
Yi Jiang
2021-04-29 17:19:34 +00:00
committed by Android (Google) Code Review
5 changed files with 55 additions and 36 deletions

View File

@@ -84,6 +84,7 @@ public class AdaptiveSleepPreferenceControllerTest {
eq(UserManager.DISALLOW_CONFIG_SCREEN_TIMEOUT))).thenReturn(null);
mController = new AdaptiveSleepPreferenceController(mContext, mRestrictionUtils);
mController.initializePreference();
when(mController.isCameraLocked()).thenReturn(false);
}

View File

@@ -60,8 +60,6 @@ public class ScreenTimeoutSettingsTest {
private ScreenTimeoutSettings mSettings;
private Context mContext;
private ContentResolver mContentResolver;
@Mock
private Resources mResources;
@Mock
@@ -85,7 +83,9 @@ public class ScreenTimeoutSettingsTest {
FakeFeatureFactory.setupForTest();
mContext = spy(getApplicationContext());
mSettings = spy(new ScreenTimeoutSettings());
mSettings.mContext = mContext;
mContentResolver = mContext.getContentResolver();
mResources = spy(mContext.getResources());
doReturn(TIMEOUT_ENTRIES).when(mResources).getStringArray(R.array.screen_timeout_entries);
doReturn(TIMEOUT_VALUES).when(mResources).getStringArray(R.array.screen_timeout_entries);