am 06e140e4: Update messaging when autodiscover fails due to an auth error

* commit '06e140e4a42c11e60331229963d27548ea35551c':
  Update messaging when autodiscover fails due to an auth error
This commit is contained in:
Tony Mantler 2013-11-05 17:20:37 -08:00 committed by Android Git Automerger
commit ec1fb96505
2 changed files with 18 additions and 4 deletions

View File

@ -390,6 +390,15 @@
<!-- "Setup could not finish" dialog text; e.g., Username or password incorrect\n(ERR01 Account does not exist) --> <!-- "Setup could not finish" dialog text; e.g., Username or password incorrect\n(ERR01 Account does not exist) -->
<string name="account_setup_failed_dlg_auth_message_fmt">Login failed.\n(<xliff:g id="error">%s</xliff:g>)</string> <string name="account_setup_failed_dlg_auth_message_fmt">Login failed.\n(<xliff:g id="error">%s</xliff:g>)</string>
<!-- Account setup autodiscover auth failure dialog title. This is shown when autodiscover hits
an "access denied" server error, which could imply incorrect username/password or that no
autodiscover service has been configured for the domain [CHAR LIMIT=40] -->
<string name="account_setup_autodiscover_dlg_authfail_title">Problem with account setup</string>
<!-- Account setup autodiscover auth failure dialog message. This is shown when autodiscover hits
an "access denied" server error, which could imply incorrect username/password or that no
autodiscover service has been configured for the domain [CHAR LIMIT=NONE] -->
<string name="account_setup_autodiscover_dlg_authfail_message">Confirm username, password, and account settings are correct.</string>
<!-- An error message presented to the user when the server's identity <!-- An error message presented to the user when the server's identity
cannot be established or trusted [CHAR LIMIT=NONE] --> cannot be established or trusted [CHAR LIMIT=NONE] -->
<string name="account_setup_failed_dlg_certificate_message" <string name="account_setup_failed_dlg_certificate_message"

View File

@ -581,7 +581,7 @@ public class AccountCheckSettingsFragment extends Fragment {
} }
private static String getErrorString(Context context, MessagingException ex) { private static String getErrorString(Context context, MessagingException ex) {
int id; final int id;
String message = ex.getMessage(); String message = ex.getMessage();
if (message != null) { if (message != null) {
message = message.trim(); message = message.trim();
@ -595,8 +595,10 @@ public class AccountCheckSettingsFragment extends Fragment {
: R.string.account_setup_failed_dlg_certificate_message_fmt; : R.string.account_setup_failed_dlg_certificate_message_fmt;
break; break;
case MessagingException.AUTHENTICATION_FAILED: case MessagingException.AUTHENTICATION_FAILED:
id = R.string.account_setup_failed_dlg_auth_message;
break;
case MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED: case MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED:
id = R.string.account_settings_login_dialog_title; id = R.string.account_setup_autodiscover_dlg_authfail_message;
break; break;
case MessagingException.AUTHENTICATION_FAILED_OR_SERVER_ERROR: case MessagingException.AUTHENTICATION_FAILED_OR_SERVER_ERROR:
id = R.string.account_setup_failed_check_credentials_message; id = R.string.account_setup_failed_check_credentials_message;
@ -811,8 +813,11 @@ public class AccountCheckSettingsFragment extends Fragment {
.setMessage(message) .setMessage(message)
.setCancelable(true); .setCancelable(true);
// Hide title when we get MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED // Use a different title when we get
if (exceptionId != MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED) { // MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED
if (exceptionId == MessagingException.AUTODISCOVER_AUTHENTICATION_FAILED) {
builder.setTitle(R.string.account_setup_autodiscover_dlg_authfail_title);
} else {
builder.setIconAttribute(android.R.attr.alertDialogIcon) builder.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(context.getString(R.string.account_setup_failed_dlg_title)); .setTitle(context.getString(R.string.account_setup_failed_dlg_title));
} }