Fixes 'no ripple effect' issue for screen attention setting
Preferences shouldn't be initialized at onAttach() because the settings style hasn't been loaded yet. This change defers the preferences initialization so that they comply with the settings style. Test: manually Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.display Bug: 183909540 Change-Id: I4dc4503924a1dcd5b8d41f7d27e576befb11f976
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user