Loading core/jni/AndroidRuntime.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -631,7 +631,7 @@ bool AndroidRuntime::parseCompilerRuntimeOption(const char* property, * * Returns 0 on success. */ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool primary_zygote) { JavaVMInitArgs initArgs; char propBuf[PROPERTY_VALUE_MAX]; Loading Loading @@ -762,6 +762,10 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) addOption("-verbose:gc"); //addOption("-verbose:class"); if (primary_zygote) { addOption("-Xprimaryzygote"); } /* * The default starting and maximum size of the heap. Larger * values should be specified in a product property override. Loading Loading @@ -1123,6 +1127,8 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options className != NULL ? className : "(unknown)", getuid()); static const String8 startSystemServer("start-system-server"); // Whether this is the primary zygote, meaning the zygote which will fork system server. bool primary_zygote = false; /* * 'startSystemServer == true' means runtime is obsolete and not run from Loading @@ -1130,6 +1136,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options */ for (size_t i = 0; i < options.size(); ++i) { if (options[i] == startSystemServer) { primary_zygote = true; /* track our progress through the boot sequence */ const int LOG_BOOT_PROGRESS_START = 3000; LOG_EVENT_LONG(LOG_BOOT_PROGRESS_START, ns2ms(systemTime(SYSTEM_TIME_MONOTONIC))); Loading Loading @@ -1165,7 +1172,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options JniInvocation jni_invocation; jni_invocation.Init(NULL); JNIEnv* env; if (startVm(&mJavaVM, &env, zygote) != 0) { if (startVm(&mJavaVM, &env, zygote, primary_zygote) != 0) { return; } onVmCreated(env); Loading core/jni/include/android_runtime/AndroidRuntime.h +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ private: const char* runtimeArg, const char* quotingArg); void parseExtraOpts(char* extraOptsBuf, const char* quotingArg); int startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote); int startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool primary_zygote); Vector<JavaVMOption> mOptions; bool mExitWithoutCleanup; Loading Loading
core/jni/AndroidRuntime.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -631,7 +631,7 @@ bool AndroidRuntime::parseCompilerRuntimeOption(const char* property, * * Returns 0 on success. */ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool primary_zygote) { JavaVMInitArgs initArgs; char propBuf[PROPERTY_VALUE_MAX]; Loading Loading @@ -762,6 +762,10 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote) addOption("-verbose:gc"); //addOption("-verbose:class"); if (primary_zygote) { addOption("-Xprimaryzygote"); } /* * The default starting and maximum size of the heap. Larger * values should be specified in a product property override. Loading Loading @@ -1123,6 +1127,8 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options className != NULL ? className : "(unknown)", getuid()); static const String8 startSystemServer("start-system-server"); // Whether this is the primary zygote, meaning the zygote which will fork system server. bool primary_zygote = false; /* * 'startSystemServer == true' means runtime is obsolete and not run from Loading @@ -1130,6 +1136,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options */ for (size_t i = 0; i < options.size(); ++i) { if (options[i] == startSystemServer) { primary_zygote = true; /* track our progress through the boot sequence */ const int LOG_BOOT_PROGRESS_START = 3000; LOG_EVENT_LONG(LOG_BOOT_PROGRESS_START, ns2ms(systemTime(SYSTEM_TIME_MONOTONIC))); Loading Loading @@ -1165,7 +1172,7 @@ void AndroidRuntime::start(const char* className, const Vector<String8>& options JniInvocation jni_invocation; jni_invocation.Init(NULL); JNIEnv* env; if (startVm(&mJavaVM, &env, zygote) != 0) { if (startVm(&mJavaVM, &env, zygote, primary_zygote) != 0) { return; } onVmCreated(env); Loading
core/jni/include/android_runtime/AndroidRuntime.h +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ private: const char* runtimeArg, const char* quotingArg); void parseExtraOpts(char* extraOptsBuf, const char* quotingArg); int startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote); int startVm(JavaVM** pJavaVM, JNIEnv** pEnv, bool zygote, bool primary_zygote); Vector<JavaVMOption> mOptions; bool mExitWithoutCleanup; Loading