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

Commit b0a2a0a8 authored by Suren Baghdasaryan's avatar Suren Baghdasaryan Committed by Automerger Merge Worker
Browse files

Merge "Do not crash webview if its group creation fails due to a dead process"...

Merge "Do not crash webview if its group creation fails due to a dead process" am: 1774ccf3 am: 16e6563f am: 431d59fb am: f9722e1b am: 95964219

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2521297



Change-Id: Icb16f3fc82ddad0cd5c6c62d53dbd37f104583ae
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9c32ccbd 95964219
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -108,6 +108,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;
@@ -2331,9 +2332,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 + ")");
                    }
                }
            }