Improve debug logging.

Change-Id: I13a99d5caadcc7bd2682791527f71a697d07f8d0
This commit is contained in:
Danny Baumann 2015-06-17 08:48:53 +02:00 committed by Steve Kondik
parent fff063d6d9
commit 9e42c23d4c
2 changed files with 10 additions and 5 deletions

View File

@ -1820,6 +1820,8 @@ public class EmailProvider extends ContentProvider
extras.putBoolean(ContentResolver.SYNC_EXTRAS_DO_NOT_RETRY, true);
extras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
ContentResolver.requestSync(amAccount, EmailContent.AUTHORITY, extras);
LogUtils.i(TAG, "requestSync EmailProvider restoreAccounts %s, %s",
account.toString(), extras.toString());
restoredCount++;
}
}
@ -5978,7 +5980,7 @@ public class EmailProvider extends ContentProvider
extras.putString(EmailServiceStatus.SYNC_EXTRAS_CALLBACK_METHOD,
SYNC_STATUS_CALLBACK_METHOD);
ContentResolver.requestSync(account, EmailContent.AUTHORITY, extras);
LogUtils.i(TAG, "requestSync EmailProvider startSync %s, %s", account.toString(),
LogUtils.i(TAG, "requestSync EmailProvider restartPush %s, %s", account.toString(),
extras.toString());
}

View File

@ -271,6 +271,9 @@ public class ImapService extends Service {
// Request a quick sync to make sure we didn't lose any new mails
// during the failure time
ImapService.requestSync(mContext, account, mMailbox.mId, false);
LogUtils.d(LOG_TAG, "requestSync after reschedulePing for account %s (%s)",
account.toString(), mMailbox.mDisplayName);
} catch (MessagingException ex) {
LogUtils.w(LOG_TAG, ex, "Failed to register mailbox for idle. Reschedule.");
reschedulePing(increasePingDelay());
@ -545,6 +548,8 @@ public class ImapService extends Service {
// Request a "recents" sync
ImapService.requestSync(mContext,
account, Mailbox.NO_MAILBOX, false);
LogUtils.d(LOG_TAG, "requestSync after restarting IDLE "
+ "for account %s", account.toString());
}
} finally {
c.close();
@ -807,6 +812,8 @@ public class ImapService extends Service {
}
mBinder.init(context);
mBinder.requestSync(inboxId,true,0);
LogUtils.d(LOG_TAG, "requestSync on user request for account %d (%d)",
accountId, inboxId);
} else if (ACTION_DELETE_MESSAGE.equals(action)) {
final long messageId = intent.getLongExtra(EXTRA_MESSAGE_ID, -1);
if (Logging.LOGD) {
@ -1009,10 +1016,6 @@ public class ImapService extends Service {
}
private static void requestSync(Context context, Account account, long mailbox, boolean full) {
if (Logging.LOGD) {
LogUtils.d(LOG_TAG, "Request sync due to idle response for mailbox " + mailbox);
}
final EmailServiceUtils.EmailServiceInfo info = EmailServiceUtils.getServiceInfoForAccount(
context, account.mId);
final android.accounts.Account acct = new android.accounts.Account(