From 302d201d195922f2b779da6bc7789999ebeae686 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 1 Jan 2023 10:25:36 +0100 Subject: [PATCH] Zip larger log files only --- app/src/main/java/eu/faircode/email/Log.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Log.java b/app/src/main/java/eu/faircode/email/Log.java index 8578e78c43..e4b0983543 100644 --- a/app/src/main/java/eu/faircode/email/Log.java +++ b/app/src/main/java/eu/faircode/email/Log.java @@ -174,6 +174,7 @@ public class Log { private static final long MAX_LOG_SIZE = 8 * 1024 * 1024L; private static final int MAX_CRASH_REPORTS = (BuildConfig.TEST_RELEASE ? 50 : 5); private static final long MIN_FILE_SIZE = 1024 * 1024L; + private static final long MIN_ZIP_SIZE = 1024 * 1024L; private static final String TAG = "fairemail"; // https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html @@ -2631,7 +2632,7 @@ public class Log { } db.attachment().setDownloaded(attachment.id, size); - if (!BuildConfig.DEBUG) + if (!BuildConfig.DEBUG && size > MIN_ZIP_SIZE) attachment.zip(context); } catch (Throwable ex) { Log.e(ex); @@ -2741,7 +2742,7 @@ public class Log { } db.attachment().setDownloaded(attachment.id, size); - if (!BuildConfig.DEBUG) + if (!BuildConfig.DEBUG && size > MIN_ZIP_SIZE) attachment.zip(context); } finally { if (proc != null)