Tweak conditions for diverting back to the password screen
b/13451098 Change-Id: Id0422342aeac3647324afd8e41f6611069a27aad
This commit is contained in:
parent
351aa25ccb
commit
e31979ae2e
|
@ -499,9 +499,6 @@ public class AccountSetupFinal extends AccountSetupActivity
|
|||
*/
|
||||
private void resetStateFromCurrentFragment() {
|
||||
AccountSetupFragment f = getContentFragment();
|
||||
if (mState == STATE_CREDENTIALS) {
|
||||
mPasswordFailed = false;
|
||||
}
|
||||
mState = f.getState();
|
||||
updateHeadline();
|
||||
}
|
||||
|
@ -559,6 +556,7 @@ public class AccountSetupFinal extends AccountSetupActivity
|
|||
break;
|
||||
case STATE_CHECKING_PRECONFIGURED:
|
||||
if (mPreConfiguredFailed) {
|
||||
if (mPasswordFailed) {
|
||||
// Get rid of the previous instance of the AccountSetupCredentialsFragment.
|
||||
FragmentManager fm = getFragmentManager();
|
||||
fm.popBackStackImmediate(CREDENTIALS_BACKSTACK_TAG, 0);
|
||||
|
@ -566,6 +564,11 @@ public class AccountSetupFinal extends AccountSetupActivity
|
|||
getContentFragment();
|
||||
f.setPasswordFailed(mPasswordFailed);
|
||||
resetStateFromCurrentFragment();
|
||||
} else {
|
||||
mState = STATE_MANUAL_INCOMING;
|
||||
updateHeadline();
|
||||
updateContentFragment(true /* addToBackstack */);
|
||||
}
|
||||
} else {
|
||||
mState = STATE_OPTIONS;
|
||||
updateHeadline();
|
||||
|
@ -704,6 +707,10 @@ public class AccountSetupFinal extends AccountSetupActivity
|
|||
private void onBasicsComplete() {
|
||||
final AccountSetupBasicsFragment f = (AccountSetupBasicsFragment) getContentFragment();
|
||||
final String email = f.getEmail();
|
||||
if (!TextUtils.equals(email, mSetupData.getEmail())) {
|
||||
// If the user changes their email address, clear the password failed state
|
||||
mPasswordFailed = false;
|
||||
}
|
||||
mSetupData.setEmail(email);
|
||||
}
|
||||
|
||||
|
@ -915,7 +922,11 @@ public class AccountSetupFinal extends AccountSetupActivity
|
|||
|
||||
@Override
|
||||
public void onCheckSettingsError(int reason, String message) {
|
||||
if (reason == CheckSettingsErrorDialogFragment.REASON_AUTHENTICATION_FAILED ||
|
||||
reason == CheckSettingsErrorDialogFragment.REASON_CERTIFICATE_REQUIRED) {
|
||||
// TODO: possibly split password and cert error conditions
|
||||
mPasswordFailed = true;
|
||||
}
|
||||
dismissCheckSettingsFragment();
|
||||
final DialogFragment f =
|
||||
CheckSettingsErrorDialogFragment.newInstance(reason, message);
|
||||
|
|
|
@ -129,6 +129,7 @@ public class CheckSettingsErrorDialogFragment extends DialogFragment{
|
|||
final int exceptionCode = ex.getExceptionType();
|
||||
switch (exceptionCode) {
|
||||
case MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED:
|
||||
case MessagingException.AUTHENTICATION_FAILED:
|
||||
return REASON_AUTHENTICATION_FAILED;
|
||||
case MessagingException.CLIENT_CERTIFICATE_REQUIRED:
|
||||
return REASON_CERTIFICATE_REQUIRED;
|
||||
|
|
Loading…
Reference in New Issue