Add vm_safe_mode to dexopt.

The flag enforces interpret-only flag for dex2oat.

Bug: 12457423

(cherry picked from commit b1efac103523efccbe671e76cc0eaaeab810415b)
(cherry picked from commit 97477d203eaf0c3235bbe2415356f20a0431cada)

Change-Id: I215339527e998b24e274c8df42a5024839e6a9fa
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 682aaff..fa52c60 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -38,8 +38,8 @@
 
 static int do_dexopt(char **arg, char reply[REPLY_MAX])
 {
-        /* apk_path, uid, is_public, pkgname, instruction_set */
-    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], 0);
+    /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate */
+    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0);
 }
 
 static int do_move_dex(char **arg, char reply[REPLY_MAX])
@@ -147,7 +147,8 @@
 }
 
 static int do_patchoat(char **arg, char reply[REPLY_MAX]) {
-    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], 1);
+    /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate */
+    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], 0, 1);
 }
 
 struct cmdinfo {
@@ -159,7 +160,7 @@
 struct cmdinfo cmds[] = {
     { "ping",                 0, do_ping },
     { "install",              4, do_install },
-    { "dexopt",               5, do_dexopt },
+    { "dexopt",               6, do_dexopt },
     { "movedex",              3, do_move_dex },
     { "rmdex",                2, do_rm_dex },
     { "remove",               2, do_remove },