From b523e5e6dcd85f180650d1e812f3d98863b42d8c Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Wed, 24 Aug 2022 19:54:48 +0000 Subject: [PATCH] app_process: Fix className check Emptyness of a String8 variable was not checked correctly. As a result, even when no arguments were provided, `app_process` was still launching runtime. Test: adb shell app_process64 Change-Id: Ia303edb5a74b61efad24b475008a3642a07ab789 --- cmds/app_process/app_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 12083b6fe20bb..28db61f7d98a2 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -334,7 +334,7 @@ int main(int argc, char* const argv[]) if (zygote) { runtime.start("com.android.internal.os.ZygoteInit", args, zygote); - } else if (className) { + } else if (!className.isEmpty()) { runtime.start("com.android.internal.os.RuntimeInit", args, zygote); } else { fprintf(stderr, "Error: no class name or --zygote supplied.\n");