Introduce PictureColorModePreferenceController

- Create new PictureColorModePreferenceController
 - Create controller inside the DashboardFragment
 - Refactor ColorModePreference so isAvailable() no longer depends on
 ColorModePreference
 - Port logic from DevelopmentSettings into the controller

Bug: 34203528
Test: make RunSettingsRoboTests -j40
Change-Id: I8dff5b0d5ad1d7f043fc7ead540b2c0c960933e3
This commit is contained in:
jeffreyhuang
2017-09-18 14:45:49 -07:00
parent 31b04f526f
commit 6162fa5ef8
5 changed files with 273 additions and 18 deletions

View File

@@ -112,6 +112,9 @@ public class DevelopmentSettingsDashboardFragmentTest {
}
@Test
@Config(shadows = {
ShadowPictureColorModePreferenceController.class
})
public void searchIndex_pageEnabled_shouldNotAddKeysToNonIndexable() {
final Context appContext = RuntimeEnvironment.application;
DevelopmentSettingsEnabler.setDevelopmentSettingsEnabled(appContext, true);
@@ -198,4 +201,13 @@ public class DevelopmentSettingsDashboardFragmentTest {
mShown = true;
}
}
@Implements(PictureColorModePreferenceController.class)
public static class ShadowPictureColorModePreferenceController {
@Implementation
public boolean isAvailable() {
return true;
}
}
}