JobScheduler | API reference | Android Developers (original) (raw)
public abstract class JobSchedulerextends [Object](/reference/java/lang/Object) ``
This is an API for scheduling various types of jobs against the framework that will be executed in your application's own process.
See [JobInfo](/reference/android/app/job/JobInfo) for more description of the types of jobs that can be run and how to construct them. You will construct these JobInfo objects and pass them to the JobScheduler with [schedule(JobInfo)](/reference/android/app/job/JobScheduler#schedule%28android.app.job.JobInfo%29). When the criteria declared are met, the system will execute this job on your application's [JobService](/reference/android/app/job/JobService). You identify the service component that implements the logic for your job when you construct the JobInfo using[JobInfo.Builder.Builder(int, android.content.ComponentName)](/reference/android/app/job/JobInfo.Builder#Builder%28int,%20android.content.ComponentName%29).
The framework will be intelligent about when it executes jobs, and attempt to batch and defer them as much as possible. Typically, if you don't specify a deadline on a job, it can be run at any moment depending on the current state of the JobScheduler's internal queue.
Starting in Android version [Build.VERSION_CODES.UPSIDE_DOWN_CAKE](/reference/android/os/Build.VERSION%5FCODES#UPSIDE%5FDOWN%5FCAKE), JobScheduler may try to optimize job execution by shifting execution to times with more available system resources in order to lower user impact. Factors in system health include sufficient battery, idle, charging, and access to an un-metered network. Jobs will initially be treated as if they have all these requirements, but as their deadlines approach, restrictions will become less strict. Requested requirements will not be affected by this change.
While a job is running, the system holds a wakelock on behalf of your app. For this reason, you do not need to take any action to guarantee that the device stays awake for the duration of the job.
You do not instantiate this class directly; instead, retrieve it through[Context.getSystemService(Context.JOB_SCHEDULER_SERVICE)](/reference/android/content/Context#getSystemService%28java.lang.Class<T>%29).
Prior to Android version [Build.VERSION_CODES.S](/reference/android/os/Build.VERSION%5FCODES#S), jobs could only have a maximum of 100 jobs scheduled at a time. Starting with Android version[Build.VERSION_CODES.S](/reference/android/os/Build.VERSION%5FCODES#S), that limit has been increased to 150. Expedited jobs also count towards the limit.
In Android version [Build.VERSION_CODES.LOLLIPOP](/reference/android/os/Build.VERSION%5FCODES#LOLLIPOP), jobs had a maximum execution time of one minute. Starting with Android version[Build.VERSION_CODES.M](/reference/android/os/Build.VERSION%5FCODES#M) and ending with Android version[Build.VERSION_CODES.R](/reference/android/os/Build.VERSION%5FCODES#R), jobs had a maximum execution time of 10 minutes. Starting from Android version [Build.VERSION_CODES.S](/reference/android/os/Build.VERSION%5FCODES#S), jobs will still be stopped after 10 minutes if the system is busy or needs the resources, but if not, jobs may continue running longer than 10 minutes.
Note: Beginning with API 30 ([Build.VERSION_CODES.R](/reference/android/os/Build.VERSION%5FCODES#R)), JobScheduler will throttle runaway applications. Calling [schedule(JobInfo)](/reference/android/app/job/JobScheduler#schedule%28android.app.job.JobInfo%29) and other such methods with very high frequency can have a high cost and so, to make sure the system doesn't get overwhelmed, JobScheduler will begin to throttle apps, regardless of target SDK version.
See also:
[JobInfo.Builder.setRequiresBatteryNotLow(boolean)](/reference/android/app/job/JobInfo.Builder#setRequiresBatteryNotLow%28boolean%29)[JobInfo.Builder.setRequiresDeviceIdle(boolean)](/reference/android/app/job/JobInfo.Builder#setRequiresDeviceIdle%28boolean%29)[JobInfo.Builder.setRequiresCharging(boolean)](/reference/android/app/job/JobInfo.Builder#setRequiresCharging%28boolean%29)[JobInfo.Builder.setRequiredNetworkType(int)](/reference/android/app/job/JobInfo.Builder#setRequiredNetworkType%28int%29)
Summary
| Constants | |
|---|---|
| int | PENDING_JOB_REASON_APP The app is in a state that prevents the job from running (eg. |
| int | PENDING_JOB_REASON_APP_STANDBY The current standby bucket prevents the job from running. |
| int | PENDING_JOB_REASON_BACKGROUND_RESTRICTION The app is restricted from running in the background. |
| int | PENDING_JOB_REASON_CONSTRAINT_BATTERY_NOT_LOW The requested battery-not-low constraint is not satisfied. |
| int | PENDING_JOB_REASON_CONSTRAINT_CHARGING The requested charging constraint is not satisfied. |
| int | PENDING_JOB_REASON_CONSTRAINT_CONNECTIVITY The requested connectivity constraint is not satisfied. |
| int | PENDING_JOB_REASON_CONSTRAINT_CONTENT_TRIGGER The requested content trigger constraint is not satisfied. |
| int | PENDING_JOB_REASON_CONSTRAINT_DEADLINE The override deadline has not transpired. |
| int | PENDING_JOB_REASON_CONSTRAINT_DEVICE_IDLE The requested idle constraint is not satisfied. |
| int | PENDING_JOB_REASON_CONSTRAINT_MINIMUM_LATENCY The minimum latency has not transpired. |
| int | PENDING_JOB_REASON_CONSTRAINT_PREFETCH The system's estimate of when the app will be launched is far away enough to warrant delaying this job. |
| int | PENDING_JOB_REASON_CONSTRAINT_STORAGE_NOT_LOW The requested storage-not-low constraint is not satisfied. |
| int | PENDING_JOB_REASON_DEVICE_STATE The job is being deferred due to the device state (e.g., Doze, battery saver, memory usage, thermal status, etc.). |
| int | PENDING_JOB_REASON_EXECUTING The job is currently running and is therefore not pending. |
| int | PENDING_JOB_REASON_INVALID_JOB_ID The job doesn't exist. |
| int | PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION JobScheduler thinks it can defer this job to a more optimal running time. |
| int | PENDING_JOB_REASON_QUOTA The app has consumed all of its current quota. |
| int | PENDING_JOB_REASON_UNDEFINED There is no known reason why the job is pending. |
| int | PENDING_JOB_REASON_USER JobScheduler is respecting one of the user's actions (eg. |
| int | RESULT_FAILURE Returned from schedule(JobInfo) if a job wasn't scheduled successfully. |
| int | RESULT_SUCCESS Returned from schedule(JobInfo) if this job has been successfully scheduled. |
| Public constructors |
|---|
| JobScheduler() |
| Public methods | |
|---|---|
| boolean | canRunUserInitiatedJobs() Returns true if the calling app currently holds theManifest.permission.RUN_USER_INITIATED_JOBS permission, allowing it to run user-initiated jobs. |
| abstract void | cancel(int jobId) Cancel the specified job. |
| abstract void | cancelAll() Cancel all jobs that have been scheduled in the current namespace by the calling application. |
| void | cancelInAllNamespaces() Cancel all jobs that have been scheduled by the calling application, regardless of namespace. |
| abstract int | enqueue(JobInfo job, JobWorkItem work) Similar to schedule(JobInfo), but allows you to enqueue work for a new or existing job. |
| JobScheduler | forNamespace(String namespace) Get a JobScheduler instance that is dedicated to a specific namespace. |
| abstractList<JobInfo> | getAllPendingJobs() Retrieve all jobs that have been scheduled by the calling application. |
| String | getNamespace() Get the namespace this JobScheduler instance is operating in. |
| abstractJobInfo | getPendingJob(int jobId) Look up the description of a scheduled job. |
| int | getPendingJobReason(int jobId) Returns a reason why the job is pending and not currently executing. |
| Map<Integer, Duration> | getPendingJobReasonStats(int jobId) For the given jobId, returns an aggregated view of why the job has been pending execution over its lifetime. |
| int[] | getPendingJobReasons(int jobId) Returns potential reasons why the job with the given jobId may be pending and not currently executing. |
| List<PendingJobReasonsInfo> | getPendingJobReasonsHistory(int jobId) For the given jobId, returns a limited historical view of why the job may have been pending execution. |
| Map<String, List<JobInfo>> | getPendingJobsInAllNamespaces() Retrieve all jobs that have been scheduled by the calling application within the current namespace. |
| abstract int | schedule(JobInfo job) Schedule a job to be executed. |
| Inherited methods |
|---|
| From class java.lang.Object Object clone() Creates and returns a copy of this object. boolean equals(Object obj) Indicates whether some other object is "equal to" this one. void finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. finalClass<?> getClass() Returns the runtime class of this Object. int hashCode() Returns a hash code value for the object. final void notify() Wakes up a single thread that is waiting on this object's monitor. final void notifyAll() Wakes up all threads that are waiting on this object's monitor. String toString() Returns a string representation of the object. final void wait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. final void wait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. final void wait() Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
Constants
PENDING_JOB_REASON_APP
public static final int PENDING_JOB_REASON_APP
The app is in a state that prevents the job from running (eg. the [JobService](/reference/android/app/job/JobService) component is disabled).
Constant Value: 1 (0x00000001)
PENDING_JOB_REASON_APP_STANDBY
public static final int PENDING_JOB_REASON_APP_STANDBY
The current standby bucket prevents the job from running.
Constant Value: 2 (0x00000002)
PENDING_JOB_REASON_BACKGROUND_RESTRICTION
public static final int PENDING_JOB_REASON_BACKGROUND_RESTRICTION
The app is restricted from running in the background.
Constant Value: 3 (0x00000003)
PENDING_JOB_REASON_CONSTRAINT_BATTERY_NOT_LOW
public static final int PENDING_JOB_REASON_CONSTRAINT_BATTERY_NOT_LOW
The requested battery-not-low constraint is not satisfied.
Constant Value: 4 (0x00000004)
PENDING_JOB_REASON_CONSTRAINT_CHARGING
public static final int PENDING_JOB_REASON_CONSTRAINT_CHARGING
The requested charging constraint is not satisfied.
Constant Value: 5 (0x00000005)
PENDING_JOB_REASON_CONSTRAINT_CONTENT_TRIGGER
public static final int PENDING_JOB_REASON_CONSTRAINT_CONTENT_TRIGGER
The requested content trigger constraint is not satisfied.
Constant Value: 7 (0x00000007)
PENDING_JOB_REASON_CONSTRAINT_DEADLINE
public static final int PENDING_JOB_REASON_CONSTRAINT_DEADLINE
The override deadline has not transpired.
Constant Value: 16 (0x00000010)
PENDING_JOB_REASON_CONSTRAINT_DEVICE_IDLE
public static final int PENDING_JOB_REASON_CONSTRAINT_DEVICE_IDLE
The requested idle constraint is not satisfied.
Constant Value: 8 (0x00000008)
PENDING_JOB_REASON_CONSTRAINT_MINIMUM_LATENCY
public static final int PENDING_JOB_REASON_CONSTRAINT_MINIMUM_LATENCY
The minimum latency has not transpired.
Constant Value: 9 (0x00000009)
PENDING_JOB_REASON_CONSTRAINT_PREFETCH
public static final int PENDING_JOB_REASON_CONSTRAINT_PREFETCH
The system's estimate of when the app will be launched is far away enough to warrant delaying this job.
Constant Value: 10 (0x0000000a)
PENDING_JOB_REASON_CONSTRAINT_STORAGE_NOT_LOW
public static final int PENDING_JOB_REASON_CONSTRAINT_STORAGE_NOT_LOW
The requested storage-not-low constraint is not satisfied.
Constant Value: 11 (0x0000000b)
PENDING_JOB_REASON_EXECUTING
public static final int PENDING_JOB_REASON_EXECUTING
The job is currently running and is therefore not pending.
Constant Value: -1 (0xffffffff)
PENDING_JOB_REASON_INVALID_JOB_ID
public static final int PENDING_JOB_REASON_INVALID_JOB_ID
The job doesn't exist.
Constant Value: -2 (0xfffffffe)
PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION
public static final int PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION
JobScheduler thinks it can defer this job to a more optimal running time.
Constant Value: 13 (0x0000000d)
PENDING_JOB_REASON_QUOTA
public static final int PENDING_JOB_REASON_QUOTA
The app has consumed all of its current quota.
Constant Value: 14 (0x0000000e)
PENDING_JOB_REASON_UNDEFINED
public static final int PENDING_JOB_REASON_UNDEFINED
There is no known reason why the job is pending. If additional reasons are added on newer Android versions, the system may return this reason to apps whose target SDK is not high enough to expect that reason.
Constant Value: 0 (0x00000000)
PENDING_JOB_REASON_USER
public static final int PENDING_JOB_REASON_USER
JobScheduler is respecting one of the user's actions (eg. force stop or adb shell commands) to defer this job.
Constant Value: 15 (0x0000000f)
RESULT_FAILURE
public static final int RESULT_FAILURE
Returned from [schedule(JobInfo)](/reference/android/app/job/JobScheduler#schedule%28android.app.job.JobInfo%29) if a job wasn't scheduled successfully. Scheduling can fail for a variety of reasons, including, but not limited to:
- an invalid parameter was supplied (eg. the run-time for your job is too short, or the system can't resolve the requisite
[JobService](/reference/android/app/job/JobService)in your package) - the app has too many jobs scheduled
- the app has tried to schedule too many jobs in a short amount of time
Attempting to schedule the job again immediately after receiving this result will not guarantee a successful schedule.
Constant Value: 0 (0x00000000)
RESULT_SUCCESS
public static final int RESULT_SUCCESS
Returned from [schedule(JobInfo)](/reference/android/app/job/JobScheduler#schedule%28android.app.job.JobInfo%29) if this job has been successfully scheduled.
Constant Value: 1 (0x00000001)
Public constructors
JobScheduler
public JobScheduler ()
Public methods
canRunUserInitiatedJobs
public boolean canRunUserInitiatedJobs ()
Returns true if the calling app currently holds the[Manifest.permission.RUN_USER_INITIATED_JOBS](/reference/android/Manifest.permission#RUN%5FUSER%5FINITIATED%5FJOBS) permission, allowing it to run user-initiated jobs.
| Returns |
|---|
| boolean |
cancelAll
public abstract void cancelAll ()
Cancel all jobs that have been scheduled in the current namespace by the calling application.
Starting with Android version [Build.VERSION_CODES.UPSIDE_DOWN_CAKE](/reference/android/os/Build.VERSION%5FCODES#UPSIDE%5FDOWN%5FCAKE), this will only cancel within the current namespace. If a namespace hasn't been explicitly set with [forNamespace(String)](/reference/android/app/job/JobScheduler#forNamespace%28java.lang.String%29), then this will cancel jobs in the default namespace. To cancel all jobs scheduled by the application, use [cancelInAllNamespaces()](/reference/android/app/job/JobScheduler#cancelInAllNamespaces%28%29) instead.
cancelInAllNamespaces
public void cancelInAllNamespaces ()
Cancel all jobs that have been scheduled by the calling application, regardless of namespace.
enqueue
public abstract int enqueue (JobInfo job, JobWorkItem work)
Similar to [schedule(JobInfo)](/reference/android/app/job/JobScheduler#schedule%28android.app.job.JobInfo%29), but allows you to enqueue work for a new or existing job. If a job with the same ID is already scheduled, it will be replaced with the new [JobInfo](/reference/android/app/job/JobInfo), but any previously enqueued work will remain and be dispatched the next time it runs. If a job with the same ID is already running, the new work will be enqueued for it without stopping the job.
The work you enqueue is later retrieved through[JobParameters.dequeueWork](/reference/android/app/job/JobParameters#dequeueWork%28%29). Be sure to see there about how to process work; the act of enqueueing work changes how you should handle the overall lifecycle of an executing job.
It is strongly encouraged that you use the same [JobInfo](/reference/android/app/job/JobInfo) for all work you enqueue. This will allow the system to optimally schedule work along with any pending and/or currently running work. If the JobInfo changes from the last time the job was enqueued, the system will need to update the associated JobInfo, which can cause a disruption in execution. In particular, this can result in any currently running job that is processing previous work to be stopped and restarted with the new JobInfo.
It is recommended that you avoid using[JobInfo.Builder.setExtras(PersistableBundle)](/reference/android/app/job/JobInfo.Builder#setExtras%28android.os.PersistableBundle%29) or[JobInfo.Builder.setTransientExtras(Bundle)](/reference/android/app/job/JobInfo.Builder#setTransientExtras%28android.os.Bundle%29) with a JobInfo you are using to enqueue work. The system will try to compare these extras with the previous JobInfo, but there are situations where it may get this wrong and count the JobInfo as changing. (That said, you should be relatively safe with a simple set of consistent data in these fields.) You should never use [JobInfo.Builder.setClipData(ClipData,int)](/reference/android/app/job/JobInfo.Builder#setClipData%28android.content.ClipData,%20int%29) with work you are enqueuing, since currently this will always be treated as a different JobInfo, even if the ClipData contents are exactly the same.
Note: Scheduling a job can have a high cost, even if it's rescheduling the same job and the job didn't execute, especially on platform versions before version [Build.VERSION_CODES.Q](/reference/android/os/Build.VERSION%5FCODES#Q). As such, the system may throttle calls to this API if calls are made too frequently in a short amount of time.
Note: Prior to Android version[Build.VERSION_CODES.UPSIDE_DOWN_CAKE](/reference/android/os/Build.VERSION%5FCODES#UPSIDE%5FDOWN%5FCAKE), JobWorkItems could not be persisted. Apps were not allowed to enqueue JobWorkItems with persisted jobs and the system would throw an [IllegalArgumentException](/reference/java/lang/IllegalArgumentException) if they attempted to do so. Starting with[Build.VERSION_CODES.UPSIDE_DOWN_CAKE](/reference/android/os/Build.VERSION%5FCODES#UPSIDE%5FDOWN%5FCAKE), JobWorkItems can be persisted alongside the hosting job. However, Intents cannot be persisted. Set a [PersistableBundle](/reference/android/os/PersistableBundle) using[JobWorkItem.Builder.setExtras(PersistableBundle)](/reference/android/app/job/JobWorkItem.Builder#setExtras%28android.os.PersistableBundle%29) for any information that needs to be persisted.
Note: The JobService component needs to be enabled in order to successfully schedule a job.
| Parameters | |
|---|---|
| job | JobInfo: The job you wish to enqueue work for. SeeJobInfo.Builder for more detail on the sorts of jobs you can schedule. This value cannot be null. |
| work | JobWorkItem: New work to enqueue. This will be available later when the job starts running. This value cannot be null. |
| Returns | |
|---|---|
| int | the result of the enqueue request. Value is one of the following: RESULT_FAILURE RESULT_SUCCESS |
| Throws | |
|---|---|
| IllegalArgumentException | if the specified JobService doesn't exist or is disabled. |
forNamespace
public JobScheduler forNamespace (String namespace)
Get a JobScheduler instance that is dedicated to a specific namespace. Any API calls using this instance will interact with jobs in that namespace, unless the API documentation says otherwise. Attempting to update a job scheduled in another namespace will not be possible but will instead create or update the job inside the current namespace. A JobScheduler instance dedicated to a namespace must be used to schedule or update jobs in that namespace.
Since leading and trailing whitespace can lead to hard-to-debug issues, they will be [trimmed](/reference/java/lang/String#trim%28%29). An empty String (after trimming) is not allowed.
| Parameters | |
|---|---|
| namespace | String: This value cannot be null. |
| Returns | |
|---|---|
| JobScheduler | This value cannot be null. |
getAllPendingJobs
public abstract List<JobInfo> getAllPendingJobs ()
Retrieve all jobs that have been scheduled by the calling application.
| Returns | |
|---|---|
| List<JobInfo> | a list of all of the app's scheduled jobs. This includes jobs that are currently started as well as those that are still waiting to run. This value cannot be null. |
getNamespace
public String getNamespace ()
Get the namespace this JobScheduler instance is operating in. A null value means that the app has not specified a namespace for this instance, and it is therefore using the default namespace.
| Returns |
|---|
| String |
getPendingJob
public abstract JobInfo getPendingJob (int jobId)
Look up the description of a scheduled job.
| Parameters | |
|---|---|
| jobId | int |
| Returns | |
|---|---|
| JobInfo | The JobInfo description of the given scheduled job, or null if the supplied job ID does not correspond to any job. |
getPendingJobReasonStats
public Map<Integer, Duration> getPendingJobReasonStats (int jobId)
For the given jobId, returns an aggregated view of why the job has been pending execution over its lifetime. The returned map is composed ofPENDING_JOB_REASON_* constants mapped to a duration representing the total time the job has been pending for that reason.
Note that the sum of these durations will often exceed the total duration the job was waiting, since a job could be pending due to multiple reasons simultaneously.
These pending job reasons represent either explicitly set constraints on the job or implicit constraints imposed by the system due to various reasons. The results can be used to debug which constraints contribute the most to why a given job has been pending execution.
If the returned map is empty, it could indicate that the job was executed immediately and never had to wait for any constraints to be met.
To get a more detailed and historical view of why a job was pending at a certain time, use [getPendingJobReasonsHistory(int)](/reference/android/app/job/JobScheduler#getPendingJobReasonsHistory%28int%29) instead.
Note: The pending job reason stats are not persisted across device reboots. The stats are also cleared when the job successfully completes or is canceled. Apps should query this information when they observe a scheduled job is not executing as expected to understand the reasons for the delay.
| Parameters | |
|---|---|
| jobId | int: The ID of the job to query. |
| Returns | |
|---|---|
| Map<Integer, Duration> | A map of pending reasons to the total duration the job was pending for that reason. This value cannot be null. |
| Throws | |
|---|---|
| IllegalArgumentException | if the jobId does not correspond to a pending job. |
getPendingJobReasonsHistory
public List<PendingJobReasonsInfo> getPendingJobReasonsHistory (int jobId)
For the given jobId, returns a limited historical view of why the job may have been pending execution. The returned list is composed of [PendingJobReasonsInfo](/reference/android/app/job/PendingJobReasonsInfo) objects, each of which include a timestamp since epoch along with an array of unsatisfied constraints represented by PENDING_JOB_REASON_* constants.
These constants could either be explicitly set constraints on the job or implicit constraints imposed by the system due to various reasons. The results can be used to debug why a given job may have been pending execution.
If PENDING_JOB_REASON_UNDEFINED is the only reason for the timestamp, it could mean that the job was ready to be executed at that point in time.
The length of the history returned is truncated so it's recommended to query this API periodically for debugging purposes. To get a holistic view of why the job has been pending, use [getPendingJobReasonStats(int)](/reference/android/app/job/JobScheduler#getPendingJobReasonStats%28int%29).
Note: there is no set interval for the timestamps in the returned list since constraint changes occur based on device status and various other factors.
Note: the pending job reasons history is not persisted across device reboots.
| Parameters | |
|---|---|
| jobId | int |
| Returns | |
|---|---|
| List<PendingJobReasonsInfo> | This value cannot be null. |
| Throws | |
|---|---|
| IllegalArgumentException | if the jobId is invalid. |
getPendingJobsInAllNamespaces
public Map<String, List<JobInfo>> getPendingJobsInAllNamespaces ()
Retrieve all jobs that have been scheduled by the calling application within the current namespace.
| Returns | |
|---|---|
| Map<String, List<JobInfo>> | a list of all of the app's scheduled jobs scheduled with the current namespace. If a namespace hasn't been explicitly set with forNamespace(String), then this will return jobs in the default namespace. This includes jobs that are currently started as well as those that are still waiting to run. This value cannot be null. |
schedule
public abstract int schedule (JobInfo job)
Schedule a job to be executed. Will replace any currently scheduled job with the same ID with the new information in the [JobInfo](/reference/android/app/job/JobInfo). If a job with the given ID is currently running, it will be stopped.
Note: Scheduling a job can have a high cost, even if it's rescheduling the same job and the job didn't execute, especially on platform versions before version [Build.VERSION_CODES.Q](/reference/android/os/Build.VERSION%5FCODES#Q). As such, the system may throttle calls to this API if calls are made too frequently in a short amount of time.
Note: The JobService component needs to be enabled in order to successfully schedule a job.
| Parameters | |
|---|---|
| job | JobInfo: The job you wish scheduled. SeeJobInfo.Builder for more detail on the sorts of jobs you can schedule. This value cannot be null. |
| Returns | |
|---|---|
| int | the result of the schedule request. Value is one of the following: RESULT_FAILURE RESULT_SUCCESS |
| Throws | |
|---|---|
| IllegalArgumentException | if the specified JobService doesn't exist or is disabled. |