Debug info: added file system stores

This commit is contained in:
M66B 2022-05-04 10:47:23 +02:00
parent 975fdfe283
commit df7ddc32ce
1 changed files with 21 additions and 0 deletions

View File

@ -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();