Loading core/java/android/os/Process.java +38 −36 Original line number Diff line number Diff line Loading @@ -512,18 +512,19 @@ public class Process { * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * @param packagesForUid null-ok all the packages with the same uid as this process. * @param zygoteArgs Additional arguments to supply to the zygote process. * @param useSystemGraphicsDriver whether the process uses system graphics driver. * * @param zygoteArgs Additional arguments to supply to the zygote process. * @return An object that describes the result of the attempt to start the process. * @throws RuntimeException on fatal start failure * * {@hide} */ public static final ProcessStartResult start(@NonNull final String processClass, public static ProcessStartResult start(@NonNull final String processClass, @Nullable final String niceName, int uid, int gid, @Nullable int[] gids, int runtimeFlags, int mountExternal, int runtimeFlags, int mountExternal, int targetSdkVersion, @Nullable String seInfo, @NonNull String abi, Loading @@ -533,20 +534,21 @@ public class Process { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ true, zygoteArgs, useSystemGraphicsDriver); packagesForUid, sandboxId, /*useUsapPool=*/ true, useSystemGraphicsDriver, zygoteArgs); } /** @hide */ public static final ProcessStartResult startWebView(@NonNull final String processClass, public static ProcessStartResult startWebView(@NonNull final String processClass, @Nullable final String niceName, int uid, int gid, @Nullable int[] gids, int runtimeFlags, int mountExternal, int runtimeFlags, int mountExternal, int targetSdkVersion, @Nullable String seInfo, @NonNull String abi, Loading @@ -556,13 +558,13 @@ public class Process { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ false, zygoteArgs, useSystemGraphicsDriver); packagesForUid, sandboxId, /*useUsapPool=*/ false, useSystemGraphicsDriver, zygoteArgs); } /** Loading core/java/android/os/ZygoteProcess.java +10 −6 Original line number Diff line number Diff line Loading @@ -327,8 +327,8 @@ public class ZygoteProcess { @Nullable String[] packagesForUid, @Nullable String sandboxId, boolean useUsapPool, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { // TODO (chriswailes): Is there a better place to check this value? if (fetchUsapPoolEnabledPropWithMinInterval()) { informZygotesOfUsapPoolStatus(); Loading @@ -339,7 +339,7 @@ public class ZygoteProcess { runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false, packageName, packagesForUid, sandboxId, useUsapPool, zygoteArgs); useUsapPool, useSystemGraphicsDriver, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -548,7 +548,8 @@ public class ZygoteProcess { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, boolean useUnspecializedAppProcessPool, boolean useUsapPool, boolean useSystemGraphicsDriver, @Nullable String[] extraArgs) throws ZygoteStartFailedEx { ArrayList<String> argsForZygote = new ArrayList<>(); Loading Loading @@ -635,8 +636,10 @@ public class ZygoteProcess { } synchronized(mLock) { // The USAP pool can not be used if the application will not use the systems graphics // driver. If that driver is requested use the Zygote application start path. return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi), useUnspecializedAppProcessPool, useUsapPool && useSystemGraphicsDriver, argsForZygote); } } Loading Loading @@ -1141,7 +1144,8 @@ public class ZygoteProcess { abi, instructionSet, null /* appDataDir */, null /* invokeWith */, true /* startChildZygote */, null /* packageName */, null /* packagesForUid */, null /* sandboxId */, false /* useUsapPool */, extraArgs); false /* useUsapPool */, false /*useSystemGraphicsDriver*/, extraArgs); } catch (ZygoteStartFailedEx ex) { throw new RuntimeException("Starting child-zygote through Zygote failed", ex); } Loading core/java/com/android/internal/os/Zygote.java +3 −0 Original line number Diff line number Diff line Loading @@ -517,6 +517,9 @@ public final class Zygote { Credentials peerCredentials = null; ZygoteArguments args = null; // Load resources ZygoteInit.nativePreloadOpenGL(); while (true) { try { sessionSocket = usapPoolSocket.accept(); Loading core/java/com/android/internal/os/ZygoteInit.java +10 −3 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class ZygoteInit { nativePreloadAppProcessHALs(); Trace.traceEnd(Trace.TRACE_TAG_DALVIK); Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL"); preloadOpenGL(); maybePreloadOpenGL(); Trace.traceEnd(Trace.TRACE_TAG_DALVIK); preloadSharedLibraries(); preloadTextResources(); Loading Loading @@ -192,9 +192,16 @@ public class ZygoteInit { native private static void nativePreloadAppProcessHALs(); native private static void nativePreloadOpenGL(); /** * This call loads the graphics driver by attempting to make an OpenGL call. If the driver is * not currently in memory it will load and initialize it. The OpenGL call itself is relatively * cheap and pure. This means that it is a low overhead on the initial call, and is safe and * cheap to call later. Calls after the initial invocation will effectively be no-ops for the * system. */ static native void nativePreloadOpenGL(); private static void preloadOpenGL() { private static void maybePreloadOpenGL() { String driverPackageName = SystemProperties.get(PROPERTY_GFX_DRIVER); if (!SystemProperties.getBoolean(PROPERTY_DISABLE_OPENGL_PRELOADING, false) && (driverPackageName == null || driverPackageName.isEmpty())) { Loading services/core/java/com/android/server/am/ProcessList.java +7 −7 Original line number Diff line number Diff line Loading @@ -1827,8 +1827,8 @@ public final class ProcessList { app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, null, app.info.packageName, packageNames, sandboxId, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } else if (hostingRecord.usesAppZygote()) { final AppZygote appZygote = createAppZygoteForProcessIfNeeded(app); Loading @@ -1836,17 +1836,17 @@ public final class ProcessList { app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, null, app.info.packageName, packageNames, sandboxId, /*useUnspecializedAppProcessPool=*/ false, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); packageNames, sandboxId, /*useUsapPool=*/ false, useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } else { startResult = Process.start(entryPoint, app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, invokeWith, app.info.packageName, packageNames, sandboxId, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } checkSlow(startTime, "startProcess: returned from zygote!"); return startResult; Loading Loading
core/java/android/os/Process.java +38 −36 Original line number Diff line number Diff line Loading @@ -512,18 +512,19 @@ public class Process { * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * @param packagesForUid null-ok all the packages with the same uid as this process. * @param zygoteArgs Additional arguments to supply to the zygote process. * @param useSystemGraphicsDriver whether the process uses system graphics driver. * * @param zygoteArgs Additional arguments to supply to the zygote process. * @return An object that describes the result of the attempt to start the process. * @throws RuntimeException on fatal start failure * * {@hide} */ public static final ProcessStartResult start(@NonNull final String processClass, public static ProcessStartResult start(@NonNull final String processClass, @Nullable final String niceName, int uid, int gid, @Nullable int[] gids, int runtimeFlags, int mountExternal, int runtimeFlags, int mountExternal, int targetSdkVersion, @Nullable String seInfo, @NonNull String abi, Loading @@ -533,20 +534,21 @@ public class Process { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ true, zygoteArgs, useSystemGraphicsDriver); packagesForUid, sandboxId, /*useUsapPool=*/ true, useSystemGraphicsDriver, zygoteArgs); } /** @hide */ public static final ProcessStartResult startWebView(@NonNull final String processClass, public static ProcessStartResult startWebView(@NonNull final String processClass, @Nullable final String niceName, int uid, int gid, @Nullable int[] gids, int runtimeFlags, int mountExternal, int runtimeFlags, int mountExternal, int targetSdkVersion, @Nullable String seInfo, @NonNull String abi, Loading @@ -556,13 +558,13 @@ public class Process { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, packagesForUid, sandboxId, /*useUnspecializedAppProcessPool=*/ false, zygoteArgs, useSystemGraphicsDriver); packagesForUid, sandboxId, /*useUsapPool=*/ false, useSystemGraphicsDriver, zygoteArgs); } /** Loading
core/java/android/os/ZygoteProcess.java +10 −6 Original line number Diff line number Diff line Loading @@ -327,8 +327,8 @@ public class ZygoteProcess { @Nullable String[] packagesForUid, @Nullable String sandboxId, boolean useUsapPool, @Nullable String[] zygoteArgs, boolean useSystemGraphicsDriver) { boolean useSystemGraphicsDriver, @Nullable String[] zygoteArgs) { // TODO (chriswailes): Is there a better place to check this value? if (fetchUsapPoolEnabledPropWithMinInterval()) { informZygotesOfUsapPoolStatus(); Loading @@ -339,7 +339,7 @@ public class ZygoteProcess { runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false, packageName, packagesForUid, sandboxId, useUsapPool, zygoteArgs); useUsapPool, useSystemGraphicsDriver, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -548,7 +548,8 @@ public class ZygoteProcess { @Nullable String packageName, @Nullable String[] packagesForUid, @Nullable String sandboxId, boolean useUnspecializedAppProcessPool, boolean useUsapPool, boolean useSystemGraphicsDriver, @Nullable String[] extraArgs) throws ZygoteStartFailedEx { ArrayList<String> argsForZygote = new ArrayList<>(); Loading Loading @@ -635,8 +636,10 @@ public class ZygoteProcess { } synchronized(mLock) { // The USAP pool can not be used if the application will not use the systems graphics // driver. If that driver is requested use the Zygote application start path. return zygoteSendArgsAndGetResult(openZygoteSocketIfNeeded(abi), useUnspecializedAppProcessPool, useUsapPool && useSystemGraphicsDriver, argsForZygote); } } Loading Loading @@ -1141,7 +1144,8 @@ public class ZygoteProcess { abi, instructionSet, null /* appDataDir */, null /* invokeWith */, true /* startChildZygote */, null /* packageName */, null /* packagesForUid */, null /* sandboxId */, false /* useUsapPool */, extraArgs); false /* useUsapPool */, false /*useSystemGraphicsDriver*/, extraArgs); } catch (ZygoteStartFailedEx ex) { throw new RuntimeException("Starting child-zygote through Zygote failed", ex); } Loading
core/java/com/android/internal/os/Zygote.java +3 −0 Original line number Diff line number Diff line Loading @@ -517,6 +517,9 @@ public final class Zygote { Credentials peerCredentials = null; ZygoteArguments args = null; // Load resources ZygoteInit.nativePreloadOpenGL(); while (true) { try { sessionSocket = usapPoolSocket.accept(); Loading
core/java/com/android/internal/os/ZygoteInit.java +10 −3 Original line number Diff line number Diff line Loading @@ -150,7 +150,7 @@ public class ZygoteInit { nativePreloadAppProcessHALs(); Trace.traceEnd(Trace.TRACE_TAG_DALVIK); Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL"); preloadOpenGL(); maybePreloadOpenGL(); Trace.traceEnd(Trace.TRACE_TAG_DALVIK); preloadSharedLibraries(); preloadTextResources(); Loading Loading @@ -192,9 +192,16 @@ public class ZygoteInit { native private static void nativePreloadAppProcessHALs(); native private static void nativePreloadOpenGL(); /** * This call loads the graphics driver by attempting to make an OpenGL call. If the driver is * not currently in memory it will load and initialize it. The OpenGL call itself is relatively * cheap and pure. This means that it is a low overhead on the initial call, and is safe and * cheap to call later. Calls after the initial invocation will effectively be no-ops for the * system. */ static native void nativePreloadOpenGL(); private static void preloadOpenGL() { private static void maybePreloadOpenGL() { String driverPackageName = SystemProperties.get(PROPERTY_GFX_DRIVER); if (!SystemProperties.getBoolean(PROPERTY_DISABLE_OPENGL_PRELOADING, false) && (driverPackageName == null || driverPackageName.isEmpty())) { Loading
services/core/java/com/android/server/am/ProcessList.java +7 −7 Original line number Diff line number Diff line Loading @@ -1827,8 +1827,8 @@ public final class ProcessList { app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, null, app.info.packageName, packageNames, sandboxId, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } else if (hostingRecord.usesAppZygote()) { final AppZygote appZygote = createAppZygoteForProcessIfNeeded(app); Loading @@ -1836,17 +1836,17 @@ public final class ProcessList { app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, null, app.info.packageName, packageNames, sandboxId, /*useUnspecializedAppProcessPool=*/ false, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); packageNames, sandboxId, /*useUsapPool=*/ false, useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } else { startResult = Process.start(entryPoint, app.processName, uid, uid, gids, runtimeFlags, mountExternal, app.info.targetSdkVersion, seInfo, requiredAbi, instructionSet, app.info.dataDir, invokeWith, app.info.packageName, packageNames, sandboxId, new String[] {PROC_START_SEQ_IDENT + app.startSeq}, useSystemGraphicsDriver); useSystemGraphicsDriver, new String[] {PROC_START_SEQ_IDENT + app.startSeq}); } checkSlow(startTime, "startProcess: returned from zygote!"); return startResult; Loading