Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 829bfe8c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

No quota-level details for public volumes.

Fall back to whatever statvfs() tells us.

Test: builds, boots
Bug: 37573475
Change-Id: I713564292d41797e80860d6aa739266d9799af7f
parent e44125cd
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -152,6 +152,12 @@ public class StorageMeasurement {
        final MeasurementDetails details = new MeasurementDetails();
        final MeasurementDetails details = new MeasurementDetails();
        if (mVolume == null) return details;
        if (mVolume == null) return details;


        if (mVolume.getType() == VolumeInfo.TYPE_PUBLIC) {
            details.totalSize = mVolume.getPath().getTotalSpace();
            details.availSize = mVolume.getPath().getUsableSpace();
            return details;
        }

        try {
        try {
            details.totalSize = mStats.getTotalBytes(mVolume.fsUuid);
            details.totalSize = mStats.getTotalBytes(mVolume.fsUuid);
            details.availSize = mStats.getFreeBytes(mVolume.fsUuid);
            details.availSize = mStats.getFreeBytes(mVolume.fsUuid);
@@ -161,7 +167,6 @@ public class StorageMeasurement {
            return details;
            return details;
        }
        }



        final long finishTotal = SystemClock.elapsedRealtime();
        final long finishTotal = SystemClock.elapsedRealtime();
        Log.d(TAG, "Measured total storage in " + (finishTotal - start) + "ms");
        Log.d(TAG, "Measured total storage in " + (finishTotal - start) + "ms");