Loading core/java/android/os/Process.java +7 −4 Original line number Diff line number Diff line Loading @@ -519,7 +519,8 @@ public class Process { * @param appDataDir null-ok the data directory of the app. * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * * @param disabledCompatChanges null-ok list of disabled compat changes for the process being * started. * @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 Loading @@ -538,11 +539,12 @@ public class Process { @Nullable String appDataDir, @Nullable String invokeWith, @Nullable String packageName, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, /*useUsapPool=*/ true, zygoteArgs); /*useUsapPool=*/ true, disabledCompatChanges, zygoteArgs); } /** @hide */ Loading @@ -558,11 +560,12 @@ public class Process { @Nullable String appDataDir, @Nullable String invokeWith, @Nullable String packageName, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, /*useUsapPool=*/ false, zygoteArgs); /*useUsapPool=*/ false, disabledCompatChanges, zygoteArgs); } /** Loading core/java/android/os/ZygoteProcess.java +23 −2 Original line number Diff line number Diff line Loading @@ -306,6 +306,8 @@ public class ZygoteProcess { * @param appDataDir null-ok the data directory of the app. * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * @param disabledCompatChanges null-ok list of disabled compat changes for the process being * started. * @param zygoteArgs Additional arguments to supply to the zygote process. * * @return An object that describes the result of the attempt to start the process. Loading @@ -323,6 +325,7 @@ public class ZygoteProcess { @Nullable String invokeWith, @Nullable String packageName, boolean useUsapPool, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { // TODO (chriswailes): Is there a better place to check this value? if (fetchUsapPoolEnabledPropWithMinInterval()) { Loading @@ -333,7 +336,7 @@ public class ZygoteProcess { return startViaZygote(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false, packageName, useUsapPool, zygoteArgs); packageName, useUsapPool, disabledCompatChanges, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -534,6 +537,7 @@ public class ZygoteProcess { * @param startChildZygote Start a sub-zygote. This creates a new zygote process * that has its state cloned from this zygote process. * @param packageName null-ok the name of the package this process belongs to. * @param disabledCompatChanges a list of disabled compat changes for the process being started. * @param extraArgs Additional arguments to supply to the zygote process. * @return An object that describes the result of the attempt to start the process. * @throws ZygoteStartFailedEx if process start failed for any reason Loading @@ -552,6 +556,7 @@ public class ZygoteProcess { boolean startChildZygote, @Nullable String packageName, boolean useUsapPool, @Nullable long[] disabledCompatChanges, @Nullable String[] extraArgs) throws ZygoteStartFailedEx { ArrayList<String> argsForZygote = new ArrayList<>(); Loading Loading @@ -623,6 +628,21 @@ public class ZygoteProcess { argsForZygote.add("--package-name=" + packageName); } if (disabledCompatChanges != null && disabledCompatChanges.length > 0) { final StringBuilder sb = new StringBuilder(); sb.append("--disabled-compat-changes="); final int sz = disabledCompatChanges.length; for (int i = 0; i < sz; i++) { if (i != 0) { sb.append(','); } sb.append(disabledCompatChanges[i]); } argsForZygote.add(sb.toString()); } argsForZygote.add(processClass); if (extraArgs != null) { Loading Loading @@ -1170,7 +1190,8 @@ public class ZygoteProcess { gids, runtimeFlags, 0 /* mountExternal */, 0 /* targetSdkVersion */, seInfo, abi, instructionSet, null /* appDataDir */, null /* invokeWith */, true /* startChildZygote */, null /* packageName */, false /* useUsapPool */, extraArgs); false /* useUsapPool */, null /* disabledCompatChanges */, extraArgs); } catch (ZygoteStartFailedEx ex) { throw new RuntimeException("Starting child-zygote through Zygote failed", ex); } Loading core/java/com/android/internal/os/RuntimeInit.java +3 −2 Original line number Diff line number Diff line Loading @@ -367,8 +367,8 @@ public class RuntimeInit { if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!"); } protected static Runnable applicationInit(int targetSdkVersion, String[] argv, ClassLoader classLoader) { protected static Runnable applicationInit(int targetSdkVersion, long[] disabledCompatChanges, String[] argv, ClassLoader classLoader) { // If the application calls System.exit(), terminate the process // immediately without running any shutdown hooks. It is not possible to // shutdown an Android application gracefully. Among other things, the Loading @@ -377,6 +377,7 @@ public class RuntimeInit { nativeSetExitWithoutCleanup(true); VMRuntime.getRuntime().setTargetSdkVersion(targetSdkVersion); VMRuntime.getRuntime().setDisabledCompatChanges(disabledCompatChanges); final Arguments args = new Arguments(argv); Loading core/java/com/android/internal/os/WrapperInit.java +7 −5 Original line number Diff line number Diff line Loading @@ -23,16 +23,18 @@ import android.system.Os; import android.system.OsConstants; import android.system.StructCapUserData; import android.system.StructCapUserHeader; import android.util.TimingsTraceLog; import android.util.Slog; import android.util.TimingsTraceLog; import dalvik.system.VMRuntime; import libcore.io.IoUtils; import java.io.DataOutputStream; import java.io.FileDescriptor; import java.io.FileOutputStream; import java.io.IOException; import libcore.io.IoUtils; /** * Startup class for the wrapper process. * @hide Loading Loading @@ -166,10 +168,10 @@ public class WrapperInit { System.arraycopy(argv, 2, removedArgs, 0, argv.length - 2); argv = removedArgs; } // Perform the same initialization that would happen after the Zygote forks. Zygote.nativePreApplicationInit(); return RuntimeInit.applicationInit(targetSdkVersion, argv, classLoader); return RuntimeInit.applicationInit(targetSdkVersion, /*disabledCompatChanges*/ null, argv, classLoader); } /** Loading core/java/com/android/internal/os/Zygote.java +1 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,7 @@ public final class Zygote { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); return ZygoteInit.zygoteInit(args.mTargetSdkVersion, args.mDisabledCompatChanges, args.mRemainingArgs, null /* classLoader */); } finally { Loading Loading
core/java/android/os/Process.java +7 −4 Original line number Diff line number Diff line Loading @@ -519,7 +519,8 @@ public class Process { * @param appDataDir null-ok the data directory of the app. * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * * @param disabledCompatChanges null-ok list of disabled compat changes for the process being * started. * @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 Loading @@ -538,11 +539,12 @@ public class Process { @Nullable String appDataDir, @Nullable String invokeWith, @Nullable String packageName, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { return ZYGOTE_PROCESS.start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, /*useUsapPool=*/ true, zygoteArgs); /*useUsapPool=*/ true, disabledCompatChanges, zygoteArgs); } /** @hide */ Loading @@ -558,11 +560,12 @@ public class Process { @Nullable String appDataDir, @Nullable String invokeWith, @Nullable String packageName, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { return WebViewZygote.getProcess().start(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, packageName, /*useUsapPool=*/ false, zygoteArgs); /*useUsapPool=*/ false, disabledCompatChanges, zygoteArgs); } /** Loading
core/java/android/os/ZygoteProcess.java +23 −2 Original line number Diff line number Diff line Loading @@ -306,6 +306,8 @@ public class ZygoteProcess { * @param appDataDir null-ok the data directory of the app. * @param invokeWith null-ok the command to invoke with. * @param packageName null-ok the name of the package this process belongs to. * @param disabledCompatChanges null-ok list of disabled compat changes for the process being * started. * @param zygoteArgs Additional arguments to supply to the zygote process. * * @return An object that describes the result of the attempt to start the process. Loading @@ -323,6 +325,7 @@ public class ZygoteProcess { @Nullable String invokeWith, @Nullable String packageName, boolean useUsapPool, @Nullable long[] disabledCompatChanges, @Nullable String[] zygoteArgs) { // TODO (chriswailes): Is there a better place to check this value? if (fetchUsapPoolEnabledPropWithMinInterval()) { Loading @@ -333,7 +336,7 @@ public class ZygoteProcess { return startViaZygote(processClass, niceName, uid, gid, gids, runtimeFlags, mountExternal, targetSdkVersion, seInfo, abi, instructionSet, appDataDir, invokeWith, /*startChildZygote=*/ false, packageName, useUsapPool, zygoteArgs); packageName, useUsapPool, disabledCompatChanges, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); Loading Loading @@ -534,6 +537,7 @@ public class ZygoteProcess { * @param startChildZygote Start a sub-zygote. This creates a new zygote process * that has its state cloned from this zygote process. * @param packageName null-ok the name of the package this process belongs to. * @param disabledCompatChanges a list of disabled compat changes for the process being started. * @param extraArgs Additional arguments to supply to the zygote process. * @return An object that describes the result of the attempt to start the process. * @throws ZygoteStartFailedEx if process start failed for any reason Loading @@ -552,6 +556,7 @@ public class ZygoteProcess { boolean startChildZygote, @Nullable String packageName, boolean useUsapPool, @Nullable long[] disabledCompatChanges, @Nullable String[] extraArgs) throws ZygoteStartFailedEx { ArrayList<String> argsForZygote = new ArrayList<>(); Loading Loading @@ -623,6 +628,21 @@ public class ZygoteProcess { argsForZygote.add("--package-name=" + packageName); } if (disabledCompatChanges != null && disabledCompatChanges.length > 0) { final StringBuilder sb = new StringBuilder(); sb.append("--disabled-compat-changes="); final int sz = disabledCompatChanges.length; for (int i = 0; i < sz; i++) { if (i != 0) { sb.append(','); } sb.append(disabledCompatChanges[i]); } argsForZygote.add(sb.toString()); } argsForZygote.add(processClass); if (extraArgs != null) { Loading Loading @@ -1170,7 +1190,8 @@ public class ZygoteProcess { gids, runtimeFlags, 0 /* mountExternal */, 0 /* targetSdkVersion */, seInfo, abi, instructionSet, null /* appDataDir */, null /* invokeWith */, true /* startChildZygote */, null /* packageName */, false /* useUsapPool */, extraArgs); false /* useUsapPool */, null /* disabledCompatChanges */, extraArgs); } catch (ZygoteStartFailedEx ex) { throw new RuntimeException("Starting child-zygote through Zygote failed", ex); } Loading
core/java/com/android/internal/os/RuntimeInit.java +3 −2 Original line number Diff line number Diff line Loading @@ -367,8 +367,8 @@ public class RuntimeInit { if (DEBUG) Slog.d(TAG, "Leaving RuntimeInit!"); } protected static Runnable applicationInit(int targetSdkVersion, String[] argv, ClassLoader classLoader) { protected static Runnable applicationInit(int targetSdkVersion, long[] disabledCompatChanges, String[] argv, ClassLoader classLoader) { // If the application calls System.exit(), terminate the process // immediately without running any shutdown hooks. It is not possible to // shutdown an Android application gracefully. Among other things, the Loading @@ -377,6 +377,7 @@ public class RuntimeInit { nativeSetExitWithoutCleanup(true); VMRuntime.getRuntime().setTargetSdkVersion(targetSdkVersion); VMRuntime.getRuntime().setDisabledCompatChanges(disabledCompatChanges); final Arguments args = new Arguments(argv); Loading
core/java/com/android/internal/os/WrapperInit.java +7 −5 Original line number Diff line number Diff line Loading @@ -23,16 +23,18 @@ import android.system.Os; import android.system.OsConstants; import android.system.StructCapUserData; import android.system.StructCapUserHeader; import android.util.TimingsTraceLog; import android.util.Slog; import android.util.TimingsTraceLog; import dalvik.system.VMRuntime; import libcore.io.IoUtils; import java.io.DataOutputStream; import java.io.FileDescriptor; import java.io.FileOutputStream; import java.io.IOException; import libcore.io.IoUtils; /** * Startup class for the wrapper process. * @hide Loading Loading @@ -166,10 +168,10 @@ public class WrapperInit { System.arraycopy(argv, 2, removedArgs, 0, argv.length - 2); argv = removedArgs; } // Perform the same initialization that would happen after the Zygote forks. Zygote.nativePreApplicationInit(); return RuntimeInit.applicationInit(targetSdkVersion, argv, classLoader); return RuntimeInit.applicationInit(targetSdkVersion, /*disabledCompatChanges*/ null, argv, classLoader); } /** Loading
core/java/com/android/internal/os/Zygote.java +1 −0 Original line number Diff line number Diff line Loading @@ -642,6 +642,7 @@ public final class Zygote { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); return ZygoteInit.zygoteInit(args.mTargetSdkVersion, args.mDisabledCompatChanges, args.mRemainingArgs, null /* classLoader */); } finally { Loading