Installd: Add a delete_odex command
Add a command to delete odex files.
Bug: 31347757
Change-Id: I29bca8751bcee8d6981c682fbbc816c73b78ac68
(cherry picked from commit 3964da0636624ff9af42d1f316bed0752e37c490)
diff --git a/cmds/installd/installd.cpp b/cmds/installd/installd.cpp
index 531c6df..c81a339 100644
--- a/cmds/installd/installd.cpp
+++ b/cmds/installd/installd.cpp
@@ -418,6 +418,11 @@
return move_ab(arg[0], arg[1], arg[2]);
}
+static int do_delete_odex(char **arg, char reply[REPLY_MAX] ATTRIBUTE_UNUSED) {
+ // apk_path, instruction_set, oat_dir
+ return delete_odex(arg[0], arg[1], arg[2]) ? 0 : -1;
+}
+
struct cmdinfo {
const char *name;
unsigned numargs;
@@ -453,6 +458,7 @@
{ "move_ab", 3, do_move_ab },
{ "merge_profiles", 2, do_merge_profiles },
{ "dump_profiles", 3, do_dump_profiles },
+ { "delete_odex", 3, do_delete_odex },
};
static int readx(int s, void *_buf, int count)