Keep SwitchPreference status until user makes choice in confirmation dialog.
Bug: 17062433 Change-Id: I2c52be1921e1eefa3b2b2868cc526675c9215a41
This commit is contained in:
@@ -113,11 +113,13 @@ public class PrivacySettings extends SettingsPreferenceFragment implements
|
||||
boolean result = false;
|
||||
if (preference == mBackup) {
|
||||
if (nextValue == false) {
|
||||
// Don't change Switch status until user makes choice in dialog
|
||||
// so return false here.
|
||||
showEraseBackupDialog();
|
||||
} else {
|
||||
setBackupEnabled(true);
|
||||
}
|
||||
result = true;
|
||||
}
|
||||
} else if (preference == mAutoRestore) {
|
||||
try {
|
||||
mBackupManager.setAutoRestore(nextValue);
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user