Show app storage space

This commit is contained in:
M66B
2021-01-22 15:01:20 +01:00
parent 551e37c009
commit c89717a5e6
4 changed files with 63 additions and 21 deletions

View File

@@ -1218,6 +1218,18 @@ public class Helper {
return stats.getTotalBytes();
}
static long getSize(File dir) {
long size = 0;
File[] listed = dir.listFiles();
if (listed != null)
for (File file : listed)
if (file.isDirectory())
size += getSize(file);
else
size += file.length();
return size;
}
static void openAdvanced(Intent intent) {
// https://issuetracker.google.com/issues/72053350
intent.putExtra("android.content.extra.SHOW_ADVANCED", true);