OSDN Git Service

Do not allow 0 or smaller periodicity for syncs.
authorAshish Sharma <ashishsharma@google.com>
Mon, 10 Jun 2013 18:25:51 +0000 (11:25 -0700)
committerThe Android Automerger <android-build@android.com>
Mon, 10 Jun 2013 22:18:49 +0000 (15:18 -0700)
b/9295383

Change-Id: I5f758f4a033d74e42a04b214a6b70b94d394280d
(cherry picked from commit 4970974d74a2986a333e645a5c141ef5f9a753cc)

services/java/com/android/server/content/SyncManager.java

index 1c883ec..ff1281e 100644 (file)
@@ -1971,6 +1971,10 @@ public class SyncManager {
                 for (int i = 0, N = info.periodicSyncs.size(); i < N; i++) {
                     final Bundle extras = info.periodicSyncs.get(i).first;
                     final Long periodInMillis = info.periodicSyncs.get(i).second * 1000;
+                    // Skip if the period is invalid
+                    if (periodInMillis <= 0) {
+                        continue;
+                    }
                     // find when this periodic sync was last scheduled to run
                     final long lastPollTimeAbsolute = status.getPeriodicSyncTime(i);