mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Show more debugging info: system memory, VM memory and disk space.
This commit is contained in:
@@ -10,6 +10,14 @@ import android.os.StatFs;
|
||||
|
||||
class AndroidFileUtils implements FileUtils {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public long getTotalSpace(File f) throws IOException {
|
||||
if(Build.VERSION.SDK_INT >= 9) return f.getTotalSpace();
|
||||
StatFs s = new StatFs(f.getAbsolutePath());
|
||||
// These deprecated methods are the best thing available for SDK < 9
|
||||
return (long) s.getBlockCount() * s.getBlockSize();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public long getFreeSpace(File f) throws IOException {
|
||||
if(Build.VERSION.SDK_INT >= 9) return f.getUsableSpace();
|
||||
|
||||
Reference in New Issue
Block a user