8dedad31f7fa604028ee6d28963bcc564e76c467 |
|
10-Jan-2017 |
Jeff Sharkey <jsharkey@android.com> |
Wire up storage stats API to installd. Now that installd has the implementation details we need, we can wire up the public APIs to use them. Shuffle APIs around a bit so that StorageStats can be reused for both UID and UserHandle results, and rename StorageSummary to ExternalStorageStats. Provide getTotalBytes() and getFreeBytes() as first-class methods so we can answer those questions quickly without paying the cost of measuring external storage details. Current costs on a typical device with a test account after flushing dentry caches: queryStatsForUid() manual: 6922ms queryStatsForUid() quota: 525ms queryStatsForUser() manual: 1686ms queryStatsForUser() quota: 113ms queryExternalStatsForUser() manual: 42ms queryExternalStatsForUser() quota: 2ms For verification purposes, a new "fw.verify_storage" system property can be set to compute both manual and quota statistics, and log any discrepancies. Test: builds, boots Bug: 27948817, 32206268 Change-Id: I4ea3df3372a7379aa8cf4c20c44120c8f0702c15
/frameworks/base/core/java/android/app/usage/ExternalStorageStats.aidl
|