diff options
author | Jeff Sharkey <jsharkey@android.com> | 2013-03-21 18:14:24 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2013-03-21 18:18:13 -0700 |
commit | 6009459405bbaa42054c9746c6339b48962c7753 (patch) | |
tree | d2bffdfaf285b4964bbd1b05546a0251f936b235 /services/java/com/android/server/content/ContentService.java | |
parent | 71b0017759b825f8bddcdda7425afc802e8918c9 (diff) |
Round up periodic syncs with short frequencies.
Bug: 7668972
Change-Id: I476ded1418a203621913098cf5d33a4e5dc533ee
Diffstat (limited to 'services/java/com/android/server/content/ContentService.java')
-rw-r--r-- | services/java/com/android/server/content/ContentService.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/java/com/android/server/content/ContentService.java b/services/java/com/android/server/content/ContentService.java index 3b92338c1752..545ec935c648 100644 --- a/services/java/com/android/server/content/ContentService.java +++ b/services/java/com/android/server/content/ContentService.java @@ -37,7 +37,9 @@ import android.os.Parcel; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; +import android.text.format.DateUtils; import android.util.Log; +import android.util.Slog; import android.util.SparseIntArray; import java.io.FileDescriptor; @@ -406,6 +408,12 @@ public final class ContentService extends IContentService.Stub { "no permission to write the sync settings"); int userId = UserHandle.getCallingUserId(); + if (pollFrequency <= DateUtils.MINUTE_IN_MILLIS) { + Slog.w(TAG, "Requested poll frequency of " + pollFrequency + + "ms being rounded up to 60 seconds."); + pollFrequency = DateUtils.MINUTE_IN_MILLIS; + } + long identityToken = clearCallingIdentity(); try { getSyncManager().getSyncStorageEngine().addPeriodicSync( |