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

Commit 0c2313dc authored by Jeff Brown's avatar Jeff Brown
Browse files

Mimic Zygote preload steps when using wrappers.

Change-Id: I45f182a952920f328d092e5ac86fc0f1c35eb6c1
parent eaf7ce60
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());