From cab0021179c4d3b03d756c4dd6bacfc4e9ac75af Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Wed, 11 Aug 2010 15:45:13 -0700 Subject: [PATCH] Improve logging in MailboxFinder. There's something weird going on when you add an Exchange account and we try to look up the inbox. Add log for investigation. - Log class name - Log normal path (MAILBOX_FOUND) as well if debug is enabled. (Other paths are always logged. These paths shouldn't be used often, so I think it's okay.) Change-Id: Iff5a28a1240896f8e2b991b891cbc696e7901f06 --- src/com/android/email/activity/MailboxFinder.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/com/android/email/activity/MailboxFinder.java b/src/com/android/email/activity/MailboxFinder.java index 3841949c4..2483f2187 100644 --- a/src/com/android/email/activity/MailboxFinder.java +++ b/src/com/android/email/activity/MailboxFinder.java @@ -22,12 +22,9 @@ import com.android.email.Email; import com.android.email.Utility; import com.android.email.mail.MessagingException; import com.android.email.provider.EmailContent.Account; -import com.android.email.provider.EmailContent.AccountColumns; import com.android.email.provider.EmailContent.Mailbox; -import android.content.ContentUris; import android.content.Context; -import android.database.Cursor; import android.os.AsyncTask; import android.os.Handler; import android.util.Log; @@ -109,6 +106,7 @@ public class MailboxFinder { @Override public void updateMailboxListCallback(MessagingException result, long accountId, int progress) { + Log.i(Email.LOG_TAG, "MailboxFinder: updateMailboxListCallback"); if (result != null) { // Error while updating the mailbox list. Notify the UI... mCallback.onMailboxNotFound(mAccountId); @@ -182,23 +180,26 @@ public class MailboxFinder { } switch (mResult) { case RESULT_ACCOUNT_SECURITY_HOLD: - Log.w(Email.LOG_TAG, "Account security hold."); + Log.w(Email.LOG_TAG, "MailboxFinder: Account security hold."); mCallback.onAccountSecurityHold(mAccountId); return; case RESULT_ACCOUNT_NOT_FOUND: - Log.w(Email.LOG_TAG, "Account not found."); + Log.w(Email.LOG_TAG, "MailboxFinder: Account not found."); mCallback.onAccountNotFound(); return; case RESULT_MAILBOX_NOT_FOUND: - Log.w(Email.LOG_TAG, "Mailbox not found."); + Log.w(Email.LOG_TAG, "MailboxFinder: Mailbox not found."); mCallback.onMailboxNotFound(mAccountId); return; case RESULT_START_NETWORK_LOOK_UP: // Not found locally. Let's sync the mailbox list... - Log.i(Email.LOG_TAG, "Mailbox not found locally. Starting network lookup."); + Log.i(Email.LOG_TAG, "MailboxFinder: Starting network lookup."); mController.updateMailboxList(mAccountId); return; case RESULT_MAILBOX_FOUND: + if (Email.DEBUG_LIFECYCLE && Email.DEBUG) { + Log.d(Email.LOG_TAG, "MailboxFinder: mailbox found: id=" + mailboxId); + } mCallback.onMailboxFound(mAccountId, mailboxId); return; default: