From fd814e37c86d88f30383482a3baa478cf68bf06a Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 10 Jun 2022 15:12:49 +0200 Subject: [PATCH] Do not show notification for Google auth error The Google address book sychronization sometimes fails to authenticate, while the next one 2 minutes after works. For now, we can hide this annoying notification to the user. --- .../foundation/e/accountmanager/syncadapter/SyncManager.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/foundation/e/accountmanager/syncadapter/SyncManager.kt b/app/src/main/java/foundation/e/accountmanager/syncadapter/SyncManager.kt index 83c639d4c..f9d48428d 100644 --- a/app/src/main/java/foundation/e/accountmanager/syncadapter/SyncManager.kt +++ b/app/src/main/java/foundation/e/accountmanager/syncadapter/SyncManager.kt @@ -654,6 +654,13 @@ abstract class SyncManager, out CollectionType: L Logger.log.log(Level.SEVERE, "Not authorized anymore", e) message = context.getString(R.string.sync_error_authentication_failed) syncResult.stats.numAuthExceptions++ + if (account.type.toLowerCase(Locale.getDefault()).contains("google")) { + /* TODO Investigate deeper why this exception sometimes happens + * https://gitlab.e.foundation/e/backlog/-/issues/3430 + */ + Logger.log.log(Level.WARNING, "Authorization error. Do not notify the user") + return + } } is HttpException, is DavException -> { Logger.log.log(Level.SEVERE, "HTTP/DAV exception", e) -- GitLab