Package org.robolectric.shadows
Class ShadowJobScheduler.ShadowJobSchedulerImpl
java.lang.Object
org.robolectric.shadows.ShadowJobScheduler
org.robolectric.shadows.ShadowJobScheduler.ShadowJobSchedulerImpl
- Enclosing class:
- ShadowJobScheduler
@Implements(value=android.app.JobSchedulerImpl.class, isInAndroidSdk=false, minSdk=21) public static class ShadowJobScheduler.ShadowJobSchedulerImpl extends ShadowJobScheduler
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowJobScheduler
ShadowJobScheduler.ShadowJobSchedulerImpl
-
Constructor Summary
Constructors Constructor Description ShadowJobSchedulerImpl()
-
Method Summary
Modifier and Type Method Description void
cancel(int jobId)
void
cancelAll()
int
enqueue(JobInfo job, JobWorkItem work)
void
failExpeditedJob(boolean enabled)
Whether to fail a job if it is set as expedited.void
failOnJob(int jobId)
List<JobInfo>
getAllPendingJobs()
JobInfo
getPendingJob(int jobId)
int
schedule(JobInfo job)
protected int
scheduleAsPackage(JobInfo job, String packageName, int userId, String tag)
Simple implementation redirecting all calls toschedule(JobInfo)
.
-
Constructor Details
-
ShadowJobSchedulerImpl
public ShadowJobSchedulerImpl()
-
-
Method Details
-
schedule
- Specified by:
schedule
in classShadowJobScheduler
-
scheduleAsPackage
@Implementation(minSdk=24) @HiddenApi protected int scheduleAsPackage(JobInfo job, String packageName, int userId, String tag)Simple implementation redirecting all calls toschedule(JobInfo)
. Ignores all arguments other thanjob
.- Specified by:
scheduleAsPackage
in classShadowJobScheduler
-
cancel
- Specified by:
cancel
in classShadowJobScheduler
-
cancelAll
- Specified by:
cancelAll
in classShadowJobScheduler
-
getAllPendingJobs
- Specified by:
getAllPendingJobs
in classShadowJobScheduler
-
getPendingJob
- Specified by:
getPendingJob
in classShadowJobScheduler
-
enqueue
- Specified by:
enqueue
in classShadowJobScheduler
-
failOnJob
public void failOnJob(int jobId)- Specified by:
failOnJob
in classShadowJobScheduler
-
failExpeditedJob
public void failExpeditedJob(boolean enabled)Description copied from class:ShadowJobScheduler
Whether to fail a job if it is set as expedited.- Specified by:
failExpeditedJob
in classShadowJobScheduler
-