diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2010-03-09 19:12:46 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2010-03-09 20:32:20 -0800 |
commit | f7adf2bd075c18d46b07b6a383a138008087005a (patch) | |
tree | 0c2d09c642bb1abf917f7420d1b7ed79a4fd1a74 /src/com/android/settings | |
parent | 8542d8972ce39358a963edfbe7535d7af5fd129b (diff) | |
download | packages_apps_Settings-f7adf2bd075c18d46b07b6a383a138008087005a.tar.gz packages_apps_Settings-f7adf2bd075c18d46b07b6a383a138008087005a.tar.bz2 packages_apps_Settings-f7adf2bd075c18d46b07b6a383a138008087005a.zip |
Fixing bug 2486048 - Disabling Accessibility does not disable Accessibility services check boxes
Change-Id: Ie5d78c1ddb61241db8259a200a3df1950d767cce
Diffstat (limited to 'src/com/android/settings')
-rw-r--r-- | src/com/android/settings/AccessibilitySettings.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/settings/AccessibilitySettings.java b/src/com/android/settings/AccessibilitySettings.java index 276a22f1a..b2debd207 100644 --- a/src/com/android/settings/AccessibilitySettings.java +++ b/src/com/android/settings/AccessibilitySettings.java @@ -105,6 +105,8 @@ public class AccessibilitySettings extends PreferenceActivity { if (!accessibilityServices.isEmpty()) { if (serviceState == 1) { mToggleCheckBox.setChecked(true); + } else { + setAccessibilityServicePreferencesState(false); } mToggleCheckBox.setEnabled(true); } else { @@ -127,6 +129,24 @@ public class AccessibilitySettings extends PreferenceActivity { persistEnabledAccessibilityServices(); } + /** + * Sets the state of the preferences for enabling/disabling + * AccessibilityServices. + * + * @param isEnabled If to enable or disable the preferences. + */ + private void setAccessibilityServicePreferencesState(boolean isEnabled) { + if (mAccessibilityServicesCategory == null) { + return; + } + + int count = mAccessibilityServicesCategory.getPreferenceCount(); + for (int i = 0; i < count; i++) { + Preference pref = mAccessibilityServicesCategory.getPreference(i); + pref.setEnabled(isEnabled); + } + } + @Override public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { final String key = preference.getKey(); @@ -150,6 +170,7 @@ public class AccessibilitySettings extends PreferenceActivity { if (preference.isChecked()) { Settings.Secure.putInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 1); + setAccessibilityServicePreferencesState(true); } else { final CheckBoxPreference checkBoxPreference = preference; AlertDialog dialog = (new AlertDialog.Builder(this)) @@ -162,6 +183,7 @@ public class AccessibilitySettings extends PreferenceActivity { public void onClick(DialogInterface dialog, int which) { Settings.Secure.putInt(getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, 0); + setAccessibilityServicePreferencesState(false); } }) .setNegativeButton(android.R.string.cancel, |