diff options
author | Hung-ying Tyan <tyanh@google.com> | 2009-09-30 11:56:05 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2009-09-30 11:56:05 +0800 |
commit | b0883cb384fc7ad46e011a72355c9fda924e5b28 (patch) | |
tree | eacb6593004eb76c3e6e922be9b764477604fefb /src | |
parent | cabb147ce57bdcbb6baa08686415ce03f97028d7 (diff) | |
download | packages_apps_settings-b0883cb384fc7ad46e011a72355c9fda924e5b28.zip packages_apps_settings-b0883cb384fc7ad46e011a72355c9fda924e5b28.tar.gz packages_apps_settings-b0883cb384fc7ad46e011a72355c9fda924e5b28.tar.bz2 |
Fix bugs in credential storage settings:
* resume credential storage settings in onResume() in case if a new
activity changes the settings and switches back.
* reset mRetry in case the dialog is retried and canceled.
* update preferences in onDismiss handler in case the dialog is canceled
and need to revert the checkbox.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index 80300e0..5a4d26b 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -231,6 +231,8 @@ public class SecuritySettings extends PreferenceActivity { mShowPassword.setChecked(Settings.System.getInt(getContentResolver(), Settings.System.TEXT_SHOW_PASSWORD, 1) != 0); + + mCstorHelper.resume(); } @Override @@ -362,7 +364,7 @@ public class SecuritySettings extends PreferenceActivity { private View mView; private int mDialogId; - private boolean mRetry = false; + private boolean mRetry; private CheckBoxPreference mAccessCheckBox; private Preference mResetButton; @@ -383,6 +385,11 @@ public class SecuritySettings extends PreferenceActivity { } } + void resume() { + if (mExternalIntent != null) return; + updatePreferences(mKeyStore.test()); + } + private void updatePreferences(int state) { mAccessCheckBox.setEnabled(state != KeyStore.UNINITIALIZED); mAccessCheckBox.setChecked(state == KeyStore.NO_ERROR); @@ -428,6 +435,7 @@ public class SecuritySettings extends PreferenceActivity { private void showCstorDialog(int dialogId) { mDialogId = dialogId; + mRetry = false; showDialog(dialogId); } @@ -455,6 +463,7 @@ public class SecuritySettings extends PreferenceActivity { showCstorDialog(mDialogId); } else { removeDialog(mDialogId); + updatePreferences(mState); // may revert checkbox if (mExternalIntent != null) { finish(); |