Add an installd command to prune dex files.
This is a straightforward port of logic from
PackageManagerService#pruneDexFiles.
bug: 14407732
Change-Id: I892cff027ddcbb1a4fb37a7af5ecf1697049a188
diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c
index 10bf5fa..6775284 100644
--- a/cmds/installd/installd.c
+++ b/cmds/installd/installd.c
@@ -135,6 +135,12 @@
/* pkgName, seinfo, uid*/
}
+static int do_prune_dex_cache(char **arg __attribute__((unused)),
+ char reply[REPLY_MAX] __attribute__((unused)))
+{
+ return prune_dex_cache();
+}
+
struct cmdinfo {
const char *name;
unsigned numargs;
@@ -160,6 +166,7 @@
{ "rmuser", 1, do_rm_user },
{ "idmap", 3, do_idmap },
{ "restorecondata", 3, do_restorecon_data },
+ { "prunedexcache", 0, do_prune_dex_cache },
};
static int readx(int s, void *_buf, int count)