From c28347552e543b2fc04c922336ddca75221a1eef Mon Sep 17 00:00:00 2001 From: Yu Ping Hu Date: Thu, 23 May 2013 15:09:44 -0700 Subject: [PATCH] Handle redirection during validation. This allows the validator to tell the app that it should use a different host. Change-Id: Ie42c32aa7aea83e4d95d2b82b88225036b2407a9 --- .../com/android/emailcommon/service/EmailServiceProxy.java | 1 + .../email/activity/setup/AccountCheckSettingsFragment.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java index 81dd337f8..32e5dcfe2 100644 --- a/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java +++ b/emailcommon/src/com/android/emailcommon/service/EmailServiceProxy.java @@ -60,6 +60,7 @@ public class EmailServiceProxy extends ServiceProxy implements IEmailService { public static final String VALIDATE_BUNDLE_UNSUPPORTED_POLICIES = "validate_unsupported_policies"; public static final String VALIDATE_BUNDLE_PROTOCOL_VERSION = "validate_protocol_version"; + public static final String VALIDATE_BUNDLE_REDIRECT_ADDRESS = "validate_redirect_address"; private final IEmailServiceCallback mCallback; private Object mReturn = null; diff --git a/src/com/android/email/activity/setup/AccountCheckSettingsFragment.java b/src/com/android/email/activity/setup/AccountCheckSettingsFragment.java index 368442c9c..c15406a40 100644 --- a/src/com/android/email/activity/setup/AccountCheckSettingsFragment.java +++ b/src/com/android/email/activity/setup/AccountCheckSettingsFragment.java @@ -477,6 +477,11 @@ public class AccountCheckSettingsFragment extends Fragment { EmailServiceProxy.VALIDATE_BUNDLE_PROTOCOL_VERSION); resultCode = bundle.getInt( EmailServiceProxy.VALIDATE_BUNDLE_RESULT_CODE); + final String redirectAddress = bundle.getString( + EmailServiceProxy.VALIDATE_BUNDLE_REDIRECT_ADDRESS, null); + if (redirectAddress != null) { + mAccount.mHostAuthRecv.mAddress = redirectAddress; + } // Only show "policies required" if this is a new account setup if (resultCode == MessagingException.SECURITY_POLICIES_REQUIRED && mAccount.isSaved()) {