Disable zygote preloading
Change-Id: I2b0cfdb8f0a66c1bac92f4c67a4be06fa78b6d74
diff --git a/oat_process/app_main.cpp b/oat_process/app_main.cpp
index 4e90dab..62858dc 100644
--- a/oat_process/app_main.cpp
+++ b/oat_process/app_main.cpp
@@ -209,6 +209,7 @@
// Parse runtime arguments. Stop at first unrecognized option.
bool zygote = false;
bool startSystemServer = false;
+ bool noPreload = false;
bool application = false;
const char* parentDir = NULL;
const char* niceName = NULL;
@@ -222,6 +223,8 @@
niceName = "zygote";
} else if (strcmp(arg, "--start-system-server") == 0) {
startSystemServer = true;
+ } else if (strcmp(arg, "--no-preload") == 0) {
+ noPreload = true;
} else if (strcmp(arg, "--application") == 0) {
application = true;
} else if (strncmp(arg, "--nice-name=", 12) == 0) {
@@ -240,8 +243,14 @@
runtime.mParentDir = parentDir;
if (zygote) {
- runtime.start("com.android.internal.os.ZygoteInit",
- startSystemServer ? "start-system-server" : "");
+ std::string options;
+ if (startSystemServer) {
+ options += "start-system-server ";
+ }
+ if (noPreload) {
+ options += "no-preload ";
+ }
+ runtime.start("com.android.internal.os.ZygoteInit", options.c_str());
} else if (className) {
// Remainder of args get passed to startup class main()
runtime.mClassName = className;