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

Commit 4468da45 authored by Kweku Adams's avatar Kweku Adams
Browse files

Fix conditionals.

Fix conditionals so the code operates on both expedited and
user-initiated jobs, not the impossible union of expedited
user-initiated jobs.

Bug: 261999509
Test: atest ConnectivityControllerTest
Change-Id: I04cbf23475a2f25eb84853c35138ce483e5de5ba
parent 4640ce9e
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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.