From f29221efc921b91ffbe89a790277d4ef56389749 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 17 Jul 2011 12:23:49 -0700 Subject: [PATCH] Remove unnecessary EmailAsyncTask Change-Id: Ifb13f2f57016191f7ef409aa656bf9cb840f42c9 --- .../android/email/activity/EmailActivity.java | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/com/android/email/activity/EmailActivity.java b/src/com/android/email/activity/EmailActivity.java index 7994bbbab..aee5162ea 100644 --- a/src/com/android/email/activity/EmailActivity.java +++ b/src/com/android/email/activity/EmailActivity.java @@ -386,30 +386,19 @@ public class EmailActivity extends Activity implements View.OnClickListener, Fra } } } else { - // Connection error; show the error message banner - new EmailAsyncTask(mTaskTracker) { - @Override - protected String doInBackground(Void... params) { - Account account = - Account.restoreAccountWithId(EmailActivity.this, accountId); - return (account == null) ? null : account.mDisplayName; - } - - @Override - protected void onSuccess(String accountName) { - String message = - MessagingExceptionStrings.getErrorString(EmailActivity.this, result); - if (!TextUtils.isEmpty(accountName)) { - // TODO Use properly designed layout. Don't just concatenate strings; - // which is generally poor for I18N. - message = message + " (" + accountName + ")"; - } - if (mErrorBanner.show(message)) { - mLastErrorAccountId = accountId; - } - } - }.executeParallel(); - } + Account account = Account.restoreAccountWithId(EmailActivity.this, accountId); + if (account == null) return; + String message = + MessagingExceptionStrings.getErrorString(EmailActivity.this, result); + if (!TextUtils.isEmpty(account.mDisplayName)) { + // TODO Use properly designed layout. Don't just concatenate strings; + // which is generally poor for I18N. + message = message + " (" + account.mDisplayName + ")"; + } + if (mErrorBanner.show(message)) { + mLastErrorAccountId = accountId; + } + } } } }