From fa7786cbe7e846841c2828d8143325144b75f619 Mon Sep 17 00:00:00 2001 From: Anna Galusza Date: Tue, 22 Dec 2015 10:53:44 -0800 Subject: [PATCH] Add remaining Accessibility Settings to backup list. Note additional settings that should not be restored if they are already set (on account of the new Setup Wizard, which allows critical Accessibility Settings to be set before restore). Change-Id: I95524abbef20ab12e529a2b1e6165adc7294c3db --- core/java/android/provider/Settings.java | 20 +++++++++++++++++-- .../providers/settings/SettingsHelper.java | 19 ++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index e1391da080aa5..1908aea5f8653 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -3300,7 +3300,8 @@ public final class Settings { VIBRATE_WHEN_RINGING, RINGTONE, LOCK_TO_APP_ENABLED, - NOTIFICATION_SOUND + NOTIFICATION_SOUND, + ACCELEROMETER_ROTATION }; /** @@ -5813,10 +5814,15 @@ public final class Settings { PARENTAL_CONTROL_ENABLED, PARENTAL_CONTROL_REDIRECT_URL, USB_MASS_STORAGE_ENABLED, // moved to global + ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, + ACCESSIBILITY_DISPLAY_DALTONIZER, + ACCESSIBILITY_DISPLAY_COLOR_MATRIX, + ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED, ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE, ACCESSIBILITY_SCRIPT_INJECTION, + ACCESSIBILITY_WEB_CONTENT_KEY_BINDINGS, BACKUP_AUTO_RESTORE, ENABLED_ACCESSIBILITY_SERVICES, ENABLED_NOTIFICATION_LISTENERS, @@ -5826,6 +5832,7 @@ public final class Settings { ACCESSIBILITY_ENABLED, ACCESSIBILITY_SPEAK_PASSWORD, ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED, + ACCESSIBILITY_CAPTIONING_PRESET, ACCESSIBILITY_CAPTIONING_ENABLED, ACCESSIBILITY_CAPTIONING_LOCALE, ACCESSIBILITY_CAPTIONING_BACKGROUND_COLOR, @@ -5834,6 +5841,7 @@ public final class Settings { ACCESSIBILITY_CAPTIONING_EDGE_COLOR, ACCESSIBILITY_CAPTIONING_TYPEFACE, ACCESSIBILITY_CAPTIONING_FONT_SCALE, + ACCESSIBILITY_CAPTIONING_WINDOW_COLOR, TTS_USE_DEFAULTS, TTS_DEFAULT_RATE, TTS_DEFAULT_PITCH, @@ -5842,6 +5850,7 @@ public final class Settings { TTS_DEFAULT_COUNTRY, TTS_ENABLED_PLUGINS, TTS_DEFAULT_LOCALE, + SHOW_IME_WITH_HARD_KEYBOARD, WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global @@ -5855,9 +5864,16 @@ public final class Settings { UI_NIGHT_MODE, SLEEP_TIMEOUT, DOUBLE_TAP_TO_WAKE, + WAKE_GESTURE_ENABLED, + LONG_PRESS_TIMEOUT, CAMERA_GESTURE_DISABLED, ACCESSIBILITY_AUTOCLICK_ENABLED, - ACCESSIBILITY_AUTOCLICK_DELAY + ACCESSIBILITY_AUTOCLICK_DELAY, + ACCESSIBILITY_LARGE_POINTER_ICON, + PREFERRED_TTY_MODE, + ENHANCED_VOICE_PRIVACY_ENABLED, + TTY_MODE_ENABLED, + INCALL_POWER_BUTTON_BEHAVIOR }; /** diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java index e12e3a5718800..e5aeb3c3c374c 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsHelper.java @@ -229,18 +229,25 @@ public class SettingsHelper { } private boolean isAlreadyConfiguredCriticalAccessibilitySetting(String name) { - // These are the critical accessibility settings that are required for a - // blind user to be able to interact with the device. If these settings are + // These are the critical accessibility settings that are required for users with + // accessibility needs to be able to interact with the device. If these settings are // already configured, we will not overwrite them. If they are already set, - // it means that the user has performed a global gesture to enable accessibility - // and definitely needs these features working after the restore. + // it means that the user has performed a global gesture to enable accessibility or set + // these settings in the Accessibility portion of the Setup Wizard, and definitely needs + // these features working after the restore. if (Settings.Secure.ACCESSIBILITY_ENABLED.equals(name) || Settings.Secure.ACCESSIBILITY_SCRIPT_INJECTION.equals(name) || Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD.equals(name) - || Settings.Secure.TOUCH_EXPLORATION_ENABLED.equals(name)) { + || Settings.Secure.TOUCH_EXPLORATION_ENABLED.equals(name) + || Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED.equals(name) + || Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_ENABLED.equals(name) + || Settings.Secure.UI_NIGHT_MODE.equals(name)) { return Settings.Secure.getInt(mContext.getContentResolver(), name, 0) != 0; } else if (Settings.Secure.TOUCH_EXPLORATION_GRANTED_ACCESSIBILITY_SERVICES.equals(name) - || Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(name)) { + || Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES.equals(name) + || Settings.Secure.ACCESSIBILITY_DISPLAY_COLOR_MATRIX.equals(name) + || Settings.Secure.ACCESSIBILITY_DISPLAY_DALTONIZER.equals(name) + || Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE.equals(name)) { return !TextUtils.isEmpty(Settings.Secure.getString( mContext.getContentResolver(), name)); }