Commit 76574e7d authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Remove BackgroundTask class params from TaskInfo methods

The BackgroundTask id to class mapping is provided by
ChromeBackgroundTaskFactory and this param is unused.

Bug: none
Change-Id: Ib6e96a759a1a481de030a6ad3185c31f2cdd6e73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219313Reviewed-by: default avatarFilip Gorski <fgorski@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773976}
parent 5dd47550
...@@ -41,8 +41,8 @@ public class FeedRefreshTask extends NativeBackgroundTask { ...@@ -41,8 +41,8 @@ public class FeedRefreshTask extends NativeBackgroundTask {
long flexWindowSizeMs = (long) (thresholdMs * 2 * FLEX_FACTOR); long flexWindowSizeMs = (long) (thresholdMs * 2 * FLEX_FACTOR);
BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler(); BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler();
TaskInfo taskInfo = TaskInfo.createPeriodicTask(TaskIds.FEED_REFRESH_JOB_ID, TaskInfo taskInfo = TaskInfo.createPeriodicTask(TaskIds.FEED_REFRESH_JOB_ID, intervalMs,
FeedRefreshTask.class, intervalMs, flexWindowSizeMs) flexWindowSizeMs)
.setIsPersisted(true) .setIsPersisted(true)
.setUpdateCurrent(true) .setUpdateCurrent(true)
.setRequiredNetworkType(TaskInfo.NetworkType.ANY) .setRequiredNetworkType(TaskInfo.NetworkType.ANY)
......
...@@ -70,8 +70,8 @@ public class UpdateScheduler { ...@@ -70,8 +70,8 @@ public class UpdateScheduler {
// update tasks would be cancelled. // update tasks would be cancelled.
if (mTaskFinishedCallback != null) return; if (mTaskFinishedCallback != null) return;
TaskInfo taskInfo = TaskInfo.createOneOffTask(TaskIds.COMPONENT_UPDATE_JOB_ID, TaskInfo taskInfo = TaskInfo.createOneOffTask(TaskIds.COMPONENT_UPDATE_JOB_ID, delayMs,
UpdateTask.class, delayMs, Integer.MAX_VALUE) Integer.MAX_VALUE)
.setUpdateCurrent(true) .setUpdateCurrent(true)
.setRequiredNetworkType(TaskInfo.NetworkType.UNMETERED) .setRequiredNetworkType(TaskInfo.NetworkType.UNMETERED)
.setIsPersisted(true) .setIsPersisted(true)
...@@ -112,4 +112,4 @@ public class UpdateScheduler { ...@@ -112,4 +112,4 @@ public class UpdateScheduler {
void onStartTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller); void onStartTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller);
void onStopTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller); void onStopTask(long nativeBackgroundTaskUpdateScheduler, UpdateScheduler caller);
} }
} }
\ No newline at end of file
...@@ -63,14 +63,13 @@ public class DownloadResumptionScheduler { ...@@ -63,14 +63,13 @@ public class DownloadResumptionScheduler {
int networkType = allowMeteredConnection ? TaskInfo.NetworkType.ANY int networkType = allowMeteredConnection ? TaskInfo.NetworkType.ANY
: TaskInfo.NetworkType.UNMETERED; : TaskInfo.NetworkType.UNMETERED;
TaskInfo task = TaskInfo task = TaskInfo.createOneOffTask(TaskIds.DOWNLOAD_RESUMPTION_JOB_ID,
TaskInfo.createOneOffTask(TaskIds.DOWNLOAD_RESUMPTION_JOB_ID, DateUtils.DAY_IN_MILLIS)
DownloadResumptionBackgroundTask.class, DateUtils.DAY_IN_MILLIS) .setUpdateCurrent(true)
.setUpdateCurrent(true) .setRequiredNetworkType(networkType)
.setRequiredNetworkType(networkType) .setRequiresCharging(false)
.setRequiresCharging(false) .setIsPersisted(true)
.setIsPersisted(true) .build();
.build();
BackgroundTaskSchedulerFactory.getScheduler().schedule( BackgroundTaskSchedulerFactory.getScheduler().schedule(
ContextUtils.getApplicationContext(), task); ContextUtils.getApplicationContext(), task);
......
...@@ -38,17 +38,16 @@ public class DownloadTaskScheduler { ...@@ -38,17 +38,16 @@ public class DownloadTaskScheduler {
bundle.putBoolean(EXTRA_BATTERY_REQUIRES_CHARGING, requiresCharging); bundle.putBoolean(EXTRA_BATTERY_REQUIRES_CHARGING, requiresCharging);
BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler(); BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler();
TaskInfo taskInfo = TaskInfo taskInfo = TaskInfo.createOneOffTask(getTaskId(taskType),
TaskInfo.createOneOffTask(getTaskId(taskType), DownloadBackgroundTask.class, DateUtils.SECOND_IN_MILLIS * windowStartTimeSeconds,
DateUtils.SECOND_IN_MILLIS * windowStartTimeSeconds, DateUtils.SECOND_IN_MILLIS * windowEndTimeSeconds)
DateUtils.SECOND_IN_MILLIS * windowEndTimeSeconds) .setRequiredNetworkType(getRequiredNetworkType(
.setRequiredNetworkType( taskType, requiresUnmeteredNetwork))
getRequiredNetworkType(taskType, requiresUnmeteredNetwork)) .setRequiresCharging(requiresCharging)
.setRequiresCharging(requiresCharging) .setUpdateCurrent(true)
.setUpdateCurrent(true) .setIsPersisted(true)
.setIsPersisted(true) .setExtras(bundle)
.setExtras(bundle) .build();
.build();
scheduler.schedule(ContextUtils.getApplicationContext(), taskInfo); scheduler.schedule(ContextUtils.getApplicationContext(), taskInfo);
} }
......
...@@ -111,7 +111,6 @@ public class ExploreSitesBackgroundTask extends NativeBackgroundTask { ...@@ -111,7 +111,6 @@ public class ExploreSitesBackgroundTask extends NativeBackgroundTask {
cancelObsoleteTaskId(); cancelObsoleteTaskId();
TaskInfo.Builder taskInfoBuilder = TaskInfo.Builder taskInfoBuilder =
TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID, TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID,
ExploreSitesBackgroundTask.class,
DateUtils.HOUR_IN_MILLIS * DEFAULT_DELAY_HOURS, DateUtils.HOUR_IN_MILLIS * DEFAULT_DELAY_HOURS,
DateUtils.HOUR_IN_MILLIS * DEFAULT_FLEX_HOURS) DateUtils.HOUR_IN_MILLIS * DEFAULT_FLEX_HOURS)
.setRequiredNetworkType(TaskInfo.NetworkType.ANY) .setRequiredNetworkType(TaskInfo.NetworkType.ANY)
......
...@@ -72,12 +72,11 @@ public class NotificationSchedulerTask extends NativeBackgroundTask { ...@@ -72,12 +72,11 @@ public class NotificationSchedulerTask extends NativeBackgroundTask {
@CalledByNative @CalledByNative
private static void schedule(long windowStartMs, long windowEndMs) { private static void schedule(long windowStartMs, long windowEndMs) {
BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler(); BackgroundTaskScheduler scheduler = BackgroundTaskSchedulerFactory.getScheduler();
TaskInfo taskInfo = TaskInfo taskInfo = TaskInfo.createOneOffTask(TaskIds.NOTIFICATION_SCHEDULER_JOB_ID,
TaskInfo.createOneOffTask(TaskIds.NOTIFICATION_SCHEDULER_JOB_ID, windowStartMs, windowEndMs)
NotificationSchedulerTask.class, windowStartMs, windowEndMs) .setUpdateCurrent(true)
.setUpdateCurrent(true) .setIsPersisted(true)
.setIsPersisted(true) .build();
.build();
scheduler.schedule(ContextUtils.getApplicationContext(), taskInfo); scheduler.schedule(ContextUtils.getApplicationContext(), taskInfo);
} }
......
...@@ -69,8 +69,8 @@ public class BackgroundScheduler { ...@@ -69,8 +69,8 @@ public class BackgroundScheduler {
TaskExtrasPacker.packTriggerConditionsInBundle(taskExtras, triggerConditions); TaskExtrasPacker.packTriggerConditionsInBundle(taskExtras, triggerConditions);
TaskInfo taskInfo = TaskInfo taskInfo =
TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_BACKGROUND_JOB_ID, TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_BACKGROUND_JOB_ID, delayStartMs,
OfflineBackgroundTask.class, delayStartMs, executionDeadlineMs) executionDeadlineMs)
.setRequiredNetworkType(triggerConditions.requireUnmeteredNetwork() .setRequiredNetworkType(triggerConditions.requireUnmeteredNetwork()
? TaskInfo.NetworkType.UNMETERED ? TaskInfo.NetworkType.UNMETERED
: TaskInfo.NetworkType.ANY) : TaskInfo.NetworkType.ANY)
......
...@@ -84,7 +84,6 @@ public class OfflineNotificationBackgroundTask extends NativeBackgroundTask { ...@@ -84,7 +84,6 @@ public class OfflineNotificationBackgroundTask extends NativeBackgroundTask {
TaskInfo taskInfo = TaskInfo taskInfo =
TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_NOTIFICATION_JOB_ID, TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_NOTIFICATION_JOB_ID,
OfflineNotificationBackgroundTask.class,
// Minimum time to wait. // Minimum time to wait.
delayInMillis, delayInMillis,
// Maximum time to wait. After this interval the event will fire // Maximum time to wait. After this interval the event will fire
......
...@@ -48,7 +48,6 @@ public class PrefetchBackgroundTaskScheduler { ...@@ -48,7 +48,6 @@ public class PrefetchBackgroundTaskScheduler {
+ additionalDelaySeconds; + additionalDelaySeconds;
TaskInfo.Builder taskInfoBuilder = TaskInfo.Builder taskInfoBuilder =
TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID, TaskInfo.createOneOffTask(TaskIds.OFFLINE_PAGES_PREFETCH_JOB_ID,
PrefetchBackgroundTask.class,
// Minimum time to wait // Minimum time to wait
DateUtils.SECOND_IN_MILLIS * minimumTimeSeconds, DateUtils.SECOND_IN_MILLIS * minimumTimeSeconds,
// Maximum time to wait. After this interval the event will fire // Maximum time to wait. After this interval the event will fire
......
...@@ -132,9 +132,8 @@ public class OmahaService extends OmahaBase implements BackgroundTask { ...@@ -132,9 +132,8 @@ public class OmahaService extends OmahaBase implements BackgroundTask {
static boolean scheduleJobService(Context context, long delayMs) { static boolean scheduleJobService(Context context, long delayMs) {
long latency = Math.max(0, delayMs); long latency = Math.max(0, delayMs);
TaskInfo taskInfo = TaskInfo.createOneOffTask(TaskIds.OMAHA_JOB_ID, OmahaService.class, TaskInfo taskInfo =
latency, latency) TaskInfo.createOneOffTask(TaskIds.OMAHA_JOB_ID, latency, latency).build();
.build();
return BackgroundTaskSchedulerFactory.getScheduler().schedule(context, taskInfo); return BackgroundTaskSchedulerFactory.getScheduler().schedule(context, taskInfo);
} }
} }
...@@ -150,10 +150,10 @@ public class ChromeGcmListenerService extends GcmListenerService { ...@@ -150,10 +150,10 @@ public class ChromeGcmListenerService extends GcmListenerService {
*/ */
private static void scheduleBackgroundTask(GCMMessage message) { private static void scheduleBackgroundTask(GCMMessage message) {
// TODO(peter): Add UMA for measuring latency introduced by the BackgroundTaskScheduler. // TODO(peter): Add UMA for measuring latency introduced by the BackgroundTaskScheduler.
TaskInfo backgroundTask = TaskInfo.createOneOffTask(TaskIds.GCM_BACKGROUND_TASK_JOB_ID, TaskInfo backgroundTask =
GCMBackgroundTask.class, 0 /* immediately */) TaskInfo.createOneOffTask(TaskIds.GCM_BACKGROUND_TASK_JOB_ID, 0 /* immediately */)
.setExtras(message.toBundle()) .setExtras(message.toBundle())
.build(); .build();
BackgroundTaskSchedulerFactory.getScheduler().schedule( BackgroundTaskSchedulerFactory.getScheduler().schedule(
ContextUtils.getApplicationContext(), backgroundTask); ContextUtils.getApplicationContext(), backgroundTask);
} }
......
...@@ -201,23 +201,22 @@ public class WebApkUpdateManager implements WebApkUpdateDataFetcher.Observer, De ...@@ -201,23 +201,22 @@ public class WebApkUpdateManager implements WebApkUpdateDataFetcher.Observer, De
TaskInfo updateTask; TaskInfo updateTask;
if (mStorage.shouldForceUpdate()) { if (mStorage.shouldForceUpdate()) {
// Start an update task ASAP for forced updates. // Start an update task ASAP for forced updates.
updateTask = TaskInfo.createOneOffTask(TaskIds.WEBAPK_UPDATE_JOB_ID,
WebApkUpdateTask.class, 0 /* windowEndTimeMs */)
.setUpdateCurrent(true)
.setIsPersisted(true)
.build();
mStorage.setUpdateScheduled(true);
mStorage.setShouldForceUpdate(false);
} else {
// The task deadline should be before {@link WebappDataStorage#RETRY_UPDATE_DURATION}
updateTask = updateTask =
TaskInfo.createOneOffTask(TaskIds.WEBAPK_UPDATE_JOB_ID, WebApkUpdateTask.class, TaskInfo.createOneOffTask(TaskIds.WEBAPK_UPDATE_JOB_ID, 0 /* windowEndTimeMs */)
DateUtils.HOUR_IN_MILLIS, DateUtils.HOUR_IN_MILLIS * 23)
.setRequiredNetworkType(TaskInfo.NetworkType.UNMETERED)
.setUpdateCurrent(true) .setUpdateCurrent(true)
.setIsPersisted(true) .setIsPersisted(true)
.setRequiresCharging(true)
.build(); .build();
mStorage.setUpdateScheduled(true);
mStorage.setShouldForceUpdate(false);
} else {
// The task deadline should be before {@link WebappDataStorage#RETRY_UPDATE_DURATION}
updateTask = TaskInfo.createOneOffTask(TaskIds.WEBAPK_UPDATE_JOB_ID,
DateUtils.HOUR_IN_MILLIS, DateUtils.HOUR_IN_MILLIS * 23)
.setRequiredNetworkType(TaskInfo.NetworkType.UNMETERED)
.setUpdateCurrent(true)
.setIsPersisted(true)
.setRequiresCharging(true)
.build();
} }
BackgroundTaskSchedulerFactory.getScheduler().schedule( BackgroundTaskSchedulerFactory.getScheduler().schedule(
......
...@@ -199,8 +199,7 @@ public class ExploreSitesBackgroundTaskUnitTest { ...@@ -199,8 +199,7 @@ public class ExploreSitesBackgroundTaskUnitTest {
public void testRemovesDeprecatedJobId() { public void testRemovesDeprecatedJobId() {
TaskInfo.Builder deprecatedTaskInfoBuilder = TaskInfo.Builder deprecatedTaskInfoBuilder =
TaskInfo.createPeriodicTask(TaskIds.DEPRECATED_EXPLORE_SITES_REFRESH_JOB_ID, TaskInfo.createPeriodicTask(TaskIds.DEPRECATED_EXPLORE_SITES_REFRESH_JOB_ID,
ExploreSitesBackgroundTask.class, TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(1))
TimeUnit.HOURS.toMillis(1))
.setRequiredNetworkType(TaskInfo.NetworkType.ANY) .setRequiredNetworkType(TaskInfo.NetworkType.ANY)
.setIsPersisted(true) .setIsPersisted(true)
.setUpdateCurrent(false); .setUpdateCurrent(false);
...@@ -226,8 +225,7 @@ public class ExploreSitesBackgroundTaskUnitTest { ...@@ -226,8 +225,7 @@ public class ExploreSitesBackgroundTaskUnitTest {
TaskInfo.Builder taskInfoBuilder = TaskInfo.Builder taskInfoBuilder =
TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID, TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID,
ExploreSitesBackgroundTask.class, TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(1))
TimeUnit.HOURS.toMillis(1))
.setRequiredNetworkType(TaskInfo.NetworkType.ANY) .setRequiredNetworkType(TaskInfo.NetworkType.ANY)
.setIsPersisted(true) .setIsPersisted(true)
.setUpdateCurrent(false); .setUpdateCurrent(false);
...@@ -250,8 +248,7 @@ public class ExploreSitesBackgroundTaskUnitTest { ...@@ -250,8 +248,7 @@ public class ExploreSitesBackgroundTaskUnitTest {
public void testDoesNotRemoveTaskIfFeatureIsEnabled() { public void testDoesNotRemoveTaskIfFeatureIsEnabled() {
TaskInfo.Builder taskInfoBuilder = TaskInfo.Builder taskInfoBuilder =
TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID, TaskInfo.createPeriodicTask(TaskIds.EXPLORE_SITES_REFRESH_JOB_ID,
ExploreSitesBackgroundTask.class, TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(4), TimeUnit.HOURS.toMillis(1))
TimeUnit.HOURS.toMillis(1))
.setRequiredNetworkType(TaskInfo.NetworkType.ANY) .setRequiredNetworkType(TaskInfo.NetworkType.ANY)
.setIsPersisted(true) .setIsPersisted(true)
.setUpdateCurrent(false); .setUpdateCurrent(false);
......
...@@ -566,11 +566,9 @@ public class TaskInfo { ...@@ -566,11 +566,9 @@ public class TaskInfo {
/** /**
* Schedule a one-off task to execute within a deadline. If windowEndTimeMs is 0, the task will * Schedule a one-off task to execute within a deadline. If windowEndTimeMs is 0, the task will
* run as soon as possible. For executing a task within a time window, see * run as soon as possible. For executing a task within a time window, see
* {@link #createOneOffTask(int, Class, long, long)}. * {@link #createOneOffTask(int, long, long)}.
* *
* @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}. * @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}.
* @param backgroundTaskClass the {@link BackgroundTask} class that will be instantiated for
* this task.
* @param windowEndTimeMs the end of the window that the task can begin executing as a delta in * @param windowEndTimeMs the end of the window that the task can begin executing as a delta in
* milliseconds from now. Note that the task begins executing at this point even if the * milliseconds from now. Note that the task begins executing at this point even if the
* prerequisite conditions are not met. * prerequisite conditions are not met.
...@@ -582,19 +580,16 @@ public class TaskInfo { ...@@ -582,19 +580,16 @@ public class TaskInfo {
* {@link TimingInfo} object with the wanted properties. * {@link TimingInfo} object with the wanted properties.
*/ */
@Deprecated @Deprecated
public static Builder createOneOffTask( public static Builder createOneOffTask(int taskId, long windowEndTimeMs) {
int taskId, Class<? extends BackgroundTask> backgroundTaskClass, long windowEndTimeMs) {
TimingInfo oneOffInfo = OneOffInfo.create().setWindowEndTimeMs(windowEndTimeMs).build(); TimingInfo oneOffInfo = OneOffInfo.create().setWindowEndTimeMs(windowEndTimeMs).build();
return new Builder(taskId).setTimingInfo(oneOffInfo); return new Builder(taskId).setTimingInfo(oneOffInfo);
} }
/** /**
* Schedule a one-off task to execute within a time window. For executing a task within a * Schedule a one-off task to execute within a time window. For executing a task within a
* deadline, see {@link #createOneOffTask(int, Class, long)}, * deadline, see {@link #createOneOffTask(int, long)},
* *
* @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}. * @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}.
* @param backgroundTaskClass the {@link BackgroundTask} class that will be instantiated for
* this task.
* @param windowStartTimeMs the start of the window that the task can begin executing as a delta * @param windowStartTimeMs the start of the window that the task can begin executing as a delta
* in milliseconds from now. * in milliseconds from now.
* @param windowEndTimeMs the end of the window that the task can begin executing as a delta in * @param windowEndTimeMs the end of the window that the task can begin executing as a delta in
...@@ -608,9 +603,8 @@ public class TaskInfo { ...@@ -608,9 +603,8 @@ public class TaskInfo {
* {@link TimingInfo} object with the wanted properties. * {@link TimingInfo} object with the wanted properties.
*/ */
@Deprecated @Deprecated
public static Builder createOneOffTask(int taskId, public static Builder createOneOffTask(
Class<? extends BackgroundTask> backgroundTaskClass, long windowStartTimeMs, int taskId, long windowStartTimeMs, long windowEndTimeMs) {
long windowEndTimeMs) {
TimingInfo oneOffInfo = OneOffInfo.create() TimingInfo oneOffInfo = OneOffInfo.create()
.setWindowStartTimeMs(windowStartTimeMs) .setWindowStartTimeMs(windowStartTimeMs)
.setWindowEndTimeMs(windowEndTimeMs) .setWindowEndTimeMs(windowEndTimeMs)
...@@ -628,8 +622,6 @@ public class TaskInfo { ...@@ -628,8 +622,6 @@ public class TaskInfo {
* flex milliseconds before. * flex milliseconds before.
* *
* @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}. * @param taskId the unique task ID for this task. Should be listed in {@link TaskIds}.
* @param backgroundTaskClass the {@link BackgroundTask} class that will be instantiated for
* this task.
* @param intervalMs the interval between occurrences of this task in milliseconds. * @param intervalMs the interval between occurrences of this task in milliseconds.
* @param flexMs the flex time for this task. The task can execute at any time in a window of * @param flexMs the flex time for this task. The task can execute at any time in a window of
* flex * flex
...@@ -637,13 +629,12 @@ public class TaskInfo { ...@@ -637,13 +629,12 @@ public class TaskInfo {
* @return the builder which can be used to continue configuration and {@link Builder#build()}. * @return the builder which can be used to continue configuration and {@link Builder#build()}.
* @see TaskIds * @see TaskIds
* *
* @deprecated the {@see #createTask(int, Class, TimingInfo)} method should be used instead. * @deprecated the {@see #createTask(int, TimingInfo)} method should be used instead.
* This method requires an additional step for the caller: the creation of the specific * This method requires an additional step for the caller: the creation of the specific
* {@link TimingInfo} object with the wanted properties. * {@link TimingInfo} object with the wanted properties.
*/ */
@Deprecated @Deprecated
public static Builder createPeriodicTask(int taskId, public static Builder createPeriodicTask(int taskId, long intervalMs, long flexMs) {
Class<? extends BackgroundTask> backgroundTaskClass, long intervalMs, long flexMs) {
TimingInfo periodicInfo = TimingInfo periodicInfo =
PeriodicInfo.create().setIntervalMs(intervalMs).setFlexMs(flexMs).build(); PeriodicInfo.create().setIntervalMs(intervalMs).setFlexMs(flexMs).build();
return new Builder(taskId).setTimingInfo(periodicInfo); return new Builder(taskId).setTimingInfo(periodicInfo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment