java.lang.Object | |
↳ | android.app.job.JobInfo |
Container of data passed to the JobScheduler
fully encapsulating the
parameters required to schedule work against the calling application. These are constructed
using the JobInfo.Builder
.
You must specify at least one sort of constraint on the JobInfo object that you are creating.
The goal here is to provide the scheduler with high-level semantics about the work you want to
accomplish. Doing otherwise with throw an exception in your app.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
JobInfo.Builder |
Builder class for constructing JobInfo objects.
|
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | BACKOFF_POLICY_EXPONENTIAL | Exponentially back-off a failed job. | |||||||||
int | BACKOFF_POLICY_LINEAR | Linearly back-off a failed job. | |||||||||
long | DEFAULT_INITIAL_BACKOFF_MILLIS | Amount of backoff a job has initially by default, in milliseconds. | |||||||||
long | MAX_BACKOFF_DELAY_MILLIS | Maximum backoff we allow for a job, in milliseconds. | |||||||||
int | NETWORK_TYPE_ANY | This job requires network connectivity. | |||||||||
int | NETWORK_TYPE_NONE | Default. | |||||||||
int | NETWORK_TYPE_UNMETERED | This job requires network connectivity that is unmetered. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
One of either
BACKOFF_POLICY_EXPONENTIAL , or
BACKOFF_POLICY_LINEAR , depending on which criteria you set
when creating this job.
| |||||||||||
Bundle of extras which are returned to your application at execution time.
| |||||||||||
Unique job id associated with this class.
| |||||||||||
The amount of time the JobScheduler will wait before rescheduling a failed job.
| |||||||||||
Set to the interval between occurrences of this job.
| |||||||||||
Set for a job that does not recur periodically, to specify a delay after which the job
will be eligible for execution.
| |||||||||||
Name of the service endpoint that will be called back into by the JobScheduler.
| |||||||||||
Track whether this job will repeat with a given period.
| |||||||||||
Whether this job needs the device to be plugged in.
| |||||||||||
Whether this job needs the device to be in an Idle maintenance window.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Exponentially back-off a failed job. See
setBackoffCriteria(long, int)
retry_time(current_time, num_failures) =
current_time + initial_backoff_millis * 2 ^ (num_failures - 1), num_failures >= 1
Linearly back-off a failed job. See
setBackoffCriteria(long, int)
retry_time(current_time, num_failures) =
current_time + initial_backoff_millis * num_failures, num_failures >= 1
Amount of backoff a job has initially by default, in milliseconds.
Maximum backoff we allow for a job, in milliseconds.
This job requires network connectivity.
Default.
This job requires network connectivity that is unmetered.
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
One of either BACKOFF_POLICY_EXPONENTIAL
, or
BACKOFF_POLICY_LINEAR
, depending on which criteria you set
when creating this job.
Bundle of extras which are returned to your application at execution time.
Unique job id associated with this class. This is assigned to your job by the scheduler.
The amount of time the JobScheduler will wait before rescheduling a failed job. This value will be increased depending on the backoff policy specified at job creation time. Defaults to 5 seconds.
Set to the interval between occurrences of this job. This value is not set if the job does not recur periodically.
See setOverrideDeadline(long)
. This value is not set if the job recurs
periodically.
Set for a job that does not recur periodically, to specify a delay after which the job will be eligible for execution. This value is not set if the job recurs periodically.
One of NETWORK_TYPE_ANY
,
NETWORK_TYPE_NONE
, or
NETWORK_TYPE_UNMETERED
.
Name of the service endpoint that will be called back into by the JobScheduler.
Track whether this job will repeat with a given period.
Whether this job needs the device to be plugged in.
Whether this job needs the device to be in an Idle maintenance window.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
out | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|