Loading cmds/installd/InstalldNativeService.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -961,6 +961,10 @@ binder::Status InstalldNativeService::freeCache(const std::unique_ptr<std::strin add_cache_files(cache, StringPrintf("%s/Android/data", create_data_media_path(uuid_, user).c_str())); } // Add files from /data/preloads/file_cache if (uuid == nullptr) { add_preloads_file_cache(cache, uuid_); } ATRACE_END(); ATRACE_BEGIN("clear"); Loading cmds/installd/utils.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1003,6 +1003,21 @@ void add_cache_files(cache_t* cache, const std::string& data_path) { closedir(d); } void add_preloads_file_cache(cache_t* cache, const char* volume_uuid) { char dirname[PATH_MAX]; DIR* subdir; auto cache_path = StringPrintf("%s/preloads/file_cache", create_data_path(volume_uuid).c_str()); strcpy(dirname, cache_path.c_str()); CACHE_NOISY(ALOGI("add_preloads_file_cache: dirname=%s\n", dirname)); subdir = opendir(dirname); if (subdir != NULL) { size_t dirnameLen = strlen(dirname); _add_cache_files(cache, NULL, dirname, subdir, dirname, dirname + dirnameLen, PATH_MAX - dirnameLen); closedir(subdir); } } static char *create_dir_path(char path[PATH_MAX], cache_dir_t* dir) { char *pos = path; Loading cmds/installd/utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ std::string read_path_inode(const std::string& parent, const char* name, const c void add_cache_files(cache_t* cache, const std::string& data_path); void add_preloads_file_cache(cache_t* cache, const char* volume_uuid); void clear_cache_files(const std::string& data_path, cache_t* cache, int64_t free_size); void finish_cache_collection(cache_t* cache); Loading Loading
cmds/installd/InstalldNativeService.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -961,6 +961,10 @@ binder::Status InstalldNativeService::freeCache(const std::unique_ptr<std::strin add_cache_files(cache, StringPrintf("%s/Android/data", create_data_media_path(uuid_, user).c_str())); } // Add files from /data/preloads/file_cache if (uuid == nullptr) { add_preloads_file_cache(cache, uuid_); } ATRACE_END(); ATRACE_BEGIN("clear"); Loading
cmds/installd/utils.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -1003,6 +1003,21 @@ void add_cache_files(cache_t* cache, const std::string& data_path) { closedir(d); } void add_preloads_file_cache(cache_t* cache, const char* volume_uuid) { char dirname[PATH_MAX]; DIR* subdir; auto cache_path = StringPrintf("%s/preloads/file_cache", create_data_path(volume_uuid).c_str()); strcpy(dirname, cache_path.c_str()); CACHE_NOISY(ALOGI("add_preloads_file_cache: dirname=%s\n", dirname)); subdir = opendir(dirname); if (subdir != NULL) { size_t dirnameLen = strlen(dirname); _add_cache_files(cache, NULL, dirname, subdir, dirname, dirname + dirnameLen, PATH_MAX - dirnameLen); closedir(subdir); } } static char *create_dir_path(char path[PATH_MAX], cache_dir_t* dir) { char *pos = path; Loading
cmds/installd/utils.h +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ std::string read_path_inode(const std::string& parent, const char* name, const c void add_cache_files(cache_t* cache, const std::string& data_path); void add_preloads_file_cache(cache_t* cache, const char* volume_uuid); void clear_cache_files(const std::string& data_path, cache_t* cache, int64_t free_size); void finish_cache_collection(cache_t* cache); Loading