Added total storage space

pull/170/head
M66B 5 years ago
parent 7b4b7449c1
commit 9465aaca5f

@ -296,7 +296,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvMemoryClass.setText(getString(R.string.title_advanced_memory_class, class_mb + " MB"));
tvStorageSpace.setText(getString(R.string.title_advanced_storage_space,
Helper.humanReadableByteCount(Helper.getAvailableStorageSpace(), true)));
Helper.humanReadableByteCount(Helper.getAvailableStorageSpace(), true),
Helper.humanReadableByteCount(Helper.getTotalStorageSpace(), true)));
tvFingerprint.setText(Helper.getFingerprint(getContext()));
grpDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);

@ -614,6 +614,11 @@ public class Helper {
return stats.getAvailableBlocksLong() * stats.getBlockSizeLong();
}
static long getTotalStorageSpace() {
StatFs stats = new StatFs(Environment.getDataDirectory().getAbsolutePath());
return stats.getTotalBytes();
}
static void openAdvanced(Intent intent) {
// https://issuetracker.google.com/issues/72053350
intent.putExtra("android.content.extra.SHOW_ADVANCED", true);

@ -775,8 +775,9 @@ public class Log {
ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
sb.append(String.format("Memory class: %d\r\n", am.getMemoryClass()));
sb.append(String.format("Storage space: %s\r\n",
Helper.humanReadableByteCount(Helper.getAvailableStorageSpace(), true)));
sb.append(String.format("Storage space: %s/%s\r\n",
Helper.humanReadableByteCount(Helper.getAvailableStorageSpace(), true),
Helper.humanReadableByteCount(Helper.getTotalStorageSpace(), true)));
Runtime rt = Runtime.getRuntime();
long hused = (rt.totalMemory() - rt.freeMemory()) / 1024L;

@ -361,7 +361,7 @@
<string name="title_advanced_cleanup">Cleanup</string>
<string name="title_advanced_processors" translatable="false">Processors: %1$d</string>
<string name="title_advanced_memory_class" translatable="false">Memory class: %1$s</string>
<string name="title_advanced_storage_space" translatable="false">Storage space: %1$s</string>
<string name="title_advanced_storage_space" translatable="false">Storage space: %1$s/%2$s</string>
<string name="title_advanced_last_cleanup">Last cleanup: %1$s</string>
<string name="title_advanced_hint">All settings have sensible default values, which should only be changed if necessary</string>

Loading…
Cancel
Save