diff --git a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java index 2ec24d32d..d9e6d27ae 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -323,6 +323,16 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener long id) { updateViewFromAuthType(); validateFields(); + AuthType selection = (AuthType) mAuthTypeView.getSelectedItem(); + + // Have the user select (or confirm) the client certificate + if (AuthType.EXTERNAL.equals(selection)) { + + // This may again invoke validateFields() + mClientCertificateSpinner.chooseCertificate(); + } else { + mPasswordView.requestFocus(); + } } @Override diff --git a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index a913ef1b1..02f02e8f3 100644 --- a/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/src/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -223,6 +223,16 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, long id) { updateViewFromAuthType(); validateFields(); + AuthType selection = (AuthType) mAuthTypeView.getSelectedItem(); + + // Have the user select (or confirm) the client certificate + if (AuthType.EXTERNAL.equals(selection)) { + + // This may again invoke validateFields() + mClientCertificateSpinner.chooseCertificate(); + } else { + mPasswordView.requestFocus(); + } } @Override diff --git a/src/com/fsck/k9/view/ClientCertificateSpinner.java b/src/com/fsck/k9/view/ClientCertificateSpinner.java index c7bb0f10b..34af03baf 100644 --- a/src/com/fsck/k9/view/ClientCertificateSpinner.java +++ b/src/com/fsck/k9/view/ClientCertificateSpinner.java @@ -51,7 +51,7 @@ public class ClientCertificateSpinner extends LinearLayout { mSelection.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - onSelect(); + chooseCertificate(); } }); @@ -96,7 +96,7 @@ public class ClientCertificateSpinner extends LinearLayout { setAlias(null); } - private void onSelect() { + public void chooseCertificate() { // NOTE: keyTypes, issuers, hosts, port are not known before we actually // open a connection, thus we cannot set them here! KeyChain.choosePrivateKeyAlias(mActivity, new KeyChainAliasCallback() {