mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Trigger certificate chooser on authentication change
If the user chooses client certificate authentication, immediately pop up the certificate chooser. If the user chooses password authentication, move the focus to the password View.
This commit is contained in:
parent
21cc3d9176
commit
231f3645f9
@ -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
|
||||
|
@ -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
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user