Loading core/java/android/app/job/JobInfo.java +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.os.PersistableBundle; import android.util.Log; import java.util.ArrayList; Loading @@ -35,6 +36,7 @@ import java.util.ArrayList; * accomplish. Doing otherwise with throw an exception in your app. */ public class JobInfo implements Parcelable { private static String TAG = "JobInfo"; /** Default. */ public static final int NETWORK_TYPE_NONE = 0; /** This job requires network connectivity. */ Loading Loading @@ -526,7 +528,8 @@ public class JobInfo implements Parcelable { /** * Specify that this job should recur with the provided interval and flex. The job can * execute at any time in a window of flex length at the end of the period. * @param intervalMillis Millisecond interval for which this job will repeat. * @param intervalMillis Millisecond interval for which this job will repeat. A minimum * value of {@link #MIN_PERIOD_MILLIS} is enforced. * @param flexMillis Millisecond flex for this job. Flex is clamped to be at least * {@link #MIN_FLEX_MILLIS} or 5 percent of the period, whichever is * higher. Loading Loading @@ -635,7 +638,16 @@ public class JobInfo implements Parcelable { " back-off policy, so calling setBackoffCriteria with" + " setRequiresDeviceIdle is an error."); } return new JobInfo(this); JobInfo job = new JobInfo(this); if (job.intervalMillis != job.getIntervalMillis()) { Log.w(TAG, "Specified interval is less than minimum interval. Clamped to " + job.getIntervalMillis()); } if (job.flexMillis != job.getFlexMillis()) { Log.w(TAG, "Specified flex is less than minimum flex. Clamped to " + job.getFlexMillis()); } return job; } } Loading core/java/android/content/ContentResolver.java +2 −1 Original line number Diff line number Diff line Loading @@ -2060,7 +2060,8 @@ public abstract class ContentResolver { * @param account the account to specify in the sync * @param authority the provider to specify in the sync request * @param extras extra parameters to go along with the sync request * @param pollFrequency how frequently the sync should be performed, in seconds. * @param pollFrequency how frequently the sync should be performed, in seconds. A minimum value * of 1 hour is enforced. * @throws IllegalArgumentException if an illegal extra was set or if any of the parameters * are null. */ Loading core/java/android/content/SyncRequest.java +3 −2 Original line number Diff line number Diff line Loading @@ -307,10 +307,11 @@ public class SyncRequest implements Parcelable { * be thrown. * * @param pollFrequency the amount of time in seconds that you wish * to elapse between periodic syncs. * to elapse between periodic syncs. A minimum period of 1 hour is enforced. * @param beforeSeconds the amount of flex time in seconds before * {@code pollFrequency} that you permit for the sync to take * place. Must be less than {@code pollFrequency}. * place. Must be less than {@code pollFrequency} and greater than * MAX(5% of {@code pollFrequency}, 5 minutes) */ public Builder syncPeriodic(long pollFrequency, long beforeSeconds) { if (mSyncType != SYNC_TYPE_UNKNOWN) { Loading services/core/java/com/android/server/content/ContentService.java +6 −6 Original line number Diff line number Diff line Loading @@ -400,10 +400,10 @@ public final class ContentService extends IContentService.Stub { SyncStorageEngine.EndPoint info; info = new SyncStorageEngine.EndPoint( request.getAccount(), request.getProvider(), userId); if (runAtTime < 60) { if (runAtTime < 3600) { Slog.w(TAG, "Requested poll frequency of " + runAtTime + " seconds being rounded up to 60 seconds."); runAtTime = 60; + " seconds being rounded up to 1 hour."); runAtTime = 3600; } // Schedule periodic sync. getSyncManager().updateOrAddPeriodicSync(info, runAtTime, Loading Loading @@ -620,10 +620,10 @@ public final class ContentService extends IContentService.Stub { "no permission to write the sync settings"); int userId = UserHandle.getCallingUserId(); if (pollFrequency < 60) { if (pollFrequency < 3600) { Slog.w(TAG, "Requested poll frequency of " + pollFrequency + " seconds being rounded up to 60 seconds."); pollFrequency = 60; + " seconds being rounded up to 1 hour."); pollFrequency = 3600; } long defaultFlex = SyncStorageEngine.calculateDefaultFlexTime(pollFrequency); Loading Loading
core/java/android/app/job/JobInfo.java +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.os.PersistableBundle; import android.util.Log; import java.util.ArrayList; Loading @@ -35,6 +36,7 @@ import java.util.ArrayList; * accomplish. Doing otherwise with throw an exception in your app. */ public class JobInfo implements Parcelable { private static String TAG = "JobInfo"; /** Default. */ public static final int NETWORK_TYPE_NONE = 0; /** This job requires network connectivity. */ Loading Loading @@ -526,7 +528,8 @@ public class JobInfo implements Parcelable { /** * Specify that this job should recur with the provided interval and flex. The job can * execute at any time in a window of flex length at the end of the period. * @param intervalMillis Millisecond interval for which this job will repeat. * @param intervalMillis Millisecond interval for which this job will repeat. A minimum * value of {@link #MIN_PERIOD_MILLIS} is enforced. * @param flexMillis Millisecond flex for this job. Flex is clamped to be at least * {@link #MIN_FLEX_MILLIS} or 5 percent of the period, whichever is * higher. Loading Loading @@ -635,7 +638,16 @@ public class JobInfo implements Parcelable { " back-off policy, so calling setBackoffCriteria with" + " setRequiresDeviceIdle is an error."); } return new JobInfo(this); JobInfo job = new JobInfo(this); if (job.intervalMillis != job.getIntervalMillis()) { Log.w(TAG, "Specified interval is less than minimum interval. Clamped to " + job.getIntervalMillis()); } if (job.flexMillis != job.getFlexMillis()) { Log.w(TAG, "Specified flex is less than minimum flex. Clamped to " + job.getFlexMillis()); } return job; } } Loading
core/java/android/content/ContentResolver.java +2 −1 Original line number Diff line number Diff line Loading @@ -2060,7 +2060,8 @@ public abstract class ContentResolver { * @param account the account to specify in the sync * @param authority the provider to specify in the sync request * @param extras extra parameters to go along with the sync request * @param pollFrequency how frequently the sync should be performed, in seconds. * @param pollFrequency how frequently the sync should be performed, in seconds. A minimum value * of 1 hour is enforced. * @throws IllegalArgumentException if an illegal extra was set or if any of the parameters * are null. */ Loading
core/java/android/content/SyncRequest.java +3 −2 Original line number Diff line number Diff line Loading @@ -307,10 +307,11 @@ public class SyncRequest implements Parcelable { * be thrown. * * @param pollFrequency the amount of time in seconds that you wish * to elapse between periodic syncs. * to elapse between periodic syncs. A minimum period of 1 hour is enforced. * @param beforeSeconds the amount of flex time in seconds before * {@code pollFrequency} that you permit for the sync to take * place. Must be less than {@code pollFrequency}. * place. Must be less than {@code pollFrequency} and greater than * MAX(5% of {@code pollFrequency}, 5 minutes) */ public Builder syncPeriodic(long pollFrequency, long beforeSeconds) { if (mSyncType != SYNC_TYPE_UNKNOWN) { Loading
services/core/java/com/android/server/content/ContentService.java +6 −6 Original line number Diff line number Diff line Loading @@ -400,10 +400,10 @@ public final class ContentService extends IContentService.Stub { SyncStorageEngine.EndPoint info; info = new SyncStorageEngine.EndPoint( request.getAccount(), request.getProvider(), userId); if (runAtTime < 60) { if (runAtTime < 3600) { Slog.w(TAG, "Requested poll frequency of " + runAtTime + " seconds being rounded up to 60 seconds."); runAtTime = 60; + " seconds being rounded up to 1 hour."); runAtTime = 3600; } // Schedule periodic sync. getSyncManager().updateOrAddPeriodicSync(info, runAtTime, Loading Loading @@ -620,10 +620,10 @@ public final class ContentService extends IContentService.Stub { "no permission to write the sync settings"); int userId = UserHandle.getCallingUserId(); if (pollFrequency < 60) { if (pollFrequency < 3600) { Slog.w(TAG, "Requested poll frequency of " + pollFrequency + " seconds being rounded up to 60 seconds."); pollFrequency = 60; + " seconds being rounded up to 1 hour."); pollFrequency = 3600; } long defaultFlex = SyncStorageEngine.calculateDefaultFlexTime(pollFrequency); Loading