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

Commit 58069635 authored by Robert Sesek's avatar Robert Sesek Committed by android-build-merger
Browse files

Merge "Add new hostingType for startProcessLocked() that selects using the...

Merge "Add new hostingType for startProcessLocked() that selects using the WebViewZygote." am: eda1af61
am: bbcd9d26

Change-Id: I7b7fbf2cc65712bd748a577c2eee1c0a1e35efee
parents 7ef7e186 bbcd9d26
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ public class WebViewZygote {
        return sPackage.packageName;
    }

    public static boolean isMultiprocessEnabled() {
        return sMultiprocessEnabled && sPackage != null;
    }

    public static void setMultiprocessEnabled(boolean enabled) {
        sMultiprocessEnabled = enabled;

+7 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ import android.util.EventLog;
import android.util.Slog;
import android.util.SparseArray;
import android.util.TimeUtils;
import android.webkit.WebViewZygote;

public final class ActiveServices {
    private static final String TAG = TAG_WITH_CLASS_NAME ? "ActiveServices" : TAG_AM;
@@ -1708,6 +1709,7 @@ public final class ActiveServices {

        final boolean isolated = (r.serviceInfo.flags&ServiceInfo.FLAG_ISOLATED_PROCESS) != 0;
        final String procName = r.processName;
        String hostingType = "service";
        ProcessRecord app;

        if (!isolated) {
@@ -1736,13 +1738,17 @@ public final class ActiveServices {
            // in the service any current isolated process it is running in or
            // waiting to have come up.
            app = r.isolatedProc;
            if (WebViewZygote.isMultiprocessEnabled()
                    && r.serviceInfo.packageName.equals(WebViewZygote.getPackageName())) {
                hostingType = "webview_service";
            }
        }

        // Not running -- get it started, and enqueue this service record
        // to be executed when the app comes up.
        if (app == null && !permissionsReviewRequired) {
            if ((app=mAm.startProcessLocked(procName, r.appInfo, true, intentFlags,
                    "service", r.name, false, isolated, false)) == null) {
                    hostingType, r.name, false, isolated, false)) == null) {
                String msg = "Unable to launch app "
                        + r.appInfo.packageName + "/"
                        + r.appInfo.uid + " for service "
+12 −4
Original line number Diff line number Diff line
@@ -3800,10 +3800,18 @@ public final class ActivityManagerService extends ActivityManagerNative
            Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "Start proc: " +
                    app.processName);
            checkTime(startTime, "startProcess: asking zygote to start proc");
            Process.ProcessStartResult startResult = Process.start(entryPoint,
            Process.ProcessStartResult startResult;
            if (hostingType.equals("webview_service")) {
                startResult = Process.startWebView(entryPoint,
                        app.processName, uid, uid, gids, debugFlags, mountExternal,
                        app.info.targetSdkVersion, app.info.seinfo, requiredAbi, instructionSet,
                        app.info.dataDir, entryPointArgs);
            } else {
                startResult = Process.start(entryPoint,
                        app.processName, uid, uid, gids, debugFlags, mountExternal,
                        app.info.targetSdkVersion, app.info.seinfo, requiredAbi, instructionSet,
                        app.info.dataDir, entryPointArgs);
            }
            checkTime(startTime, "startProcess: returned from zygote!");
            Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);