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

Commit 0184ce92 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Undo a previous change that's causing multi-user issues

Surgical hack for getting Settings to run multiple instances without
causing other system services/providers from doing the same.

Change-Id: Ic5dab61976a04c3012235299ba55edfcd8273dbb
parent c96ebd85
Loading
Loading
Loading
Loading
+8 −10
Original line number Diff line number Diff line
@@ -1794,16 +1794,14 @@ public final class ActivityManagerService extends ActivityManagerNative
    final ProcessRecord getProcessRecordLocked(
            String processName, int uid) {
        if (uid == Process.SYSTEM_UID) {
            SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(processName);
            if (procs == null) return null;
            int N = procs.size();
            for (int i = 0; i < N; i++) {
                if (UserId.isSameUser(procs.keyAt(i), uid)) {
                    return procs.valueAt(i);
                }
            }
            return null;
        // Temporary hack to make Settings run per user
        if (uid == Process.SYSTEM_UID && !processName.equals("com.android.settings")) {
            // The system gets to run in any process.  If there are multiple
            // processes with the same uid, just pick the first (this
            // should never happen).
            SparseArray<ProcessRecord> procs = mProcessNames.getMap().get(
                    processName);
            return procs != null ? procs.valueAt(0) : null;
        }
        // uid = applyUserId(uid);
        ProcessRecord proc = mProcessNames.get(processName, uid);