Android APIs
public class

JobInfo

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.job.JobInfo

Class Overview

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.

Summary

Nested Classes
interface JobInfo.BackoffPolicy Linear: retry_time(failure_time, t) = failure_time + initial_retry_delay * t, t >= 1 Expon: retry_time(failure_time, t) = failure_time + initial_retry_delay ^ t, t >= 1  
class JobInfo.Builder Builder class for constructing JobInfo objects. 
interface JobInfo.NetworkType  
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<JobInfo> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
int getBackoffPolicy()
See JobInfo.BackoffPolicy for an explanation of the values this field can take.
PersistableBundle getExtras()
Bundle of extras which are returned to your application at execution time.
int getId()
Unique job id associated with this class.
long getInitialBackoffMillis()
The amount of time the JobScheduler will wait before rescheduling a failed job.
long getIntervalMillis()
Set to the interval between occurrences of this job.
long getMaxExecutionDelayMillis()
long getMinLatencyMillis()
Set for a job that does not recur periodically, to specify a delay after which the job will be eligible for execution.
int getNetworkCapabilities()
See JobInfo.NetworkType for a description of this value.
ComponentName getService()
Name of the service endpoint that will be called back into by the JobScheduler.
boolean isPeriodic()
Track whether this job will repeat with a given period.
boolean isRequireCharging()
Whether this job needs the device to be plugged in.
boolean isRequireDeviceIdle()
Whether this job needs the device to be in an Idle maintenance window.
void writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<JobInfo> CREATOR

Public Methods

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public int getBackoffPolicy ()

See JobInfo.BackoffPolicy for an explanation of the values this field can take. This defaults to exponential.

public PersistableBundle getExtras ()

Bundle of extras which are returned to your application at execution time.

public int getId ()

Unique job id associated with this class. This is assigned to your job by the scheduler.

public long getInitialBackoffMillis ()

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.

public long getIntervalMillis ()

Set to the interval between occurrences of this job. This value is not set if the job does not recur periodically.

public long getMaxExecutionDelayMillis ()

See setOverrideDeadline(long). This value is not set if the job recurs periodically.

public long getMinLatencyMillis ()

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.

public int getNetworkCapabilities ()

See JobInfo.NetworkType for a description of this value.

public ComponentName getService ()

Name of the service endpoint that will be called back into by the JobScheduler.

public boolean isPeriodic ()

Track whether this job will repeat with a given period.

public boolean isRequireCharging ()

Whether this job needs the device to be plugged in.

public boolean isRequireDeviceIdle ()

Whether this job needs the device to be in an Idle maintenance window.

public void writeToParcel (Parcel out, int flags)

Flatten this object in to a Parcel.

Parameters
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.