Skip to content

Commit 60212b2

Browse files
authored
Merge pull request #5 from ath0mas/statfs-deprecated
Android: replace deprecated StatFs functions
2 parents f53f21b + 68856d5 commit 60212b2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/android/DirectoryManager.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ public static long getFreeExternalStorageSpace() {
8585
public static long getFreeSpaceInBytes(String path) {
8686
try {
8787
StatFs stat = new StatFs(path);
88-
long blockSize = stat.getBlockSize();
89-
long availableBlocks = stat.getAvailableBlocks();
90-
return availableBlocks * blockSize;
88+
return stat.getAvailableBytes();
9189
} catch (IllegalArgumentException e) {
9290
// The path was invalid. Just return 0 free bytes.
9391
return 0;

0 commit comments

Comments
 (0)