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
This commit is contained in:
parent
8549068cb5
commit
7b03c7936a
@ -143,6 +143,9 @@ public class MailService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
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);
|
super.onStartCommand(intent, flags, startId);
|
||||||
|
|
||||||
// TODO this needs to be passed through the controller and back to us
|
// TODO this needs to be passed through the controller and back to us
|
||||||
@ -339,8 +342,8 @@ public class MailService extends Service {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return displayName + ": prevSync=" + prevSyncTime + " nextSync=" + nextSyncTime
|
return displayName + ": id=" + accountId + " prevSync=" + prevSyncTime
|
||||||
+ " numNew=" + numNewMessages;
|
+ " 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)
|
* of a single account (e.g if it was created after the original list population)
|
||||||
*/
|
*/
|
||||||
/* package */ void setupSyncReports(long accountId) {
|
/* package */ void setupSyncReports(long accountId) {
|
||||||
|
if (Config.LOGD && Email.DEBUG) {
|
||||||
|
Log.d(LOG_TAG, "setupSyncReports: id=" + accountId);
|
||||||
|
}
|
||||||
synchronized (mSyncReports) {
|
synchronized (mSyncReports) {
|
||||||
if (accountId == -1) {
|
if (accountId == -1) {
|
||||||
// -1 == reload the list if empty, otherwise exit immediately
|
// -1 == reload the list if empty, otherwise exit immediately
|
||||||
@ -403,6 +409,10 @@ public class MailService extends Service {
|
|||||||
|
|
||||||
// TODO lookup # new in inbox
|
// TODO lookup # new in inbox
|
||||||
mSyncReports.put(report.accountId, report);
|
mSyncReports.put(report.accountId, report);
|
||||||
|
|
||||||
|
if (Config.LOGD && Email.DEBUG) {
|
||||||
|
Log.d(LOG_TAG, "setupSyncReports: new:" + report);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
c.close();
|
c.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user