From df2d754b38796e0c49c70e0a67f7d383e3079ff2 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Sat, 7 Jan 2017 09:19:35 -0700 Subject: Methods to calculate user and external disk usage. Add method to calculate user disk usage, which will be faster than making a Binder call for every single appId under a user. Add method to calculate external disk usage, which uses file extensions to track usage with "audio", "video", and "images" categories. Add script to generate optimized file extension matcher logic. Start measuring internal and external storage space separately; new GIDs are coming in a future CL. Pass down all package names, inodes, and code paths, since shared UIDs host more than one. Test: builds, boots, stats are consistent Bug: 27948817, 32206268 Change-Id: Icb9843ac5159e0e5f1503d9b64e0bcae407e1a5d --- cmds/installd/utils.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cmds/installd/utils.h') diff --git a/cmds/installd/utils.h b/cmds/installd/utils.h index ff041183cb..f2f0cbb030 100644 --- a/cmds/installd/utils.h +++ b/cmds/installd/utils.h @@ -30,6 +30,9 @@ #include +#define MEASURE_DEBUG 0 +#define MEASURE_EXTERNAL 0 + namespace android { namespace installd { @@ -86,13 +89,16 @@ std::string create_data_user_de_package_path(const char* volume_uuid, userid_t user, const char* package_name); std::string create_data_media_path(const char* volume_uuid, userid_t userid); +std::string create_data_media_obb_path(const char* volume_uuid, const char* package_name); std::string create_data_media_package_path(const char* volume_uuid, userid_t userid, const char* data_type, const char* package_name); std::string create_data_misc_legacy_path(userid_t userid); -std::string create_data_user_profiles_path(userid_t userid); +std::string create_data_user_profile_path(userid_t userid); std::string create_data_user_profile_package_path(userid_t user, const char* package_name); + +std::string create_data_ref_profile_path(); std::string create_data_ref_profile_package_path(const char* package_name); std::string create_data_dalvik_cache_path(); @@ -103,7 +109,7 @@ std::string create_primary_profile(const std::string& profile_dir); std::vector get_known_users(const char* volume_uuid); int calculate_tree_size(const std::string& path, int64_t* size, - gid_t include_gid = 0, gid_t exclude_gid = 0); + int32_t include_gid = -1, int32_t exclude_gid = -1, bool exclude_apps = false); int create_user_config_path(char path[PKG_PATH_MAX], userid_t userid); -- cgit v1.2.3-59-g8ed1b