From 866c87364938e881f49f68c756f472261eb3f28a Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 14 Feb 2020 18:16:57 +0100 Subject: [PATCH] Stop retrying when polling --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 6272a220c5..2461ad4d20 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1469,6 +1469,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences Log.w(account.name + " backoff " + ex.toString()); } } else { + // Stop retrying when polling + int pollInterval = prefs.getInt("poll_interval", 0); + if (pollInterval > 0 && !account.poll_exempted) + break; + // Long back-off period, let device sleep Intent intent = new Intent(ServiceSynchronize.this, ServiceSynchronize.class); intent.setAction("backoff:" + account.id);