From f2f94d0119787aae9691b29637a3af8c4d660917 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 31 Mar 2019 10:12:11 +0200 Subject: [PATCH] Suppress alert 'Too many simultaneous connections' --- .../eu/faircode/email/ServiceSynchronize.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 0f5e6cf77f..24435d64a3 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -518,15 +518,17 @@ public class ServiceSynchronize extends LifecycleService { public void notification(StoreEvent e) { try { wlAccount.acquire(); + String message = e.getMessage(); if (e.getMessageType() == StoreEvent.ALERT) { - Log.w(account.name + " alert: " + e.getMessage()); - db.account().setAccountError(account.id, e.getMessage()); - Core.reportError( - ServiceSynchronize.this, account, null, - new Core.AlertException(e.getMessage())); + Log.w(account.name + " alert: " + message); + db.account().setAccountError(account.id, message); + if (BuildConfig.DEBUG || + (message != null && !message.startsWith("Too many simultaneous connections"))) + Core.reportError(ServiceSynchronize.this, account, null, + new Core.AlertException(message)); state.error(); } else - Log.i(account.name + " notice: " + e.getMessage()); + Log.i(account.name + " notice: " + message); } finally { wlAccount.release(); } @@ -623,7 +625,7 @@ public class ServiceSynchronize extends LifecycleService { throw ex; } - final boolean capIdle = ((IMAPStore) istore).hasCapability("IDLE"); + final boolean capIdle = istore.hasCapability("IDLE"); Log.i(account.name + " idle=" + capIdle); db.account().setAccountState(account.id, "connected");