diff options
author | Alex Light <allight@google.com> | 2014-08-28 16:17:04 -0700 |
---|---|---|
committer | Alex Light <allight@google.com> | 2014-08-28 23:30:52 +0000 |
commit | 5f727f86942a188354c028356f1167794fdc8655 (patch) | |
tree | 15482f60c785cbca4a46e6068e80299ece6a0105 /cmds/installd/commands.c | |
parent | f6e1611a8d7990779152539e866bf8524527469f (diff) | |
download | frameworks_native-5f727f86942a188354c028356f1167794fdc8655.zip frameworks_native-5f727f86942a188354c028356f1167794fdc8655.tar.gz frameworks_native-5f727f86942a188354c028356f1167794fdc8655.tar.bz2 |
Remove obsolete prunedexcache
Bug: 16875245
Change-Id: I06e14c405aa4af295795982c1d236be3cb00e893
Diffstat (limited to 'cmds/installd/commands.c')
-rw-r--r-- | cmds/installd/commands.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 8d7ddc1..a347fa8 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -1531,50 +1531,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); -} |