From 9ae3dbeefcd6bc139c74bfe3d51de823e3be4b4b Mon Sep 17 00:00:00 2001 From: Matthew Williams Date: Thu, 21 Aug 2014 13:47:47 -0700 Subject: JobScheduler only run jobs for started users. BUG: 12876556 Minor changes to test app to make persisting an option. Change-Id: I1b40347878ec5ca44cd717ebfeb544f6c58473b5 --- core/java/android/app/job/JobInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/java/android/app/job') diff --git a/core/java/android/app/job/JobInfo.java b/core/java/android/app/job/JobInfo.java index b7af544..e4ed470e 100644 --- a/core/java/android/app/job/JobInfo.java +++ b/core/java/android/app/job/JobInfo.java @@ -26,6 +26,9 @@ import android.os.PersistableBundle; * Container of data passed to the {@link android.app.job.JobScheduler} fully encapsulating the * parameters required to schedule work against the calling application. These are constructed * using the {@link 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. */ public class JobInfo implements Parcelable { public interface NetworkType { @@ -434,7 +437,7 @@ public class JobInfo implements Parcelable { * @return The job object to hand to the JobScheduler. This object is immutable. */ public JobInfo build() { - // Allow tasks with no constraints. What am I, a database? + // Allow jobs with no constraints - What am I, a database? if (!mHasEarlyConstraint && !mHasLateConstraint && !mRequiresCharging && !mRequiresDeviceIdle && mNetworkCapabilities == NetworkType.NONE) { throw new IllegalArgumentException("You're trying to build a job with no " + -- cgit v1.1