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

Commit 90bf48b3 authored by Kweku Adams's avatar Kweku Adams
Browse files

Make sure user-initiated jobs can run in Doze & Battery Saver.

Bug: 261999509
Test: N/A
Change-Id: I2a23324caa79f1fbd7efc55c20c6a7425b5537c7
parent 99998391
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1382,12 +1382,14 @@ public final class JobStatus {
        return appHasDozeExemption
                || (getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0
                || ((shouldTreatAsExpeditedJob() || startedAsExpeditedJob)
                || shouldTreatAsUserInitiated()
                && (mDynamicConstraints & CONSTRAINT_DEVICE_NOT_DOZING) == 0);
    }

    boolean canRunInBatterySaver() {
        return (getInternalFlags() & INTERNAL_FLAG_HAS_FOREGROUND_EXEMPTION) != 0
                || ((shouldTreatAsExpeditedJob() || startedAsExpeditedJob)
                || shouldTreatAsUserInitiated()
                && (mDynamicConstraints & CONSTRAINT_BACKGROUND_NOT_RESTRICTED) == 0);
    }