diff options
author | xmao <xmao@codeaurora.org> | 2017-12-27 09:57:34 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-02-08 05:40:49 -0800 |
commit | 887fe19a218760fa83e560b8d902b65878a1863b (patch) | |
tree | bcb3e9d6f1ff341c8ac6731b1505dc5a835f4622 /cmds/app_process/app_main.cpp | |
parent | 7a7cef8b9a3396d324be180a72df84520b34ce37 (diff) |
Skip start zygote when the phone on FFBM mode
Skip start zygote in ffbm-00/01 mode to speed up the booting time.
Change-Id: Ib164aae9847b40a906f7d52e046ca7bd20171227
Diffstat (limited to 'cmds/app_process/app_main.cpp')
-rw-r--r-- | cmds/app_process/app_main.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index 1671337511b7..9ac05dcd402c 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -20,8 +20,11 @@ #include <cutils/properties.h> #include <cutils/trace.h> #include <android_runtime/AndroidRuntime.h> +#include <android-base/properties.h> #include <private/android_filesystem_config.h> // for AID_SYSTEM +using android::base::GetProperty; + namespace android { static void app_usage() @@ -186,6 +189,13 @@ static const char ZYGOTE_NICE_NAME[] = "zygote"; int main(int argc, char* const argv[]) { + std::string bootmode = GetProperty("ro.bootmode", ""); + + if ((strncmp(bootmode.c_str(), "ffbm-00", 7) == 0) + || (strncmp(bootmode.c_str(), "ffbm-01", 7) == 0)) { + return 0; + } + if (!LOG_NDEBUG) { String8 argv_String; for (int i = 0; i < argc; ++i) { |