From df7ddc32ceb494adc8642c04f965537d9616465b Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 4 May 2022 10:47:23 +0200 Subject: [PATCH] Debug info: added file system stores --- app/src/main/java/eu/faircode/email/Log.java | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index e0ac5b77fd..8c013c9901 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -116,6 +116,8 @@ import java.net.SocketException; import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.nio.charset.StandardCharsets; +import java.nio.file.FileStore; +import java.nio.file.FileSystems; import java.security.KeyStore; import java.security.Provider; import java.security.Security; @@ -1913,6 +1915,25 @@ public class Log { sb.append("\r\n"); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) + try { + for (FileStore store : FileSystems.getDefault().getFileStores()) + if (!store.isReadOnly() && + store.getUsableSpace() != 0 && + !"tmpfs".equals(store.type())) { + long total = store.getTotalSpace(); + long unalloc = store.getUnallocatedSpace(); + sb.append(String.format("%s %s %s/%s\r\n", + store, + store.type(), + Helper.humanReadableByteCount(total - unalloc), + Helper.humanReadableByteCount(total))); + } + sb.append("\r\n"); + } catch (IOException ex) { + sb.append(ex).append("\r\n"); + } + WindowManager wm = Helper.getSystemService(context, WindowManager.class); Display display = wm.getDefaultDisplay(); Point dim = new Point();