Fix dialog handling.

* Changes
  + VpnSettings:
    + Add reconnect dialog to showDialog() framework for handling screen
      rotation.
    + Dismiss other alert dialogs in onDestroy()
    + Remove onPrepareDialog() from VpnSettings.
    + Remove updateConnectDialog() from VpnProfileActor.
    + Add authentication error dialog.
    + Add unknown server dialog.
  + SecuritySettings:
    + Make cstor dialogs cancelable.
    + Add cancelable listener.
  Patch Set 6:
  + VpnSettings:
    + Disable preferences when connecting/disconnecting.
    + Fix state broadcast when binding a VpnService goes wrong.
This commit is contained in:
Hung-ying Tyan
2009-07-11 22:28:00 +08:00
parent a5cead2cf7
commit 1ddccd07f7
5 changed files with 166 additions and 111 deletions

View File

@@ -442,8 +442,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;
@@ -523,14 +524,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;
}
@@ -797,7 +802,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;
@@ -837,7 +842,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;
@@ -872,7 +877,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;