diff options
author | Brian Carlstrom <bdc@google.com> | 2014-08-29 11:39:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-08-29 11:39:54 +0000 |
commit | ad2a4083fe4010c282999a2c3a8795665ae6a5e9 (patch) | |
tree | e8ccca74a0d4c14e8bfa487b7091cf161400969d /cmds/installd | |
parent | 93b1369e5d1d71749165aeba31d987f2c9ef6729 (diff) | |
parent | 8c1642ad4ea8fbeb7d03f30e5f50e03c28d40065 (diff) | |
download | frameworks_native-ad2a4083fe4010c282999a2c3a8795665ae6a5e9.zip frameworks_native-ad2a4083fe4010c282999a2c3a8795665ae6a5e9.tar.gz frameworks_native-ad2a4083fe4010c282999a2c3a8795665ae6a5e9.tar.bz2 |
am 8c1642ad: Merge "Remove obsolete prunedexcache"
* commit '8c1642ad4ea8fbeb7d03f30e5f50e03c28d40065':
Remove obsolete prunedexcache
Diffstat (limited to 'cmds/installd')
-rw-r--r-- | cmds/installd/commands.c | 47 | ||||
-rw-r--r-- | cmds/installd/installd.c | 7 | ||||
-rw-r--r-- | cmds/installd/installd.h | 1 |
3 files changed, 0 insertions, 55 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 0f62aeb..e06cddd 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -1537,50 +1537,3 @@ int restorecon_data(const char* pkgName, const char* seinfo, uid_t uid) return ret; } -static int prune_dex_exclusion_predicate(const char *file_name, const int is_dir) -{ - // Exclude all directories. The top level command will be - // given a list of ISA specific directories that are assumed - // to be flat. - if (is_dir) { - return 1; - } - - - // Don't exclude regular files that start with the list - // of prefixes. - static const char data_app_prefix[] = "data@app@"; - static const char data_priv_app_prefix[] = "data@priv-app@"; - if (!strncmp(file_name, data_app_prefix, sizeof(data_app_prefix) - 1) || - !strncmp(file_name, data_priv_app_prefix, sizeof(data_priv_app_prefix) - 1)) { - return 0; - } - - // Exclude all regular files that don't start with the prefix "data@app@" or - // "data@priv-app@". - return 1; -} - -int prune_dex_cache(const char* subdir) { - // "." is handled as a special case, and refers to - // DALVIK_CACHE_PREFIX (usually /data/dalvik-cache). - const bool is_dalvik_cache_root = !strcmp(subdir, "."); - - // Don't allow the path to contain "." or ".." except for the - // special case above. This is much stricter than we need to be, - // but there's no good reason to support them. - if (strchr(subdir, '.' ) != NULL && !is_dalvik_cache_root) { - return -1; - } - - if (!is_dalvik_cache_root) { - char full_path[PKG_PATH_MAX]; - snprintf(full_path, sizeof(full_path), "%s%s", DALVIK_CACHE_PREFIX, subdir); - return delete_dir_contents(full_path, 0, &prune_dex_exclusion_predicate); - } - - - // When subdir == ".", clean the contents of the top level - // dalvik-cache directory. - return delete_dir_contents(DALVIK_CACHE_PREFIX, 0, &prune_dex_exclusion_predicate); -} diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index c06365d..c7fdf7a 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -145,12 +145,6 @@ static int do_restorecon_data(char **arg, char reply[REPLY_MAX] __attribute__((u /* pkgName, seinfo, uid*/ } -static int do_prune_dex_cache(char **arg __attribute__((unused)), - char reply[REPLY_MAX] __attribute__((unused))) -{ - return prune_dex_cache(arg[0] /* subdirectory name */); -} - static int do_patchoat(char **arg, char reply[REPLY_MAX]) { /* 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); @@ -183,7 +177,6 @@ struct cmdinfo cmds[] = { { "rmuser", 1, do_rm_user }, { "idmap", 3, do_idmap }, { "restorecondata", 3, do_restorecon_data }, - { "prunedexcache", 1, do_prune_dex_cache }, { "patchoat", 5, do_patchoat }, }; diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index c1d0148..99f037c 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -222,4 +222,3 @@ int movefiles(); int linklib(const char* target, const char* source, int userId); int idmap(const char *target_path, const char *overlay_path, uid_t uid); int restorecon_data(); -int prune_dex_cache(const char* subdir); |