From 1940e4579935a1313b5456e6c2e67e62457d7ab6 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 28 Dec 2020 16:10:33 +0100 Subject: [PATCH] Added purge wakelock --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 25f0f0014f..5d6051ece2 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1360,7 +1360,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences forced = true; - Runnable purge = new Runnable() { + final Runnable purge = new Runnable() { private Long lastQuota = null; @Override @@ -1369,6 +1369,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences @Override public void run() { try { + wlFolder.acquire(); + // Get quota if (iservice.hasCapability("QUOTA")) { long now = new Date().getTime(); @@ -1405,6 +1407,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences ((IMAPStore) istore).emptyConnectionPool(false); } catch (Throwable ex) { Log.e(ex); + } finally { + wlFolder.release(); } } });