Loading core/java/android/os/ZygoteProcess.java +25 −0 Original line number Diff line number Diff line Loading @@ -741,6 +741,31 @@ public class ZygoteProcess { } } /** * Notify the Zygote processes that boot completed. */ public void bootCompleted() { // Notify both the 32-bit and 64-bit zygote. if (Build.SUPPORTED_32_BIT_ABIS.length > 0) { bootCompleted(Build.SUPPORTED_32_BIT_ABIS[0]); } if (Build.SUPPORTED_64_BIT_ABIS.length > 0) { bootCompleted(Build.SUPPORTED_64_BIT_ABIS[0]); } } private void bootCompleted(String abi) { try { synchronized (mLock) { ZygoteState state = openZygoteSocketIfNeeded(abi); state.mZygoteOutputWriter.write("1\n--boot-completed\n"); state.mZygoteOutputWriter.flush(); } } catch (Exception ex) { throw new RuntimeException("Failed to inform zygote of boot_completed", ex); } } /** * Push hidden API blacklisting exemptions into the zygote process(es). * Loading core/java/com/android/internal/os/ZygoteArguments.java +12 −1 Original line number Diff line number Diff line Loading @@ -186,6 +186,11 @@ class ZygoteArguments { */ boolean mPidQuery; /** * Whether the current arguments constitute a notification that boot completed. */ boolean mBootCompleted; /** * Exemptions from API blacklisting. These are sent to the pre-forked zygote at boot time, or * when they change, via --set-api-blacklist-exemptions. Loading Loading @@ -360,6 +365,8 @@ class ZygoteArguments { mAbiListQuery = true; } else if (arg.equals("--get-pid")) { mPidQuery = true; } else if (arg.equals("--boot-completed")) { mBootCompleted = true; } else if (arg.startsWith("--instruction-set=")) { mInstructionSet = arg.substring(arg.indexOf('=') + 1); } else if (arg.startsWith("--app-data-dir=")) { Loading Loading @@ -414,7 +421,11 @@ class ZygoteArguments { } } if (mAbiListQuery || mPidQuery) { if (mBootCompleted) { if (args.length - curArg > 0) { throw new IllegalArgumentException("Unexpected arguments after --boot-completed"); } } else if (mAbiListQuery || mPidQuery) { if (args.length - curArg > 0) { throw new IllegalArgumentException("Unexpected arguments after --query-abi-list."); } Loading core/java/com/android/internal/os/ZygoteConnection.java +9 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,11 @@ class ZygoteConnection { ZygoteArguments parsedArgs = new ZygoteArguments(args); if (parsedArgs.mBootCompleted) { handleBootCompleted(); return null; } if (parsedArgs.mAbiListQuery) { handleAbiListQuery(); return null; Loading Loading @@ -299,6 +304,10 @@ class ZygoteConnection { } } private void handleBootCompleted() { VMRuntime.bootCompleted(); } /** * Preloads resources if the zygote is in lazily preload mode. Writes the result of the * preload operation; {@code 0} when a preload was initiated due to this request and {@code 1} Loading services/core/java/com/android/server/am/ActivityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -5225,6 +5225,10 @@ public class ActivityManagerService extends IActivityManager.Stub } } // Let the ART runtime in zygote and system_server know that the boot completed. ZYGOTE_PROCESS.bootCompleted(); VMRuntime.bootCompleted(); IntentFilter pkgFilter = new IntentFilter(); pkgFilter.addAction(Intent.ACTION_QUERY_PACKAGE_RESTART); pkgFilter.addDataScheme("package"); Loading Loading
core/java/android/os/ZygoteProcess.java +25 −0 Original line number Diff line number Diff line Loading @@ -741,6 +741,31 @@ public class ZygoteProcess { } } /** * Notify the Zygote processes that boot completed. */ public void bootCompleted() { // Notify both the 32-bit and 64-bit zygote. if (Build.SUPPORTED_32_BIT_ABIS.length > 0) { bootCompleted(Build.SUPPORTED_32_BIT_ABIS[0]); } if (Build.SUPPORTED_64_BIT_ABIS.length > 0) { bootCompleted(Build.SUPPORTED_64_BIT_ABIS[0]); } } private void bootCompleted(String abi) { try { synchronized (mLock) { ZygoteState state = openZygoteSocketIfNeeded(abi); state.mZygoteOutputWriter.write("1\n--boot-completed\n"); state.mZygoteOutputWriter.flush(); } } catch (Exception ex) { throw new RuntimeException("Failed to inform zygote of boot_completed", ex); } } /** * Push hidden API blacklisting exemptions into the zygote process(es). * Loading
core/java/com/android/internal/os/ZygoteArguments.java +12 −1 Original line number Diff line number Diff line Loading @@ -186,6 +186,11 @@ class ZygoteArguments { */ boolean mPidQuery; /** * Whether the current arguments constitute a notification that boot completed. */ boolean mBootCompleted; /** * Exemptions from API blacklisting. These are sent to the pre-forked zygote at boot time, or * when they change, via --set-api-blacklist-exemptions. Loading Loading @@ -360,6 +365,8 @@ class ZygoteArguments { mAbiListQuery = true; } else if (arg.equals("--get-pid")) { mPidQuery = true; } else if (arg.equals("--boot-completed")) { mBootCompleted = true; } else if (arg.startsWith("--instruction-set=")) { mInstructionSet = arg.substring(arg.indexOf('=') + 1); } else if (arg.startsWith("--app-data-dir=")) { Loading Loading @@ -414,7 +421,11 @@ class ZygoteArguments { } } if (mAbiListQuery || mPidQuery) { if (mBootCompleted) { if (args.length - curArg > 0) { throw new IllegalArgumentException("Unexpected arguments after --boot-completed"); } } else if (mAbiListQuery || mPidQuery) { if (args.length - curArg > 0) { throw new IllegalArgumentException("Unexpected arguments after --query-abi-list."); } Loading
core/java/com/android/internal/os/ZygoteConnection.java +9 −0 Original line number Diff line number Diff line Loading @@ -140,6 +140,11 @@ class ZygoteConnection { ZygoteArguments parsedArgs = new ZygoteArguments(args); if (parsedArgs.mBootCompleted) { handleBootCompleted(); return null; } if (parsedArgs.mAbiListQuery) { handleAbiListQuery(); return null; Loading Loading @@ -299,6 +304,10 @@ class ZygoteConnection { } } private void handleBootCompleted() { VMRuntime.bootCompleted(); } /** * Preloads resources if the zygote is in lazily preload mode. Writes the result of the * preload operation; {@code 0} when a preload was initiated due to this request and {@code 1} Loading
services/core/java/com/android/server/am/ActivityManagerService.java +4 −0 Original line number Diff line number Diff line Loading @@ -5225,6 +5225,10 @@ public class ActivityManagerService extends IActivityManager.Stub } } // Let the ART runtime in zygote and system_server know that the boot completed. ZYGOTE_PROCESS.bootCompleted(); VMRuntime.bootCompleted(); IntentFilter pkgFilter = new IntentFilter(); pkgFilter.addAction(Intent.ACTION_QUERY_PACKAGE_RESTART); pkgFilter.addDataScheme("package"); Loading