Allow debugging only for apps forked from zygote
When starting the runtime from app_process, we only pass JDWP options
if starting zygote. It prevents from opening a JDWP connection in
non-zygote programs while Android apps (forked from zygote) remain
debuggable.
Bug: 23050463
Change-Id: If8ea719063a65db4cdeed69a838b52e87b078b08
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp
index 449a4ab..2e02382 100644
--- a/cmds/app_process/app_main.cpp
+++ b/cmds/app_process/app_main.cpp
@@ -304,9 +304,9 @@
}
if (zygote) {
- runtime.start("com.android.internal.os.ZygoteInit", args);
+ runtime.start("com.android.internal.os.ZygoteInit", args, zygote);
} else if (className) {
- runtime.start("com.android.internal.os.RuntimeInit", args);
+ runtime.start("com.android.internal.os.RuntimeInit", args, zygote);
} else {
fprintf(stderr, "Error: no class name or --zygote supplied.\n");
app_usage();