Added option tolog memory usage

This commit is contained in:
M66B
2022-09-09 16:21:43 +02:00
parent c062a1c8ad
commit 44413bbab0
4 changed files with 35 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ package eu.faircode.email;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Debug;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
@@ -120,6 +121,13 @@ public class EntityLog {
if (!main_log)
return;
boolean main_log_memory = prefs.getBoolean("main_log_memory", false);
if (main_log_memory) {
long j = Log.getAvailableMb() - Log.getFreeMemMb();
long n = Debug.getNativeHeapSize() / 1024L / 1024L;
data = j + "/" + n + " " + data;
}
final EntityLog entry = new EntityLog();
entry.time = new Date().getTime();
entry.type = type;