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

Commit 8e373192 authored by Christopher Ferris's avatar Christopher Ferris Committed by Android (Google) Code Review
Browse files

Merge "Clean-up places that try to read wrap property."

parents 07de4cf8 2d030bc4
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -505,9 +505,7 @@ public class ZygoteProcess {
            }
            if (flag.startsWith("--nice-name=")) {
                // Check if the wrap property is set, usap would ignore it.
                String niceName = flag.substring(12);
                String property_value = SystemProperties.get("wrap." + niceName);
                if (property_value != null && property_value.length() != 0) {
                if (Zygote.getWrapProperty(flag.substring(12)) != null) {
                    return false;
                }
            }
+21 −6
Original line number Diff line number Diff line
@@ -831,18 +831,33 @@ public final class Zygote {
        }
    }

    /**
     * Gets the wrap property if set.
     *
     * @param appName the application name to check
     * @return value of wrap property or null if property not set or
     * null if app_name is null or null if app_name is empty
     */
    public static String getWrapProperty(String appName) {
        if (appName == null || appName.isEmpty()) {
            return null;
        }

        String propertyValue = SystemProperties.get("wrap." + appName);
        if (propertyValue != null && !propertyValue.isEmpty()) {
            return propertyValue;
        }
        return null;
    }

    /**
     * Applies invoke-with system properties to the zygote arguments.
     *
     * @param args non-null; zygote args
     */
    static void applyInvokeWithSystemProperty(ZygoteArguments args) {
        if (args.mInvokeWith == null && args.mNiceName != null) {
            String property = "wrap." + args.mNiceName;
            args.mInvokeWith = SystemProperties.get(property);
            if (args.mInvokeWith != null && args.mInvokeWith.length() == 0) {
                args.mInvokeWith = null;
            }
        if (args.mInvokeWith == null) {
            args.mInvokeWith = getWrapProperty(args.mNiceName);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -1657,7 +1657,7 @@ public final class ProcessList {
        final long startSeq = app.startSeq = ++mProcStartSeqCounter;
        app.setStartParams(uid, hostingRecord, seInfo, startTime);
        app.setUsingWrapper(invokeWith != null
                || SystemProperties.get("wrap." + app.processName) != null);
                || Zygote.getWrapProperty(app.processName) != null);
        mPendingStarts.put(startSeq, app);

        if (mService.mConstants.FLAG_PROCESS_START_ASYNC) {