From 4b0155ac0804efd287deee2b1104bcc28bc7438d Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 24 Feb 2021 08:14:58 +0100 Subject: [PATCH] Always IDLE --- .../eu/faircode/email/ServiceSynchronize.java | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index ec034f9a65..0f23b785e2 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1325,32 +1325,30 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences }); // Idle folder - if (!account.isTransient(this)) { - Thread idler = new Thread(new Runnable() { - @Override - public void run() { - try { - Log.i(folder.name + " start idle"); - while (ifolder.isOpen() && state.isRunning() && state.isRecoverable()) { - Log.i(folder.name + " do idle"); - ifolder.idle(false); - state.activity(); - } - } catch (Throwable ex) { - Log.e(folder.name, ex); - EntityLog.log( - ServiceSynchronize.this, - folder.name + " " + Log.formatThrowable(ex, false)); - state.error(new FolderClosedException(ifolder, "IDLE", new Exception(ex))); - } finally { - Log.i(folder.name + " end idle"); + Thread idler = new Thread(new Runnable() { + @Override + public void run() { + try { + Log.i(folder.name + " start idle"); + while (ifolder.isOpen() && state.isRunning() && state.isRecoverable()) { + Log.i(folder.name + " do idle"); + ifolder.idle(false); + state.activity(); } + } catch (Throwable ex) { + Log.e(folder.name, ex); + EntityLog.log( + ServiceSynchronize.this, + folder.name + " " + Log.formatThrowable(ex, false)); + state.error(new FolderClosedException(ifolder, "IDLE", new Exception(ex))); + } finally { + Log.i(folder.name + " end idle"); } - }, "idler." + folder.id); - idler.setPriority(THREAD_PRIORITY_BACKGROUND); - idler.start(); - idlers.add(idler); - } + } + }, "idler." + folder.id); + idler.setPriority(THREAD_PRIORITY_BACKGROUND); + idler.start(); + idlers.add(idler); EntityOperation.sync(this, folder.id, false, force && !forced);