Offer to delete code cache directories.
Bug: 16187224
Change-Id: Ia860b051a34ffdfb4f6e0ea19f90cb73509c4eee
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c
index 41a8f30..ba8edf2 100644
--- a/cmds/installd/commands.c
+++ b/cmds/installd/commands.c
@@ -310,10 +310,21 @@
if (create_pkg_path(cachedir, pkgname, CACHE_DIR_POSTFIX, userid))
return -1;
- /* delete contents, not the directory, no exceptions */
+ /* delete contents, not the directory, no exceptions */
return delete_dir_contents(cachedir, 0, NULL);
}
+int delete_code_cache(const char *pkgname, userid_t userid)
+{
+ char codecachedir[PKG_PATH_MAX];
+
+ if (create_pkg_path(codecachedir, pkgname, CODE_CACHE_DIR_POSTFIX, userid))
+ return -1;
+
+ /* delete contents, not the directory, no exceptions */
+ return delete_dir_contents(codecachedir, 0, NULL);
+}
+
/* Try to ensure free_size bytes of storage are available.
* Returns 0 on success.
* This is rather simple-minded because doing a full LRU would