No quota-level details for public volumes.
Fall back to whatever statvfs() tells us.
Test: builds, boots
Bug: 37573475
Change-Id: I713564292d41797e80860d6aa739266d9799af7f
diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java
index ea28fe6..5a57e69 100644
--- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java
+++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java
@@ -152,6 +152,12 @@
final MeasurementDetails details = new MeasurementDetails();
if (mVolume == null) return details;
+ if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC) {
+ details.totalSize = mVolume.getPath().getTotalSpace();
+ details.availSize = mVolume.getPath().getUsableSpace();
+ return details;
+ }
+
try {
details.totalSize = mStats.getTotalBytes(mVolume.fsUuid);
details.availSize = mStats.getFreeBytes(mVolume.fsUuid);
@@ -161,7 +167,6 @@
return details;
}
-
final long finishTotal = SystemClock.elapsedRealtime();
Log.d(TAG, "Measured total storage in " + (finishTotal - start) + "ms");