From 54607e872db12c0132446f21a4b8a5c724d185ee Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Thu, 15 Apr 2010 14:53:56 -0700 Subject: [PATCH] Remove incorrect error reporting in MessageList * Previously I added a call to updateBanner() during the sequence where we update the mailboxlist (searching for the requested mailbox to display.) This was an attempt to provide some error information for certain corner case security configuration problems. * This was misfiring during legitimate connections (specifically, initial sync of valid EAS accounts) and causing a Connection Error message when none was intended. * Rather than continue hacking, I'm simply removing the error banner from updateMailboxList. * This is essentially a direct rollback of change c98b64c801cea3c82a7b932ebaf9a4bbdcee195c, although I've added a bit more commentary than there was originally. * The long-term solution, rather than continue band-aiding this, is to move most of this logic into a service independent of the UI, and provide more organized error reporting. Bug: 2585159 Bug: 2599377 Change-Id: I99b7b1c8a7cfaa3fd3ff9b578d5721f05133d88a --- .../android/email/activity/MessageList.java | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/com/android/email/activity/MessageList.java b/src/com/android/email/activity/MessageList.java index e9b4c6774..2ece07bf3 100644 --- a/src/com/android/email/activity/MessageList.java +++ b/src/com/android/email/activity/MessageList.java @@ -1103,7 +1103,6 @@ public class MessageList extends ListActivity implements OnItemClickListener, On if (accountExists && mOkToRecurse) { // launch network lookup mControllerCallback.mWaitForMailboxType = mMailboxType; - mControllerCallback.mWaitForMailboxAccountId = mAccountId; mController.updateMailboxList(mAccountId, mControllerCallback); } else { // We don't want to do the network lookup, or the account doesn't exist in the @@ -1437,24 +1436,16 @@ public class MessageList extends ListActivity implements OnItemClickListener, On // This is used to alter the connection banner operation for sending messages MessagingException mSendMessageException; - // These are preset for use by updateMailboxListCallback + // This is preset for use by updateMailboxListCallback int mWaitForMailboxType = -1; - long mWaitForMailboxAccountId = -1; // TODO check accountKey and only react to relevant notifications public void updateMailboxListCallback(MessagingException result, long accountKey, int progress) { - // Special case to show a banner here if we can't refresh the account - if (accountKey == mWaitForMailboxAccountId) { - // Display error - if (result != null) { - updateBanner(result, progress, mMailboxId); - } - // Reset the account watcher so we don't respond again - if (result != null || progress == 100) { - mWaitForMailboxAccountId = -1; - } - } + // updateMailboxList is never the end goal in MessageList, so we don't show + // these errors. There are a couple of corner cases that we miss reporting, but + // this is better than reporting a number of non-problem intermediate states. + // updateBanner(result, progress, mMailboxId); updateProgress(result, progress); if (progress == 100) {