Revert "Add ability to show/hide Color Correction and Color Inversion."
This reverts commit f1346930bc18530940e464b4eb772d7717763a40.
Reason for revert: Moving logic elsewhere.
Change-Id: Ia07b3f4c33e0078e8f35c69d5ed51daf197ff165
diff --git a/res/values/bools.xml b/res/values/bools.xml
index 1089fba..4665f2e 100644
--- a/res/values/bools.xml
+++ b/res/values/bools.xml
@@ -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>
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index ef3eb27..2292ca2 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -92,6 +92,8 @@
// 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 =
@@ -117,10 +119,7 @@
"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.
@@ -626,8 +625,6 @@
displayCategory.addPreference(mToggleInversionPreference);
displayCategory.addPreference(mDisplayDaltonizerPreferenceScreen);
}
- checkColorCorrectionVisibility(mDisplayDaltonizerPreferenceScreen);
- checkColorInversionVisibility(mToggleInversionPreference);
// Text contrast.
mToggleHighTextContrastPreference.setChecked(
@@ -802,20 +799,6 @@
}
}
- @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
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 606a740..788c593 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -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>
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
index c853c7f..fb32da1 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilitySettingsTest.java
@@ -47,38 +47,4 @@
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);
- }
}