From 0413edd6261f3879894840ff017c3c933ddb586d Mon Sep 17 00:00:00 2001 From: Ben Komalo Date: Tue, 19 Jul 2011 17:28:58 -0700 Subject: [PATCH] Remove STOPSHIP - ensure that the commitAllowingStateLoss is actually not dangerous - we only had one case I could see where we were actually doing a transaction from a loader callback and I fixed that just now to not do any transactions. Change-Id: I21e11138f70eb2ce953a5ba54119ca46555f465d --- res/values/strings.xml | 5 +++++ .../email/activity/UIControllerOnePane.java | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index c41e16ec9..442caabde 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -1053,6 +1053,11 @@ save attachment. [CHAR_LIMIT=none]--> Account not found. It may have been removed. + + Folder not found. It may have been removed. + Only some \"Plus\" accounts include POP access allowing this program to connect. If you are not able to sign in with diff --git a/src/com/android/email/activity/UIControllerOnePane.java b/src/com/android/email/activity/UIControllerOnePane.java index e4b52420f..da390c089 100644 --- a/src/com/android/email/activity/UIControllerOnePane.java +++ b/src/com/android/email/activity/UIControllerOnePane.java @@ -32,6 +32,7 @@ import com.android.emailcommon.Logging; import com.android.emailcommon.provider.Account; import com.android.emailcommon.provider.EmailContent.Message; import com.android.emailcommon.provider.Mailbox; +import com.android.emailcommon.utility.Utility; import java.util.Set; @@ -86,19 +87,23 @@ class UIControllerOnePane extends UIControllerBase { // MessageListFragment.Callback @Override public void onEnterSelectionMode(boolean enter) { - // TODO Auto-generated method stub + // Noop. } // MessageListFragment.Callback @Override public void onListLoaded() { - // TODO Auto-generated method stub + // Noop. } // MessageListFragment.Callback @Override public void onMailboxNotFound() { - switchAccount(getUIAccountId(), true); + // Something bad happened - the account or mailbox we were looking for was deleted. + // Just restart and let the entry flow find a good default view. + Utility.showToast(mActivity, R.string.toast_mailbox_not_found); + Welcome.actionStart(mActivity); + mActivity.finish(); } // MessageListFragment.Callback @@ -401,7 +406,12 @@ class UIControllerOnePane extends UIControllerBase { */ private void commitFragmentTransaction(FragmentTransaction ft) { if (!ft.isEmpty()) { - // STOPSHIP Don't use AllowingStateLoss. See b/4519430 + // NB: there should be no cases in which a transaction is committed after + // onSaveInstanceState. Unfortunately, the "state loss" check also happens when in + // LoaderCallbacks.onLoadFinished, and we wish to perform transactions there. The check + // by the framework is conservative and prevents cases where there are transactions + // affecting Loader lifecycles - but we have no such cases. + // TODO: use asynchronous callbacks from loaders to avoid this implicit dependency ft.commitAllowingStateLoss(); mFragmentManager.executePendingTransactions(); }