diff options
author | 2016-01-14 22:21:37 +0000 | |
---|---|---|
committer | 2016-01-14 22:21:37 +0000 | |
commit | 33b55366c5138237e3da268a05f08b064426becc (patch) | |
tree | a14ee4dc5d5f43ad94ed39f36276f819367bcb1c | |
parent | ca6b87fea6b16e38f8bbbd514d3cf07361a5feba (diff) | |
parent | 33001945a82ba8cd5b5ad27b808312aa2ef210af (diff) |
Merge "DO NOT MERGE Fix for syncs being dropped when appIdle is on" into mnc-dr1.5-dev
am: 33001945a8
* commit '33001945a82ba8cd5b5ad27b808312aa2ef210af':
DO NOT MERGE Fix for syncs being dropped when appIdle is on
-rw-r--r-- | services/core/java/com/android/server/content/SyncManager.java | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/content/SyncManager.java b/services/core/java/com/android/server/content/SyncManager.java index 3ec0bee85f67..ef086daa23bc 100644 --- a/services/core/java/com/android/server/content/SyncManager.java +++ b/services/core/java/com/android/server/content/SyncManager.java @@ -2604,32 +2604,17 @@ public class SyncManager { } continue; } - if (!isOperationValidLocked(op)) { - operationIterator.remove(); - mSyncStorageEngine.deleteFromPending(op.pendingOperation); - continue; - } - // If the next run time is in the future, even given the flexible scheduling, - // return the time. - if (op.effectiveRunTime - op.flexTime > now) { - if (nextReadyToRunTime > op.effectiveRunTime) { - nextReadyToRunTime = op.effectiveRunTime; - } - if (isLoggable) { - Log.v(TAG, " Not running sync operation: Sync too far in future." - + "effective: " + op.effectiveRunTime + " flex: " + op.flexTime - + " now: " + now); - } - continue; - } String packageName = getPackageName(op.target); ApplicationInfo ai = null; if (packageName != null) { try { ai = mContext.getPackageManager().getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES - | PackageManager.GET_DISABLED_COMPONENTS); + | PackageManager.GET_DISABLED_COMPONENTS); } catch (NameNotFoundException e) { + operationIterator.remove(); + mSyncStorageEngine.deleteFromPending(op.pendingOperation); + continue; } } // If app is considered idle, then skip for now and backoff @@ -2644,6 +2629,24 @@ public class SyncManager { } else { op.appIdle = false; } + if (!isOperationValidLocked(op)) { + operationIterator.remove(); + mSyncStorageEngine.deleteFromPending(op.pendingOperation); + continue; + } + // If the next run time is in the future, even given the flexible scheduling, + // return the time. + if (op.effectiveRunTime - op.flexTime > now) { + if (nextReadyToRunTime > op.effectiveRunTime) { + nextReadyToRunTime = op.effectiveRunTime; + } + if (isLoggable) { + Log.v(TAG, " Not running sync operation: Sync too far in future." + + "effective: " + op.effectiveRunTime + " flex: " + op.flexTime + + " now: " + now); + } + continue; + } // Add this sync to be run. operations.add(op); } |