diff --git a/src/com/android/email/activity/ActivityHelper.java b/src/com/android/email/activity/ActivityHelper.java index 05af85e88..73ae5b062 100644 --- a/src/com/android/email/activity/ActivityHelper.java +++ b/src/com/android/email/activity/ActivityHelper.java @@ -19,6 +19,7 @@ package com.android.email.activity; import com.android.email.Controller; import com.android.email.Email; import com.android.email.R; +import com.android.email.activity.setup.AccountSecurity; import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.Mailbox; import com.android.emailcommon.utility.EmailAsyncTask; @@ -135,4 +136,10 @@ public final class ActivityHelper { } */ } + + public static void showSecurityHoldDialog(Activity callerActivity, long accountId) { + callerActivity.startActivity( + AccountSecurity.actionUpdateSecurityIntent(callerActivity, accountId, true)); + } + } diff --git a/src/com/android/email/activity/UIControllerBase.java b/src/com/android/email/activity/UIControllerBase.java index deb12d01a..8aa0b142c 100644 --- a/src/com/android/email/activity/UIControllerBase.java +++ b/src/com/android/email/activity/UIControllerBase.java @@ -16,16 +16,6 @@ package com.android.email.activity; -import android.app.Activity; -import android.app.Fragment; -import android.app.FragmentManager; -import android.app.FragmentTransaction; -import android.os.Bundle; -import android.util.Log; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; - import com.android.email.Email; import com.android.email.MessageListContext; import com.android.email.R; @@ -38,6 +28,16 @@ import com.android.emailcommon.provider.HostAuth; import com.android.emailcommon.provider.Mailbox; import com.android.emailcommon.utility.EmailAsyncTask; +import android.app.Activity; +import android.app.Fragment; +import android.app.FragmentManager; +import android.app.FragmentTransaction; +import android.os.Bundle; +import android.util.Log; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; + import java.util.LinkedList; import java.util.List; @@ -425,7 +425,11 @@ abstract class UIControllerBase implements MailboxListFragment.Callback, */ public final void switchAccount(long accountId) { - // STOPSHIP Do the security hold check here too. + if (Account.isSecurityHold(mActivity, accountId)) { + ActivityHelper.showSecurityHoldDialog(mActivity, accountId); + mActivity.finish(); + return; + } if (accountId == getUIAccountId()) { // Do nothing if the account is already selected. Not even going back to the inbox. diff --git a/src/com/android/email/activity/Welcome.java b/src/com/android/email/activity/Welcome.java index 33d190096..76ca54b80 100644 --- a/src/com/android/email/activity/Welcome.java +++ b/src/com/android/email/activity/Welcome.java @@ -19,7 +19,6 @@ package com.android.email.activity; import com.android.email.Email; import com.android.email.ExchangeUtils; import com.android.email.R; -import com.android.email.activity.setup.AccountSecurity; import com.android.email.activity.setup.AccountSetupBasics; import com.android.email.service.MailService; import com.android.emailcommon.Logging; @@ -407,8 +406,7 @@ public class Welcome extends Activity { public void onAccountSecurityHold(long accountId) { cleanUp(); - startActivity( - AccountSecurity.actionUpdateSecurityIntent(Welcome.this, accountId, true)); + ActivityHelper.showSecurityHoldDialog(Welcome.this, accountId); finish(); }