Add more sane multi-profile app attribution.

Due to issues w.r.t. attribution across multiple users, we originally
duplicated the previous implementation which zeroed out the sizes. This,
however, caused system bloat due to the change in how we calculate the
system size.

By attributing apps which do not exist in the primary profile to the
first user that shows up with it installed, we can avoid accidentally
attributing it to the system size.

Bug: 62623731
Test: Settings unittest & Settings robotest
Change-Id: I9514c9ecef62ea6270723f62e6bf27c69b75f180
This commit is contained in:
Daniel Nishi
2017-06-15 17:19:31 -07:00
parent 327b9119d7
commit b088010d12
5 changed files with 60 additions and 25 deletions

View File

@@ -96,7 +96,13 @@ public class UserProfileController extends PreferenceController
int userId = mUser.id;
StorageAsyncLoader.AppsStorageResult result = stats.get(userId);
if (result != null) {
setSize(result.externalStats.totalBytes, mTotalSizeBytes);
setSize(
result.externalStats.totalBytes
+ result.otherAppsSize
+ result.videoAppsSize
+ result.musicAppsSize
+ result.gamesSize,
mTotalSizeBytes);
}
}