summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Suren Baghdasaryan <surenb@google.com> 2023-04-17 20:43:22 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-04-17 20:43:22 +0000
commit1774ccf39762aabc2db8e186dfbe95f5e517e365 (patch)
treef2350e51ae3cfaa7d11b8084de1bd016d2027d5c
parentf4abf28623e3fd9bb8250118d8b36c7b06040fc9 (diff)
parent0012e8b83a53c0328c0dfafdfbd6751a2192b930 (diff)
Merge "Do not crash webview if its group creation fails due to a dead process"
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index 6c7803be842b..d0607d567900 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -105,6 +105,7 @@ import android.os.Trace;
import android.os.UserHandle;
import android.os.storage.StorageManagerInternal;
import android.system.Os;
+import android.system.OsConstants;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -2328,9 +2329,15 @@ public final class ProcessList {
if (!regularZygote) {
// webview and app zygote don't have the permission to create the nodes
- if (Process.createProcessGroup(uid, startResult.pid) < 0) {
- throw new AssertionError("Unable to create process group for " + app.processName
- + " (" + startResult.pid + ")");
+ final int res = Process.createProcessGroup(uid, startResult.pid);
+ if (res < 0) {
+ if (res == -OsConstants.ESRCH) {
+ Slog.e(ActivityManagerService.TAG, "Unable to create process group for "
+ + app.processName + " (" + startResult.pid + ")");
+ } else {
+ throw new AssertionError("Unable to create process group for "
+ + app.processName + " (" + startResult.pid + ")");
+ }
}
}