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
diff --git a/cmds/installd/InstalldNativeService.h b/cmds/installd/InstalldNativeService.h
index cad9e43..5397a74 100644
--- a/cmds/installd/InstalldNativeService.h
+++ b/cmds/installd/InstalldNativeService.h
@@ -55,10 +55,16 @@
const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode);
binder::Status destroyAppData(const std::unique_ptr<std::string>& uuid,
const std::string& packageName, int32_t userId, int32_t flags, int64_t ceDataInode);
+
binder::Status getAppSize(const std::unique_ptr<std::string>& uuid,
- const std::string& packageName, int32_t userId, int32_t flags, int32_t appId,
- int64_t ceDataInode, const std::string& codePath,
- const std::unique_ptr<std::string>& externalUuid, std::vector<int64_t>* _aidl_return);
+ const std::vector<std::string>& packageNames, int32_t userId, int32_t flags,
+ int32_t appId, const std::vector<int64_t>& ceDataInodes,
+ const std::vector<std::string>& codePaths, std::vector<int64_t>* _aidl_return);
+ binder::Status getUserSize(const std::unique_ptr<std::string>& uuid,
+ int32_t userId, int32_t flags, const std::vector<int32_t>& appIds,
+ std::vector<int64_t>* _aidl_return);
+ binder::Status getExternalSize(const std::unique_ptr<std::string>& uuid,
+ int32_t userId, int32_t flags, std::vector<int64_t>* _aidl_return);
binder::Status moveCompleteApp(const std::unique_ptr<std::string>& fromUuid,
const std::unique_ptr<std::string>& toUuid, const std::string& packageName,