From 7b03c7936a2fd238f366fe145619308e5b31a8ec Mon Sep 17 00:00:00 2001 From: Andrew Stadler Date: Fri, 4 Sep 2009 23:13:32 -0700 Subject: [PATCH] A bit more debugging to catch the service race condition. NOTE: This switches on Email.DEBUG for everyone, and should be removed. Change-Id: I700099a9aa5e5c64d8c282cb8d07a47c7c408862 --- src/com/android/email/service/MailService.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/service/MailService.java b/src/com/android/email/service/MailService.java index c26ca96c7..52a262642 100644 --- a/src/com/android/email/service/MailService.java +++ b/src/com/android/email/service/MailService.java @@ -143,6 +143,9 @@ public class MailService extends Service { @Override public int onStartCommand(Intent intent, int flags, int startId) { + // Force Email debugging until we catch this in the act, fix the bug, and REMOVE THIS + Email.DEBUG = true; + super.onStartCommand(intent, flags, startId); // TODO this needs to be passed through the controller and back to us @@ -339,8 +342,8 @@ public class MailService extends Service { @Override public String toString() { - return displayName + ": prevSync=" + prevSyncTime + " nextSync=" + nextSyncTime - + " numNew=" + numNewMessages; + return displayName + ": id=" + accountId + " prevSync=" + prevSyncTime + + " nextSync=" + nextSyncTime + " numNew=" + numNewMessages; } } @@ -352,6 +355,9 @@ public class MailService extends Service { * of a single account (e.g if it was created after the original list population) */ /* package */ void setupSyncReports(long accountId) { + if (Config.LOGD && Email.DEBUG) { + Log.d(LOG_TAG, "setupSyncReports: id=" + accountId); + } synchronized (mSyncReports) { if (accountId == -1) { // -1 == reload the list if empty, otherwise exit immediately @@ -403,6 +409,10 @@ public class MailService extends Service { // TODO lookup # new in inbox mSyncReports.put(report.accountId, report); + + if (Config.LOGD && Email.DEBUG) { + Log.d(LOG_TAG, "setupSyncReports: new:" + report); + } } } finally { c.close();