Fields Summary |
---|
public static final int | NETWORK_TYPE_NONEDefault. |
public static final int | NETWORK_TYPE_ANYThis job requires network connectivity. |
public static final int | NETWORK_TYPE_UNMETEREDThis job requires network connectivity that is unmetered. |
public static final long | DEFAULT_INITIAL_BACKOFF_MILLISAmount of backoff a job has initially by default, in milliseconds. |
public static final long | MAX_BACKOFF_DELAY_MILLISMaximum backoff we allow for a job, in milliseconds. |
public static final int | BACKOFF_POLICY_LINEARLinearly back-off a failed job. See
{@link android.app.job.JobInfo.Builder#setBackoffCriteria(long, int)}
retry_time(current_time, num_failures) =
current_time + initial_backoff_millis * num_failures, num_failures >= 1 |
public static final int | BACKOFF_POLICY_EXPONENTIALExponentially back-off a failed job. See
{@link android.app.job.JobInfo.Builder#setBackoffCriteria(long, int)}
retry_time(current_time, num_failures) =
current_time + initial_backoff_millis * 2 ^ (num_failures - 1), num_failures >= 1 |
public static final int | DEFAULT_BACKOFF_POLICYDefault type of backoff. |
private final int | jobId |
private final android.os.PersistableBundle | extras |
private final android.content.ComponentName | service |
private final boolean | requireCharging |
private final boolean | requireDeviceIdle |
private final boolean | hasEarlyConstraint |
private final boolean | hasLateConstraint |
private final int | networkType |
private final long | minLatencyMillis |
private final long | maxExecutionDelayMillis |
private final boolean | isPeriodic |
private final boolean | isPersisted |
private final long | intervalMillis |
private final long | initialBackoffMillis |
private final int | backoffPolicy |
public static final Creator | CREATOR |
Methods Summary |
---|
public int | describeContents()
return 0;
|
public int | getBackoffPolicy()One of either {@link android.app.job.JobInfo#BACKOFF_POLICY_EXPONENTIAL}, or
{@link android.app.job.JobInfo#BACKOFF_POLICY_LINEAR}, depending on which criteria you set
when creating this job.
return backoffPolicy;
|
public android.os.PersistableBundle | getExtras()Bundle of extras which are returned to your application at execution time.
return extras;
|
public int | getId()Unique job id associated with this class. This is assigned to your job by the scheduler.
return jobId;
|
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.
return initialBackoffMillis;
|
public long | getIntervalMillis()Set to the interval between occurrences of this job. This value is not set if the
job does not recur periodically.
return intervalMillis;
|
public long | getMaxExecutionDelayMillis()See {@link Builder#setOverrideDeadline(long)}. This value is not set if the job recurs
periodically.
return maxExecutionDelayMillis;
|
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.
return minLatencyMillis;
|
public int | getNetworkType()One of {@link android.app.job.JobInfo#NETWORK_TYPE_ANY},
{@link android.app.job.JobInfo#NETWORK_TYPE_NONE}, or
{@link android.app.job.JobInfo#NETWORK_TYPE_UNMETERED}.
return networkType;
|
public android.content.ComponentName | getService()Name of the service endpoint that will be called back into by the JobScheduler.
return service;
|
public boolean | hasEarlyConstraint()User can specify an early constraint of 0L, which is valid, so we keep track of whether the
function was called at all.
return hasEarlyConstraint;
|
public boolean | hasLateConstraint()User can specify a late constraint of 0L, which is valid, so we keep track of whether the
function was called at all.
return hasLateConstraint;
|
public boolean | isPeriodic()Track whether this job will repeat with a given period.
return isPeriodic;
|
public boolean | isPersisted()
return isPersisted;
|
public boolean | isRequireCharging()Whether this job needs the device to be plugged in.
return requireCharging;
|
public boolean | isRequireDeviceIdle()Whether this job needs the device to be in an Idle maintenance window.
return requireDeviceIdle;
|
public java.lang.String | toString()
return "(job:" + jobId + "/" + service.flattenToShortString() + ")";
|
public void | writeToParcel(android.os.Parcel out, int flags)
out.writeInt(jobId);
out.writePersistableBundle(extras);
out.writeParcelable(service, flags);
out.writeInt(requireCharging ? 1 : 0);
out.writeInt(requireDeviceIdle ? 1 : 0);
out.writeInt(networkType);
out.writeLong(minLatencyMillis);
out.writeLong(maxExecutionDelayMillis);
out.writeInt(isPeriodic ? 1 : 0);
out.writeInt(isPersisted ? 1 : 0);
out.writeLong(intervalMillis);
out.writeLong(initialBackoffMillis);
out.writeInt(backoffPolicy);
out.writeInt(hasEarlyConstraint ? 1 : 0);
out.writeInt(hasLateConstraint ? 1 : 0);
|