From e73dc148c3d69e3e897bcadd66b30c8ea00d569a Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Tue, 19 Nov 2013 23:13:35 +0000
Subject: [PATCH] Avoid using a deprecated API if possible.

---
 briar-android/src/net/sf/briar/android/AndroidFileUtils.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/briar-android/src/net/sf/briar/android/AndroidFileUtils.java b/briar-android/src/net/sf/briar/android/AndroidFileUtils.java
index f7884c5b5e..d2ca8a92ca 100644
--- a/briar-android/src/net/sf/briar/android/AndroidFileUtils.java
+++ b/briar-android/src/net/sf/briar/android/AndroidFileUtils.java
@@ -4,12 +4,15 @@ import java.io.File;
 import java.io.IOException;
 
 import net.sf.briar.api.os.FileUtils;
+import android.os.Build;
 import android.os.StatFs;
 
 class AndroidFileUtils implements FileUtils {
 
 	public long getFreeSpace(File f) throws IOException {
 		StatFs s = new StatFs(f.getAbsolutePath());
+		if(Build.VERSION.SDK_INT >= 18)
+			return s.getAvailableBlocksLong() * s.getBlockSizeLong();
 		return (long) s.getAvailableBlocks() * s.getBlockSize();
 	}
 }
-- 
GitLab