From c5dfc0b670b89da49576c589616915afd159e885 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 26 Jan 2022 16:49:51 +0100 Subject: [PATCH] Log insufficient storage space --- app/src/main/java/eu/faircode/email/EntityLog.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityLog.java b/app/src/main/java/eu/faircode/email/EntityLog.java index bbd73ce279..8648d61044 100644 --- a/app/src/main/java/eu/faircode/email/EntityLog.java +++ b/app/src/main/java/eu/faircode/email/EntityLog.java @@ -119,9 +119,19 @@ public class EntityLog { // Check available storage space if (!ok || (++count % LOG_DELETE_BATCH_SIZE) == 0) { long cake = Helper.getAvailableStorageSpace(); + boolean wasOk = ok; ok = (cake < Helper.MIN_REQUIRED_SPACE); if (!ok) - return; + if (wasOk) { + entry.type = Type.General; + entry.account = null; + entry.folder = null; + entry.message = null; + entry.data = "Insufficient storage space=" + + Helper.humanReadableByteCount(cake) + "/" + + Helper.humanReadableByteCount(Helper.MIN_REQUIRED_SPACE); + } else + return; } try {