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
This commit is contained in:
Edgar Wang
2023-08-15 19:48:13 +08:00
parent 3bf2649386
commit 2d57d002ae
5 changed files with 4 additions and 24 deletions

View File

@@ -75,9 +75,7 @@ public class TopLevelStoragePreferenceController extends BasePreferenceControlle
final PrivateStorageInfo info = PrivateStorageInfo.getPrivateStorageInfo(
getStorageManagerVolumeProvider());
// TODO(b/288103116): replace with new API to get TotalBytes before rounding
// once support by StorageManager.
long usedBytes = Utils.getPrimaryStorageSize() - info.freeBytes;
long usedBytes = info.totalBytes - info.freeBytes;
storageCacheHelper.cacheUsedSize(usedBytes);
ThreadUtils.postOnMainThread(() -> {
preference.setSummary(