public abstract class StateController extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected Context |
mContext |
protected Object |
mLock |
protected StateChangedListener |
mStateChangedListener |
Constructor and Description |
---|
StateController(StateChangedListener stateChangedListener,
Context context,
Object lock) |
Modifier and Type | Method and Description |
---|---|
abstract void |
dumpControllerStateLocked(PrintWriter pw,
int filterUid) |
abstract void |
maybeStartTrackingJobLocked(JobStatus jobStatus,
JobStatus lastJob)
Implement the logic here to decide whether a job should be tracked by this controller.
|
abstract void |
maybeStopTrackingJobLocked(JobStatus jobStatus,
JobStatus incomingJob,
boolean forUpdate)
Remove task - this will happen if the task is cancelled, completed, etc.
|
void |
prepareForExecutionLocked(JobStatus jobStatus)
Optionally implement logic here to prepare the job to be executed.
|
void |
rescheduleForFailure(JobStatus newJob,
JobStatus failureToReschedule)
Called when a new job is being created to reschedule an old failed job.
|
protected static final boolean DEBUG
protected final Context mContext
protected final Object mLock
protected final StateChangedListener mStateChangedListener
public StateController(StateChangedListener stateChangedListener, Context context, Object lock)
public abstract void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob)
public void prepareForExecutionLocked(JobStatus jobStatus)
public abstract void maybeStopTrackingJobLocked(JobStatus jobStatus, JobStatus incomingJob, boolean forUpdate)
public void rescheduleForFailure(JobStatus newJob, JobStatus failureToReschedule)
public abstract void dumpControllerStateLocked(PrintWriter pw, int filterUid)