Prevent simultaneous imap and pop syncs
b/10527550 I'm not yet sure why we're getting this started in multiple threads, but the methods where the sync occurs are now synchronized so they can't happen at the same time. Change-Id: Icf7afd336ed056bb42df84b8634117afa8f31213
This commit is contained in:
parent
2ad2f0d145
commit
466eb2dcd2
|
@ -172,7 +172,7 @@ public class ImapService extends Service {
|
|||
nc.cancelLoginFailedNotification(account.mId);
|
||||
} catch (MessagingException e) {
|
||||
if (Logging.LOGD) {
|
||||
LogUtils.v(Logging.LOG_TAG, "synchronizeMailboxSynchronous", e);
|
||||
LogUtils.d(Logging.LOG_TAG, "synchronizeMailboxSynchronous", e);
|
||||
}
|
||||
if (e instanceof AuthenticationFailedException) {
|
||||
// Generate authentication notification
|
||||
|
@ -342,11 +342,11 @@ public class ImapService extends Service {
|
|||
* @return results of the sync pass
|
||||
* @throws MessagingException
|
||||
*/
|
||||
private static void synchronizeMailboxGeneric(final Context context, final Account account,
|
||||
private synchronized static void synchronizeMailboxGeneric(final Context context, final Account account,
|
||||
final Mailbox mailbox, final boolean loadMore, final boolean uiRefresh)
|
||||
throws MessagingException {
|
||||
|
||||
LogUtils.v(Logging.LOG_TAG, "synchronizeMailboxGeneric " + account + " " + mailbox + " "
|
||||
LogUtils.d(Logging.LOG_TAG, "synchronizeMailboxGeneric " + account + " " + mailbox + " "
|
||||
+ loadMore + " " + uiRefresh);
|
||||
|
||||
final ArrayList<Long> unseenMessages = new ArrayList<Long>();
|
||||
|
|
|
@ -233,7 +233,7 @@ public class Pop3Service extends Service {
|
|||
* @param deltaMessageCount the requested change to number of messages to sync
|
||||
* @throws MessagingException
|
||||
*/
|
||||
private static void synchronizePop3Mailbox(final Context context, final Account account,
|
||||
private synchronized static void synchronizePop3Mailbox(final Context context, final Account account,
|
||||
final Mailbox mailbox, final int deltaMessageCount) throws MessagingException {
|
||||
// TODO Break this into smaller pieces
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
|
|
Loading…
Reference in New Issue