diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java index b87dec1e1ed81..f18b11e17322f 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java @@ -434,7 +434,7 @@ public final class ConnectivityController extends RestrictingController implemen final UidStats uidStats = getUidStats(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), true); - if (jobStatus.shouldTreatAsExpeditedJob() && jobStatus.shouldTreatAsUserInitiatedJob()) { + if (jobStatus.shouldTreatAsExpeditedJob() || jobStatus.shouldTreatAsUserInitiatedJob()) { if (!jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY)) { // Don't request a direct hole through any of the firewalls. Instead, mark the // constraint as satisfied if the network is available, and the job will get @@ -444,7 +444,9 @@ public final class ConnectivityController extends RestrictingController implemen } // Don't need to update constraint here if the network goes away. We'll do that as part // of regular processing when we're notified about the drop. - } else if (jobStatus.isRequestedExpeditedJob() + } else if (((jobStatus.isRequestedExpeditedJob() && !jobStatus.shouldTreatAsExpeditedJob()) + || (jobStatus.getJob().isUserInitiated() + && !jobStatus.shouldTreatAsUserInitiatedJob())) && jobStatus.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY)) { // Make sure we don't accidentally keep the constraint as satisfied if the job went // from being expedited-ready to not-expeditable.