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

Commit b375d3c7 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Mimic Zygote preload steps when using wrappers."

parents f2751aae 0c2313dc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ public class WrapperInit {
     */
    public static void main(String[] args) {
        try {
            // Tell the Zygote what our actual PID is (since it only knows about the
            // wrapper that it directly forked).
            int fdNum = Integer.parseInt(args[0], 10);
            if (fdNum != 0) {
                try {
@@ -67,6 +69,10 @@ public class WrapperInit {
                }
            }

            // Mimic Zygote preloading.
            ZygoteInit.preload();

            // Launch the application.
            String[] runtimeArgs = new String[args.length - 1];
            System.arraycopy(args, 1, runtimeArgs, 0, runtimeArgs.length);
            RuntimeInit.wrapperInit(runtimeArgs);
+6 −2
Original line number Diff line number Diff line
@@ -228,6 +228,11 @@ public class ZygoteInit {
        }
    }

    static void preload() {
        preloadClasses();
        preloadResources();
    }

    /**
     * Performs Zygote process initialization. Loads and initializes
     * commonly used classes.
@@ -509,8 +514,7 @@ public class ZygoteInit {
            registerZygoteSocket();
            EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_START,
                SystemClock.uptimeMillis());
            preloadClasses();
            preloadResources();
            preload();
            EventLog.writeEvent(LOG_BOOT_PROGRESS_PRELOAD_END,
                SystemClock.uptimeMillis());