OSDN Git Service

No quota-level details for public volumes.
authorJeff Sharkey <jsharkey@android.com>
Fri, 5 May 2017 21:37:26 +0000 (15:37 -0600)
committerJeff Sharkey <jsharkey@android.com>
Fri, 5 May 2017 21:37:29 +0000 (15:37 -0600)
Fall back to whatever statvfs() tells us.

Test: builds, boots
Bug: 37573475
Change-Id: I713564292d41797e80860d6aa739266d9799af7f

packages/SettingsLib/src/com/android/settingslib/deviceinfo/StorageMeasurement.java

index ea28fe6..5a57e69 100644 (file)
@@ -152,6 +152,12 @@ public class StorageMeasurement {
         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 @@ public class StorageMeasurement {
             return details;
         }
 
-
         final long finishTotal = SystemClock.elapsedRealtime();
         Log.d(TAG, "Measured total storage in " + (finishTotal - start) + "ms");