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

Commit 61942c57 authored by Kenny Root's avatar Kenny Root
Browse files

Fix external size calculations

Unfortunately fixed internal size calculations for HC, but never the
external size calculations.

Bug: 5113898
Change-Id: Idfe8af0ba74a20aa767eb9abac431ee1c74dcf8e
parent 186c1683
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;
        }