Update the API usage to get total size of devices

StorageStatsManager fixed in StorageStatsService#getTotalBytes
So that we should change back to call the API.

Bug: 295358118
Bug: 288103116
Test: verified manually
Change-Id: I3dcc9698403612f961cf0de41925dcbcb43e260b
(cherry picked from commit 2d57d002ae)
This commit is contained in:
Edgar Wang
2023-08-15 19:48:13 +08:00
parent 3ec1e1f122
commit 4bd401adf4
5 changed files with 4 additions and 24 deletions

View File

@@ -387,9 +387,7 @@ public class StorageDashboardFragment extends DashboardFragment
setLoading(false /* loading */, false /* animate */);
// TODO(b/288103116): replace with new API to get TotalBytes before rounding
// once support by StorageManager.
final long privateUsedBytes = Utils.getPrimaryStorageSize() - mStorageInfo.freeBytes;
final long privateUsedBytes = mStorageInfo.totalBytes - mStorageInfo.freeBytes;
mPreferenceController.setVolume(mSelectedStorageEntry.getVolumeInfo());
mPreferenceController.setUsedSize(privateUsedBytes);
mPreferenceController.setTotalSize(mStorageInfo.totalBytes);