diff options
author | Calin Juravle <calin@google.com> | 2014-08-27 15:50:16 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-08-27 15:50:17 +0000 |
commit | f6e1611a8d7990779152539e866bf8524527469f (patch) | |
tree | 1bfd2d5c0a3ac9db96e9934617a75d7692522b58 /cmds/installd/commands.c | |
parent | c70626a1ef18ef316a633ba0e399dbdf8f85973a (diff) | |
parent | 4f60ac2bbc3c7fe502348a0739481287adff443c (diff) | |
download | frameworks_native-f6e1611a8d7990779152539e866bf8524527469f.zip frameworks_native-f6e1611a8d7990779152539e866bf8524527469f.tar.gz frameworks_native-f6e1611a8d7990779152539e866bf8524527469f.tar.bz2 |
Merge "Add vm_safe_mode to dexopt."
Diffstat (limited to 'cmds/installd/commands.c')
-rw-r--r-- | cmds/installd/commands.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 7de29de..8d7ddc1 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -663,7 +663,8 @@ static void run_patchoat(int input_fd, int oat_fd, const char* input_file_name, } static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name, - const char* output_file_name, const char *pkgname, const char *instruction_set) + const char* output_file_name, const char *pkgname, const char *instruction_set, + bool vm_safe_mode) { static const unsigned int MAX_INSTRUCTION_SET_LEN = 7; @@ -755,6 +756,9 @@ static void run_dex2oat(int zip_fd, int oat_fd, const char* input_file_name, if (skip_compilation) { strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=verify-none"); have_dex2oat_compiler_filter_flag = true; + } else if (vm_safe_mode) { + strcpy(dex2oat_compiler_filter_arg, "--compiler-filter=interpret-only"); + have_dex2oat_compiler_filter_flag = true; } else if (have_dex2oat_compiler_filter_flag) { sprintf(dex2oat_compiler_filter_arg, "--compiler-filter=%s", dex2oat_compiler_filter_flag); } @@ -832,9 +836,9 @@ static int wait_child(pid_t pid) } } -int dexopt(const char *apk_path, uid_t uid, int is_public, +int dexopt(const char *apk_path, uid_t uid, bool is_public, const char *pkgname, const char *instruction_set, - int is_patchoat) + bool vm_safe_mode, bool is_patchoat) { struct utimbuf ut; struct stat input_stat, dex_stat; @@ -968,7 +972,8 @@ int dexopt(const char *apk_path, uid_t uid, int is_public, if (is_patchoat) { run_patchoat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set); } else { - run_dex2oat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set); + run_dex2oat(input_fd, out_fd, input_file, out_path, pkgname, instruction_set, + vm_safe_mode); } } else { exit(69); /* Unexpected persist.sys.dalvik.vm.lib value */ |