installd: Add support for SELF_PATCHOAT_NEEDED.

Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
diff --git a/cmds/installd/installd.cpp b/cmds/installd/installd.cpp
index ad2478b..fefb1b7 100644
--- a/cmds/installd/installd.cpp
+++ b/cmds/installd/installd.cpp
@@ -38,10 +38,10 @@
 
 static int do_dexopt(char **arg, char reply[REPLY_MAX] __unused)
 {
-    /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate
-       debuggable, outputPath */
-    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]), 0,
-                  atoi(arg[6]), arg[7]);
+    /* apk_path, uid, is_public, pkgname, instruction_set,
+     * dexopt_needed, vm_safe_mode, debuggable, oat_dir */
+    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], atoi(arg[5]),
+                  atoi(arg[6]), atoi(arg[7]), arg[8]);
 }
 
 static int do_mark_boot_complete(char **arg, char reply[REPLY_MAX] __unused)
@@ -152,12 +152,6 @@
                              /* pkgName, seinfo, uid*/
 }
 
-static int do_patchoat(char **arg, char reply[REPLY_MAX] __unused) {
-    /* apk_path, uid, is_public, pkgname, instruction_set, vm_safe_mode, should_relocate,
-       debuggable, outputPath */
-    return dexopt(arg[0], atoi(arg[1]), atoi(arg[2]), arg[3], arg[4], 0, 1, 0, "!");
-}
-
 static int do_create_oat_dir(char **arg, char reply[REPLY_MAX] __unused)
 {
     /* oat_dir, instruction_set */
@@ -179,7 +173,7 @@
 struct cmdinfo cmds[] = {
     { "ping",                 0, do_ping },
     { "install",              4, do_install },
-    { "dexopt",               8, do_dexopt },
+    { "dexopt",               9, do_dexopt },
     { "markbootcomplete",     1, do_mark_boot_complete },
     { "movedex",              3, do_move_dex },
     { "rmdex",                2, do_rm_dex },
@@ -198,7 +192,6 @@
     { "rmuser",               1, do_rm_user },
     { "idmap",                3, do_idmap },
     { "restorecondata",       3, do_restorecon_data },
-    { "patchoat",             5, do_patchoat },
     { "createoatdir",         2, do_create_oat_dir },
     { "rmpackagedir",         1, do_rm_package_dir},
 };