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
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 143f77d..bbaebd9 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -1794,16 +1794,14 @@
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);