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

Commit 93defea5 authored by Christopher Tate's avatar Christopher Tate
Browse files

Disambiguate apps that share uid for job/bucket purposes

Specifically, we no longer update our cached standby state bookkeeping for
*all* apps under that uid when a standby policy change notification comes
in.  We weren't properly handling shared uids; and now we are.

Change-Id: I4bda6233ebeff259cc63bdb8a4febbc83f2e1043
Fixes: 73663980
Test: atest CtsJobSchedulerTestCases
parent 41ed367a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -2261,7 +2261,12 @@ public final class JobSchedulerService extends com.android.server.SystemService
                    Slog.i(TAG, "Moving uid " + uid + " to bucketIndex " + bucketIndex);
                }
                synchronized (mLock) {
                    mJobs.forEachJobForSourceUid(uid, job -> job.setStandbyBucket(bucketIndex));
                    mJobs.forEachJobForSourceUid(uid, job -> {
                        // double-check uid vs package name to disambiguate shared uids
                        if (packageName.equals(job.getSourcePackageName())) {
                            job.setStandbyBucket(bucketIndex);
                        }
                    });
                    onControllerStateChanged();
                }
            });