Merge "Update the API usage to get total size of devices" into udc-qpr-dev am: 1bc145ab6b
am: 595db29382
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24434307 Change-Id: I276e74bc1534ec9253b886ceaf29dc5710a011fb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -211,9 +211,7 @@ public class StorageCategoryFragment 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);
|
||||
|
@@ -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);
|
||||
|
@@ -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(
|
||||
|
@@ -26,7 +26,6 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
import com.android.settingslib.widget.UsageProgressBarPreference;
|
||||
@@ -93,9 +92,7 @@ public class StorageUsageProgressBarPreferenceController extends BasePreferenceC
|
||||
if (mStorageEntry.isPrivate()) {
|
||||
// StorageStatsManager can only query private storages.
|
||||
mTotalBytes = mStorageStatsManager.getTotalBytes(mStorageEntry.getFsUuid());
|
||||
// TODO(b/288103116): replace with new API to get TotalBytes before rounding
|
||||
// once support by StorageManager.
|
||||
mUsedBytes = Utils.getPrimaryStorageSize()
|
||||
mUsedBytes = mTotalBytes
|
||||
- mStorageStatsManager.getFreeBytes(mStorageEntry.getFsUuid());
|
||||
} else {
|
||||
final File rootFile = mStorageEntry.getPath();
|
||||
|
Reference in New Issue
Block a user