Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac62fe4d authored by Kweku Adams's avatar Kweku Adams
Browse files

Allowing Jobs with no constraints.

Is JobScheduler a database now? Yes, yes it is.

The decision to now allow jobs with no constraints was made before
background restrictions were introduced. Now, with background restrictions,
it doesn't make as much as sense to have this policy.

Bug: 118636037
Test: Try to schedule a job with no constraints
Change-Id: Idfda95b415ae094a1ca5373f950b4a09c685b64f
parent 9b882d88
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -1534,13 +1534,6 @@ public class JobInfo implements Parcelable {
         * @return The job object to hand to the JobScheduler. This object is immutable.
         */
        public JobInfo build() {
            // Allow jobs with no constraints - What am I, a database?
            if (!mHasEarlyConstraint && !mHasLateConstraint && mConstraintFlags == 0 &&
                    mNetworkRequest == null &&
                    mTriggerContentUris == null) {
                throw new IllegalArgumentException("You're trying to build a job with no " +
                        "constraints, this is not allowed.");
            }
            // Check that network estimates require network type
            if ((mNetworkDownloadBytes > 0 || mNetworkUploadBytes > 0) && mNetworkRequest == null) {
                throw new IllegalArgumentException(