Revert "Add ability to show/hide Color Correction and Color Inversion."

This reverts commit f1346930bc.

Reason for revert: Moving logic elsewhere.

Change-Id: Ia07b3f4c33e0078e8f35c69d5ed51daf197ff165
This commit is contained in:
Ben Lin
2018-02-16 22:14:59 +00:00
parent 463c9a07f0
commit c64531bbce
4 changed files with 3 additions and 62 deletions

View File

@@ -150,12 +150,6 @@
<!-- Whether default_home should be shown or not. --> <!-- Whether default_home should be shown or not. -->
<bool name="config_show_default_home">true</bool> <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. --> <!-- Whether assist_and_voice_input should be shown or not. -->
<bool name="config_show_assist_and_voice_input">true</bool> <bool name="config_show_assist_and_voice_input">true</bool>

View File

@@ -92,6 +92,8 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
// Preferences // Preferences
private static final String TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE = private static final String TOGGLE_HIGH_TEXT_CONTRAST_PREFERENCE =
"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 = private static final String TOGGLE_POWER_BUTTON_ENDS_CALL_PREFERENCE =
"toggle_power_button_ends_call_preference"; "toggle_power_button_ends_call_preference";
private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE = private static final String TOGGLE_LOCK_SCREEN_ROTATION_PREFERENCE =
@@ -117,10 +119,7 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
"autoclick_preference_screen"; "autoclick_preference_screen";
private static final String VIBRATION_PREFERENCE_SCREEN = private static final String VIBRATION_PREFERENCE_SCREEN =
"vibration_preference_screen"; "vibration_preference_screen";
private static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN =
@VisibleForTesting static final String TOGGLE_INVERSION_PREFERENCE =
"toggle_inversion_preference";
@VisibleForTesting static final String DISPLAY_DALTONIZER_PREFERENCE_SCREEN =
"daltonizer_preference_screen"; "daltonizer_preference_screen";
// Extras passed to sub-fragments. // Extras passed to sub-fragments.
@@ -626,8 +625,6 @@ public class AccessibilitySettings extends SettingsPreferenceFragment implements
displayCategory.addPreference(mToggleInversionPreference); displayCategory.addPreference(mToggleInversionPreference);
displayCategory.addPreference(mDisplayDaltonizerPreferenceScreen); displayCategory.addPreference(mDisplayDaltonizerPreferenceScreen);
} }
checkColorCorrectionVisibility(mDisplayDaltonizerPreferenceScreen);
checkColorInversionVisibility(mToggleInversionPreference);
// Text contrast. // Text contrast.
mToggleHighTextContrastPreference.setChecked( mToggleHighTextContrastPreference.setChecked(
@@ -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) { private static void configureMagnificationPreferenceIfNeeded(Preference preference) {
// Some devices support only a single magnification mode. In these cases, we redirect to // 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 // the magnification mode's UI directly, rather than showing a PreferenceScreen with a

View File

@@ -54,8 +54,6 @@
<bool name="config_show_tts_settings_summary">false</bool> <bool name="config_show_tts_settings_summary">false</bool>
<bool name="config_show_pointer_speed">false</bool> <bool name="config_show_pointer_speed">false</bool>
<bool name="config_show_vibrate_input_devices">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_show_system_update_settings">false</bool>
<bool name="config_wifi_support_connected_mac_randomization">false</bool> <bool name="config_wifi_support_connected_mac_randomization">false</bool>
<bool name="config_show_device_model">false</bool> <bool name="config_show_device_model">false</bool>

View File

@@ -47,38 +47,4 @@ public class AccessibilitySettingsTest {
assertThat(keys).containsAllIn(niks); 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);
}
} }