Fix DataStoragePlaceDialogFragment

This commit is contained in:
Alexey Kulish 2015-10-25 17:42:00 +03:00
parent 7c069b249f
commit 092a710e0a

View file

@ -122,12 +122,12 @@ public class DataStoragePlaceDialogFragment extends DialogFragment {
if (dir.canRead()) {
StatFs fs = new StatFs(dir.getAbsolutePath());
@SuppressWarnings("deprecation")
int size = fs.getAvailableBlocks() * fs.getBlockSize();
float size = (float) fs.getAvailableBlocks() * fs.getBlockSize();
if (size > 0) {
if (size > 1 << 20) {
sz = DownloadActivity.formatGb.format(new Object[]{(float) size / (1 << 30)});
sz = DownloadActivity.formatGb.format(new Object[]{size / (1 << 30)});
} else {
sz = DownloadActivity.formatMb.format(new Object[]{(float) size / (1 << 20)});
sz = DownloadActivity.formatMb.format(new Object[]{size / (1 << 20)});
}
}
}