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

Commit 655b08c3 authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android Git Automerger
Browse files

am b6f87997: am f54d1722: am 52034328: am 131e6b24: Merge "Prevent system uid...

am b6f87997: am f54d1722: am 52034328: am 131e6b24: Merge "Prevent system uid component from running in an app process" into lmp-mr1-dev

* commit 'b6f87997':
  Prevent system uid component from running in an app process
parents aabc9869 b6f87997
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2720,9 +2720,14 @@ public final class ActivityManagerService extends ActivityManagerNative
            // should never happen).
            SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(processName);
            if (procs == null) return null;
            final int N = procs.size();
            for (int i = 0; i < N; i++) {
                if (UserHandle.isSameUser(procs.keyAt(i), uid)) return procs.valueAt(i);
            final int procCount = procs.size();
            for (int i = 0; i < procCount; i++) {
                final int procUid = procs.keyAt(i);
                if (UserHandle.isApp(procUid) || !UserHandle.isSameUser(procUid, uid)) {
                    // Don't use an app process or different user process for system component.
                    continue;
                }
                return procs.valueAt(i);
            }
        }
        ProcessRecord proc = mProcessNames.get(processName, uid);