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

Commit b98e968b authored by Christian Wailes's avatar Christian Wailes Committed by Android (Google) Code Review
Browse files

Merge "Change USAP name to application name as soon as possible." into qt-dev-plus-aosp

parents d99d8d79 c170754b
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -549,6 +549,8 @@ public final class Zygote {
            }
        }

        setAppProcessName(args, "USAP");

        applyUidSecurityPolicy(args, peerCredentials);
        applyDebuggerSystemProperty(args);

@@ -612,10 +614,6 @@ public final class Zygote {

        disableExecuteOnly(args.mTargetSdkVersion);

        if (args.mNiceName != null) {
            Process.setArgV0(args.mNiceName);
        }

        // End of the postFork event.
        Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);

@@ -624,6 +622,16 @@ public final class Zygote {
                                     null /* classLoader */);
    }

    static void setAppProcessName(ZygoteArguments args, String loggingTag) {
        if (args.mNiceName != null) {
            Process.setArgV0(args.mNiceName);
        } else if (args.mPackageName != null) {
            Process.setArgV0(args.mPackageName);
        } else {
            Log.w(loggingTag, "Unable to set package name.");
        }
    }

    private static final String USAP_ERROR_PREFIX = "Invalid command to USAP: ";

    /**
+1 −3
Original line number Diff line number Diff line
@@ -468,9 +468,7 @@ class ZygoteConnection {

        closeSocket();

        if (parsedArgs.mNiceName != null) {
            Process.setArgV0(parsedArgs.mNiceName);
        }
        Zygote.setAppProcessName(parsedArgs, TAG);

        // End of the postFork event.
        Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);