Merge "Fix deadlock caused by clearAllBackoffs in SSE" into lmp-dev
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java
index 9292d45..adc96f7 100644
--- a/services/core/java/com/android/server/content/SyncManager.java
+++ b/services/core/java/com/android/server/content/SyncManager.java
@@ -311,7 +311,9 @@
if (Log.isLoggable(TAG, Log.VERBOSE)) {
Log.v(TAG, "Reconnection detected: clearing all backoffs");
}
- mSyncStorageEngine.clearAllBackoffs(mSyncQueue);
+ synchronized (mSyncQueue) {
+ mSyncStorageEngine.clearAllBackoffsLocked(mSyncQueue);
+ }
}
sendCheckAlarmsMessage();
}
diff --git a/services/core/java/com/android/server/content/SyncStorageEngine.java b/services/core/java/com/android/server/content/SyncStorageEngine.java
index 9499370..0d5f240 100644
--- a/services/core/java/com/android/server/content/SyncStorageEngine.java
+++ b/services/core/java/com/android/server/content/SyncStorageEngine.java
@@ -834,17 +834,16 @@
return changed;
}
- public void clearAllBackoffs(SyncQueue syncQueue) {
+ public void clearAllBackoffsLocked(SyncQueue syncQueue) {
boolean changed = false;
synchronized (mAuthorities) {
- synchronized (syncQueue) {
// Clear backoff for all sync adapters.
for (AccountInfo accountInfo : mAccounts.values()) {
for (AuthorityInfo authorityInfo : accountInfo.authorities.values()) {
if (authorityInfo.backoffTime != NOT_IN_BACKOFF_MODE
|| authorityInfo.backoffDelay != NOT_IN_BACKOFF_MODE) {
if (Log.isLoggable(TAG, Log.VERBOSE)) {
- Log.v(TAG, "clearAllBackoffs:"
+ Log.v(TAG, "clearAllBackoffsLocked:"
+ " authority:" + authorityInfo.target
+ " account:" + accountInfo.accountAndUser.account.name
+ " user:" + accountInfo.accountAndUser.userId
@@ -868,7 +867,6 @@
authorityInfo.backoffDelay = NOT_IN_BACKOFF_MODE;
}
}
- }
syncQueue.clearBackoffs();
}
}