summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorAshish Sharma <ashishsharma@google.com>2013-06-10 11:25:51 -0700
committerAshish Sharma <ashishsharma@google.com>2013-06-10 19:14:52 +0000
commit59dc7a8e75647d5112efd0719e210cdcf83f56c2 (patch)
treecea6a93ce5b7f758895b6d593d9975ee0fbeb8dc /services
parentcb5d644fb8956962b6a89f8d384b16819af5fdf9 (diff)
downloadframeworks_base-59dc7a8e75647d5112efd0719e210cdcf83f56c2.zip
frameworks_base-59dc7a8e75647d5112efd0719e210cdcf83f56c2.tar.gz
frameworks_base-59dc7a8e75647d5112efd0719e210cdcf83f56c2.tar.bz2
Do not allow 0 or smaller periodicity for syncs.
b/9295383 Change-Id: I5f758f4a033d74e42a04b214a6b70b94d394280d (cherry picked from commit 4970974d74a2986a333e645a5c141ef5f9a753cc)
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/content/SyncManager.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/java/com/android/server/content/SyncManager.java b/services/java/com/android/server/content/SyncManager.java
index 1c883ec..ff1281e 100644
--- a/services/java/com/android/server/content/SyncManager.java
+++ b/services/java/com/android/server/content/SyncManager.java
@@ -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);