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

Commit 41f3fe80 authored by Christopher Tate's avatar Christopher Tate
Browse files

Fix system crash in certain jobs-removed cases

Null happens.  Check for it before calling size().

Fixes: 69630116
Test: atest CtsJobSchedulerTestCases

Change-Id: I17ec206946a6a21ff459e2e031cface5499f5264
parent 392a9a2d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1149,11 +1149,13 @@ public final class JobStore {
        public void forEachJob(JobStatusFunctor functor) {
            for (int uidIndex = mJobs.size() - 1; uidIndex >= 0; uidIndex--) {
                ArraySet<JobStatus> jobs = mJobs.valueAt(uidIndex);
                if (jobs != null) {
                    for (int i = jobs.size() - 1; i >= 0; i--) {
                        functor.process(jobs.valueAt(i));
                    }
                }
            }
        }

        public void forEachJob(int callingUid, JobStatusFunctor functor) {
            ArraySet<JobStatus> jobs = mJobs.get(callingUid);