public abstract class Scheduler
extends java.lang.Object
JobManager will call attached scheduler every time it thinks that the app should be waken up for
the given job. Each request comes with a SchedulerConstraint which should be reported
back to the JobManager when the system service wakes it up.
| Modifier and Type | Class and Description |
|---|---|
static interface |
Scheduler.Callback
Internal class that handles the communication between the JobManager and the scheduler
|
| Modifier | Constructor and Description |
|---|---|
protected |
Scheduler() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
cancelAll()
When called, should cancel all pending jobs
|
void |
init(android.content.Context context,
Scheduler.Callback callback) |
abstract void |
onFinished(SchedulerConstraint constraint,
boolean reschedule)
Called by the JobManager when a scheduled constraint is handled.
|
abstract void |
request(SchedulerConstraint constraint) |
boolean |
start(SchedulerConstraint constraint)
Triggers the JobManager to handle the given constraint.
|
boolean |
stop(SchedulerConstraint constraint) |
public void init(android.content.Context context,
Scheduler.Callback callback)
public abstract void request(SchedulerConstraint constraint)
public final boolean start(SchedulerConstraint constraint)
onFinished(SchedulerConstraint, boolean) with an async callback.constraint - The constraintpublic final boolean stop(SchedulerConstraint constraint)
public abstract void onFinished(SchedulerConstraint constraint, boolean reschedule)
constraint - The original constraintreschedule - True if the job should be rescheduledpublic abstract void cancelAll()