diff options
author | Andreas Gampe <agampe@google.com> | 2015-03-30 18:45:03 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2015-03-30 21:08:58 -0700 |
commit | 2cc42f0bb3db6ff63fec4cbc282fa8af33d82fca (patch) | |
tree | 1d3d9f687629185e86eb00bc30bf97409d0000fb | |
parent | 592cc33c408d5c91ad87e1a51d72269d4525a10b (diff) | |
download | frameworks_native-2cc42f0bb3db6ff63fec4cbc282fa8af33d82fca.zip frameworks_native-2cc42f0bb3db6ff63fec4cbc282fa8af33d82fca.tar.gz frameworks_native-2cc42f0bb3db6ff63fec4cbc282fa8af33d82fca.tar.bz2 |
Installd: Support dex2oat threads system property
Check dalvik.vm.dex2oat-threads in installd and pass to dex2oat.
Bug: 19992386
(cherry picked from commit 8d7af8b2418cc5e7e59746f0cb359a75ed0bdfd1)
Change-Id: I5e7806cf560607d31a1d6901dffb14bee538c9cc
-rw-r--r-- | cmds/installd/commands.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 76bc9d5..367f13a 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -712,6 +712,14 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name, bool have_dex2oat_compiler_filter_flag = property_get("dalvik.vm.dex2oat-filter", dex2oat_compiler_filter_flag, NULL) > 0; + char dex2oat_threads_buf[PROPERTY_VALUE_MAX]; + bool have_dex2oat_threads_flag = property_get("dalvik.vm.dex2oat-threads", dex2oat_threads_buf, + NULL) > 0; + char dex2oat_threads_arg[PROPERTY_VALUE_MAX + 2]; + if (have_dex2oat_threads_flag) { + sprintf(dex2oat_threads_arg, "-j%s", dex2oat_threads_buf); + } + char dex2oat_isa_features_key[PROPERTY_KEY_MAX]; sprintf(dex2oat_isa_features_key, "dalvik.vm.isa.%s.features", instruction_set); char dex2oat_isa_features[PROPERTY_VALUE_MAX]; @@ -803,6 +811,7 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name, + (have_dex2oat_Xms_flag ? 2 : 0) + (have_dex2oat_Xmx_flag ? 2 : 0) + (have_dex2oat_compiler_filter_flag ? 1 : 0) + + (have_dex2oat_threads_flag ? 1 : 0) + (have_dex2oat_flags ? 1 : 0) + (have_dex2oat_swap_fd ? 1 : 0)]; int i = 0; @@ -835,6 +844,9 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name, if (have_dex2oat_flags) { argv[i++] = dex2oat_flags; } + if (have_dex2oat_threads_flag) { + argv[i++] = dex2oat_threads_arg; + } if (have_dex2oat_swap_fd) { argv[i++] = dex2oat_swap_fd; } |