From 23107350ea9ce1eb88f1246653c06860024addc3 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 6 May 2020 10:59:42 +0200 Subject: [PATCH] Enforce minimum keep alive / poll interval --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 2 +- app/src/main/java/eu/faircode/email/FragmentPop.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 40092ee614..5ad6cb2edb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -1114,7 +1114,7 @@ public class FragmentAccount extends FragmentBase { account.keep_alive_failed = 0; account.keep_alive_succeeded = 0; } - account.poll_interval = poll_interval; + account.poll_interval = Math.max(1, poll_interval); account.partial_fetch = partial_fetch; account.ignore_size = ignore_size; diff --git a/app/src/main/java/eu/faircode/email/FragmentPop.java b/app/src/main/java/eu/faircode/email/FragmentPop.java index b261d4282a..8e414e1787 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPop.java +++ b/app/src/main/java/eu/faircode/email/FragmentPop.java @@ -379,7 +379,7 @@ public class FragmentPop extends FragmentBase { account.leave_deleted = leave_deleted; account.leave_on_device = leave_device; account.max_messages = (TextUtils.isEmpty(max) ? null : Integer.parseInt(max)); - account.poll_interval = Integer.parseInt(interval); + account.poll_interval = Math.max(1, Integer.parseInt(interval)); if (!update) account.created = now;