mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-31 07:10:14 -05:00
Avoid setting conflict warning when SMTP login not required
This commit is contained in:
parent
65144e3759
commit
fe033e014f
@ -210,6 +210,30 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener,
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position,
|
||||
long id) {
|
||||
updatePortFromSecurityType();
|
||||
|
||||
boolean isInsecure = ConnectionSecurity.NONE.equals(mSecurityTypeView.getSelectedItem());
|
||||
boolean isAuthExternal = AuthType.EXTERNAL.equals(mAuthTypeView.getSelectedItem());
|
||||
boolean loginNotRequired = !mRequireLoginView.isChecked();
|
||||
|
||||
/*
|
||||
* If the user selects ConnectionSecurity.NONE, a
|
||||
* warning would normally pop up if the authentication
|
||||
* is AuthType.EXTERNAL (i.e., using client
|
||||
* certificates). But such a warning is irrelevant if
|
||||
* login is not required. So to avoid such a warning
|
||||
* (generated in validateFields()) under those
|
||||
* conditions, we change the (irrelevant) authentication
|
||||
* method to PLAIN.
|
||||
*/
|
||||
if (isInsecure && isAuthExternal && loginNotRequired) {
|
||||
OnItemSelectedListener onItemSelectedListener = mAuthTypeView.getOnItemSelectedListener();
|
||||
mAuthTypeView.setOnItemSelectedListener(null);
|
||||
mCurrentAuthTypeViewPosition = mAuthTypeAdapter.getPosition(AuthType.PLAIN);
|
||||
mAuthTypeView.setSelection(mCurrentAuthTypeViewPosition, false);
|
||||
mAuthTypeView.setOnItemSelectedListener(onItemSelectedListener);
|
||||
updateViewFromAuthType();
|
||||
}
|
||||
|
||||
validateFields();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user