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

Commit c75d1521 authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Fix external size calculations"

parents b2a85b69 61942c57
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -541,9 +541,9 @@ public class DefaultContainerService extends IntentService {

        final int availSdMb;
        if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
            StatFs sdStats = new StatFs(Environment.getExternalStorageDirectory().getPath());
            long availSdSize = (long) (sdStats.getAvailableBlocks() * sdStats.getBlockSize());
            availSdMb = (int) (availSdSize >> 20);
            final StatFs sdStats = new StatFs(Environment.getExternalStorageDirectory().getPath());
            final int blocksToMb = (1 << 20) / sdStats.getBlockSize();
            availSdMb = sdStats.getAvailableBlocks() * blocksToMb;
        } else {
            availSdMb = -1;
        }