Keep SwitchPreference status until user makes choice in confirmation dialog.

Bug: 17062433
Change-Id: I2c52be1921e1eefa3b2b2868cc526675c9215a41
This commit is contained in:
arete
2014-08-15 12:04:48 -07:00
committed by Di Wu
parent e3bced2cda
commit 300e920f66
2 changed files with 7 additions and 2 deletions

View File

@@ -592,6 +592,7 @@ public class SecuritySettings extends SettingsPreferenceFragment
@Override
public boolean onPreferenceChange(Preference preference, Object value) {
boolean result = true;
final String key = preference.getKey();
final LockPatternUtils lockPatternUtils = mChooseLockSettingsHelper.utils();
if (KEY_LOCK_AFTER_TIMEOUT.equals(key)) {
@@ -636,11 +637,13 @@ public class SecuritySettings extends SettingsPreferenceFragment
if ((Boolean) value) {
mToggleAppInstallation.setChecked(false);
warnAppInstallation();
// Don't change Switch status until user makes choice in dialog, so return false.
result = false;
} else {
setNonMarketAppsAllowed(false);
}
}
return true;
return result;
}
@Override