Loading res/values/bools.xml +0 −6 Original line number Diff line number Diff line Loading @@ -150,12 +150,6 @@ <!-- Whether default_home should be shown or not. --> <bool name="config_show_default_home">true</bool> <!-- Whether color correction preference should be shown or not. --> <bool name="config_show_color_correction_preference">true</bool> <!-- Whether color inversion preference should be shown or not. --> <bool name="config_show_color_inversion_preference">true</bool> <!-- Whether assist_and_voice_input should be shown or not. --> <bool name="config_show_assist_and_voice_input">true</bool> Loading src/com/android/settings/accessibility/AccessibilitySettings.java +3 −20 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements // Preferences private static final String TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE = "toggle_high_text_contrast_preference"; private static final String TOGGLE_INVERSION_PREFERENCE = "toggle_inversion_preference"; private static final String TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE = "toggle_power_button_ends_call_preference"; private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE = Loading @@ -117,10 +119,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements "autoclick_preference_screen"; private static final String VIBRATION_PREFERENCE_SCREEN = "vibration_preference_screen"; @VisibleForTesting static final String TOGGLE_INVERSION_PREFERENCE = "toggle_inversion_preference"; @VisibleForTesting static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN = private static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN = "daltonizer_preference_screen"; // Extras passed to sub-fragments. Loading Loading @@ -626,8 +625,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements displayCategory.addPreference(mToggleInversionPreference); displayCategory.addPreference(mDisplayDaltonizerPreferenceScreen); } checkColorCorrectionVisibility(mDisplayDaltonizerPreferenceScreen); checkColorInversionVisibility(mToggleInversionPreference); // Text contrast. mToggleHighTextContrastPreference.setChecked( Loading Loading @@ -802,20 +799,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements } } @VisibleForTesting void checkColorCorrectionVisibility(Preference preference) { if (!getContext().getResources().getBoolean( R.bool.config_show_color_correction_preference)) { removePreference(DISPLAY_DALTONIZER_PREFERENCE_SCREEN); } } @VisibleForTesting void checkColorInversionVisibility(Preference preference) { if (!getContext().getResources().getBoolean( R.bool.config_show_color_inversion_preference)) { removePreference(TOGGLE_INVERSION_PREFERENCE); } } private static void configureMagnificationPreferenceIfNeeded(Preference preference) { // Some devices support only a single magnification mode. In these cases, we redirect to // the magnification mode's UI directly, rather than showing a PreferenceScreen with a Loading tests/robotests/res/values-mcc999/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ <bool name="config_show_tts_settings_summary">false</bool> <bool name="config_show_pointer_speed">false</bool> <bool name="config_show_vibrate_input_devices">false</bool> <bool name="config_show_color_correction_preference">false</bool> <bool name="config_show_color_inversion_preference">false</bool> <bool name="config_show_system_update_settings">false</bool> <bool name="config_wifi_support_connected_mac_randomization">false</bool> <bool name="config_show_device_model">false</bool> Loading tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java +0 −34 Original line number Diff line number Diff line Loading @@ -47,38 +47,4 @@ public class AccessibilitySettingsTest { assertThat(keys).containsAllIn(niks); } @Test public void testColorInversionPreference_byDefault_shouldBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorInversionVisibility(preference); assertThat(mColorInversionPreferenceRemoved).isEqualTo(false); } @Test @Config(qualifiers = "mcc999") public void testColorInversionPreference_ifDisabled_shouldNotBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorInversionVisibility(preference); assertThat(mColorInversionPreferenceRemoved).isEqualTo(true); } @Test public void testColorCorrectionPreference_byDefault_shouldBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorCorrectionVisibility(preference); assertThat(mColorCorrectionPreferenceRemoved).isEqualTo(false); } @Test @Config(qualifiers = "mcc999") public void testColorCorrectionPreference_ifDisabled_shouldNotBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorCorrectionVisibility(preference); assertThat(mColorCorrectionPreferenceRemoved).isEqualTo(true); } } Loading
res/values/bools.xml +0 −6 Original line number Diff line number Diff line Loading @@ -150,12 +150,6 @@ <!-- Whether default_home should be shown or not. --> <bool name="config_show_default_home">true</bool> <!-- Whether color correction preference should be shown or not. --> <bool name="config_show_color_correction_preference">true</bool> <!-- Whether color inversion preference should be shown or not. --> <bool name="config_show_color_inversion_preference">true</bool> <!-- Whether assist_and_voice_input should be shown or not. --> <bool name="config_show_assist_and_voice_input">true</bool> Loading
src/com/android/settings/accessibility/AccessibilitySettings.java +3 −20 Original line number Diff line number Diff line Loading @@ -92,6 +92,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements // Preferences private static final String TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE = "toggle_high_text_contrast_preference"; private static final String TOGGLE_INVERSION_PREFERENCE = "toggle_inversion_preference"; private static final String TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE = "toggle_power_button_ends_call_preference"; private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE = Loading @@ -117,10 +119,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements "autoclick_preference_screen"; private static final String VIBRATION_PREFERENCE_SCREEN = "vibration_preference_screen"; @VisibleForTesting static final String TOGGLE_INVERSION_PREFERENCE = "toggle_inversion_preference"; @VisibleForTesting static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN = private static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN = "daltonizer_preference_screen"; // Extras passed to sub-fragments. Loading Loading @@ -626,8 +625,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements displayCategory.addPreference(mToggleInversionPreference); displayCategory.addPreference(mDisplayDaltonizerPreferenceScreen); } checkColorCorrectionVisibility(mDisplayDaltonizerPreferenceScreen); checkColorInversionVisibility(mToggleInversionPreference); // Text contrast. mToggleHighTextContrastPreference.setChecked( Loading Loading @@ -802,20 +799,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements } } @VisibleForTesting void checkColorCorrectionVisibility(Preference preference) { if (!getContext().getResources().getBoolean( R.bool.config_show_color_correction_preference)) { removePreference(DISPLAY_DALTONIZER_PREFERENCE_SCREEN); } } @VisibleForTesting void checkColorInversionVisibility(Preference preference) { if (!getContext().getResources().getBoolean( R.bool.config_show_color_inversion_preference)) { removePreference(TOGGLE_INVERSION_PREFERENCE); } } private static void configureMagnificationPreferenceIfNeeded(Preference preference) { // Some devices support only a single magnification mode. In these cases, we redirect to // the magnification mode's UI directly, rather than showing a PreferenceScreen with a Loading
tests/robotests/res/values-mcc999/config.xml +0 −2 Original line number Diff line number Diff line Loading @@ -54,8 +54,6 @@ <bool name="config_show_tts_settings_summary">false</bool> <bool name="config_show_pointer_speed">false</bool> <bool name="config_show_vibrate_input_devices">false</bool> <bool name="config_show_color_correction_preference">false</bool> <bool name="config_show_color_inversion_preference">false</bool> <bool name="config_show_system_update_settings">false</bool> <bool name="config_wifi_support_connected_mac_randomization">false</bool> <bool name="config_show_device_model">false</bool> Loading
tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java +0 −34 Original line number Diff line number Diff line Loading @@ -47,38 +47,4 @@ public class AccessibilitySettingsTest { assertThat(keys).containsAllIn(niks); } @Test public void testColorInversionPreference_byDefault_shouldBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorInversionVisibility(preference); assertThat(mColorInversionPreferenceRemoved).isEqualTo(false); } @Test @Config(qualifiers = "mcc999") public void testColorInversionPreference_ifDisabled_shouldNotBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorInversionVisibility(preference); assertThat(mColorInversionPreferenceRemoved).isEqualTo(true); } @Test public void testColorCorrectionPreference_byDefault_shouldBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorCorrectionVisibility(preference); assertThat(mColorCorrectionPreferenceRemoved).isEqualTo(false); } @Test @Config(qualifiers = "mcc999") public void testColorCorrectionPreference_ifDisabled_shouldNotBeShown() { final Preference preference = new Preference(mContext); mFragment.checkColorCorrectionVisibility(preference); assertThat(mColorCorrectionPreferenceRemoved).isEqualTo(true); } }