diff options
author | Hung-ying Tyan <tyanh@google.com> | 2009-07-12 23:44:38 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-07-12 23:44:38 -0700 |
commit | 15384ee22af523017241de9fa0fd5afbdc804ea3 (patch) | |
tree | ab5ac34334002b85d98c9fc957135397e882d51e /src/com/android/settings/SecuritySettings.java | |
parent | 97beba7ba2ae544b125591d216474c64a0f83d38 (diff) | |
parent | 1ddccd07f744344b5248dd5418ee526f26d520dc (diff) | |
download | packages_apps_settings-15384ee22af523017241de9fa0fd5afbdc804ea3.zip packages_apps_settings-15384ee22af523017241de9fa0fd5afbdc804ea3.tar.gz packages_apps_settings-15384ee22af523017241de9fa0fd5afbdc804ea3.tar.bz2 |
am 1ddccd07: Fix dialog handling.
Merge commit '1ddccd07f744344b5248dd5418ee526f26d520dc'
* commit '1ddccd07f744344b5248dd5418ee526f26d520dc':
Fix dialog handling.
Diffstat (limited to 'src/com/android/settings/SecuritySettings.java')
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index b5624eb..831da72 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -454,8 +454,9 @@ public class SecuritySettings extends PreferenceActivity implements } } - private class CstorHelper implements - DialogInterface.OnClickListener, DialogInterface.OnDismissListener { + private class CstorHelper implements DialogInterface.OnClickListener, + DialogInterface.OnDismissListener, + DialogInterface.OnCancelListener { private Keystore mKeystore = Keystore.getInstance(); private View mView; private int mDialogId; @@ -535,14 +536,18 @@ public class SecuritySettings extends PreferenceActivity implements .show(); } + public void onCancel(DialogInterface dialog) { + if (mCstorAddCredentialHelper != null) { + // release the object here so that it doesn't get triggerred in + // onDismiss() + mCstorAddCredentialHelper = null; + finish(); + } + } + public void onClick(DialogInterface dialog, int which) { if (which == DialogInterface.BUTTON_NEGATIVE) { - if (mCstorAddCredentialHelper != null) { - // release the object here so that it doesn't get triggerred in - // onDismiss() - mCstorAddCredentialHelper = null; - finish(); - } + onCancel(dialog); return; } @@ -809,7 +814,7 @@ public class SecuritySettings extends PreferenceActivity implements .setTitle(R.string.cstor_access_dialog_title) .setPositiveButton(android.R.string.ok, this) .setNegativeButton(android.R.string.cancel, this) - .setCancelable(false) + .setOnCancelListener(this) .create(); d.setOnDismissListener(this); return d; @@ -849,7 +854,7 @@ public class SecuritySettings extends PreferenceActivity implements .setTitle(R.string.cstor_set_passwd_dialog_title) .setPositiveButton(android.R.string.ok, this) .setNegativeButton(android.R.string.cancel, this) - .setCancelable(false) + .setOnCancelListener(this) .create(); d.setOnDismissListener(this); return d; @@ -884,7 +889,7 @@ public class SecuritySettings extends PreferenceActivity implements .setTitle(R.string.cstor_name_credential_dialog_title) .setPositiveButton(android.R.string.ok, this) .setNegativeButton(android.R.string.cancel, this) - .setCancelable(false) + .setOnCancelListener(this) .create(); d.setOnDismissListener(this); return d; |