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)
public static class ShadowJobScheduler.ShadowJobSchedulerImpl
extends ShadowJobScheduler
-
Nested Class Summary
Nested classes/interfaces inherited from class org.robolectric.shadows.ShadowJobScheduler
ShadowJobScheduler.ShadowJobSchedulerImpl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(int jobId) void
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) getPendingJob
(int jobId) int
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
-