diff options
author | Narayan Kamath <narayan@google.com> | 2014-04-07 13:56:15 +0100 |
---|---|---|
committer | Narayan Kamath <narayan@google.com> | 2014-04-09 13:41:15 +0100 |
commit | c41638cb759ce569630ffae4c5c4cdee1b0f3b82 (patch) | |
tree | 06f51dec3427c6e8322816b2e43f2bb784f28fe0 /cmds | |
parent | 22ec1eefa4dc8e12f7da8e8750d4770144941526 (diff) | |
download | frameworks_base-c41638cb759ce569630ffae4c5c4cdee1b0f3b82.zip frameworks_base-c41638cb759ce569630ffae4c5c4cdee1b0f3b82.tar.gz frameworks_base-c41638cb759ce569630ffae4c5c4cdee1b0f3b82.tar.bz2 |
Make zygotes aware of their supported ABIs.
Query system properties for the list of ABIs and pass
it as a command line argument to ZygoteInit.
Also add a new Zygote command that returns this list of
ABIs to peers.
Change-Id: I68034c6f63fa626911122579a011a0a25a8cda94
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/app_process/app_main.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/cmds/app_process/app_main.cpp b/cmds/app_process/app_main.cpp index e0290c3..3e8d6a0 100644 --- a/cmds/app_process/app_main.cpp +++ b/cmds/app_process/app_main.cpp @@ -10,8 +10,9 @@ #include <binder/IPCThreadState.h> #include <binder/ProcessState.h> #include <utils/Log.h> -#include <cutils/process_name.h> #include <cutils/memory.h> +#include <cutils/process_name.h> +#include <cutils/properties.h> #include <cutils/trace.h> #include <android_runtime/AndroidRuntime.h> @@ -135,6 +136,12 @@ static size_t computeArgBlockSize(int argc, char* const argv[]) { return (end - start); } +#if defined(__LP64__) +static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist64"; +#else +static const char ABI_LIST_PROPERTY[] = "ro.product.cpu.abilist32"; +#endif + int main(int argc, char* const argv[]) { AppRuntime runtime(argv[0], computeArgBlockSize(argc, argv)); @@ -205,6 +212,17 @@ int main(int argc, char* const argv[]) args.add(String8("start-system-server")); } + char prop[PROP_VALUE_MAX]; + if (property_get(ABI_LIST_PROPERTY, prop, NULL) == 0) { + LOG_ALWAYS_FATAL("app_process: Unable to deterimine ABI list from property %s.", + ABI_LIST_PROPERTY); + return 11; + } + + String8 abiFlag("--abi-list="); + abiFlag.append(prop); + args.add(abiFlag); + // In zygote mode, pass all remaining arguments to the zygote // main() method. for (; i < argc; ++i) { |