diff options
| author | 2011-10-11 22:49:18 -0700 | |
|---|---|---|
| committer | 2011-10-11 23:24:23 -0700 | |
| commit | 648e5e9160fbd3ece4c4ab58370e9cf22e0d76b7 (patch) | |
| tree | 8c7c9ceaf62d6d229f8a9ee60f099fdf6507d691 | |
| parent | c0da31a2aacfc6347cc04c7024aea9cf2e44953e (diff) | |
Disable zygote preloading
Change-Id: I2b0cfdb8f0a66c1bac92f4c67a4be06fa78b6d74
| -rw-r--r-- | Android.mk | 4 | ||||
| -rw-r--r-- | oat_process/app_main.cpp | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/Android.mk b/Android.mk index 38eb01e59a..0503f8cc58 100644 --- a/Android.mk +++ b/Android.mk @@ -170,7 +170,7 @@ test-art-target-oat-process-Calculator: $(TARGET_OUT_APPS)/Calculator.oat $(TARG .PHONY: zygote-oat-process zygote-oat-process: $(TARGET_BOOT_OAT) test-art-target-sync - sed s/app_process/oat_process/ < system/core/rootdir/init.rc > $(ANDROID_PRODUCT_OUT)/root/init.rc + sed -e 's/app_process/oat_process/' -e 's/--start-system-server/--start-system-server --no-preload/' < system/core/rootdir/init.rc > $(ANDROID_PRODUCT_OUT)/root/init.rc rm -f $(ANDROID_PRODUCT_OUT)/boot.img unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage adb reboot bootloader @@ -179,7 +179,7 @@ zygote-oat-process: $(TARGET_BOOT_OAT) test-art-target-sync .PHONY: zygote-app-process zygote-app-process: - sed s/oat_process/app_process/ < system/core/rootdir/init.rc > $(ANDROID_PRODUCT_OUT)/root/init.rc + cp system/core/rootdir/init.rc $(ANDROID_PRODUCT_OUT)/root/init.rc rm -f $(ANDROID_PRODUCT_OUT)/boot.img unset ONE_SHOT_MAKEFILE && $(MAKE) showcommands bootimage adb reboot bootloader diff --git a/oat_process/app_main.cpp b/oat_process/app_main.cpp index 4e90dab413..62858dc21f 100644 --- a/oat_process/app_main.cpp +++ b/oat_process/app_main.cpp @@ -209,6 +209,7 @@ int main(int argc, const char* argv[]) // 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 @@ int main(int argc, const char* argv[]) 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 @@ int main(int argc, const char* argv[]) 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; |