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

Commit a89a837c authored by xiaogang's avatar xiaogang Committed by Steve Kondik
Browse files

framework: packageinstaller :fix logical error in size calculation

fix logical error in available size calculation.

Change-Id: Ic6ce312cf1c146030a20187fcb27b24fbe4c321a
parent 82289c1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -854,7 +854,7 @@ public class DefaultContainerService extends IntentService {
        if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
        if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
            final StatFs sdStats = new StatFs(Environment.getExternalStorageDirectory().getPath());
            final StatFs sdStats = new StatFs(Environment.getExternalStorageDirectory().getPath());
            final int blocksToMb = (1 << 20) / sdStats.getBlockSize();
            final int blocksToMb = (1 << 20) / sdStats.getBlockSize();
            availSdMb = sdStats.getAvailableBlocks() * blocksToMb;
            availSdMb = sdStats.getAvailableBlocks() / blocksToMb;
        } else {
        } else {
            availSdMb = -1;
            availSdMb = -1;
        }
        }