Loading app/src/main/kotlin/at/bitfire/davdroid/syncadapter/SyncManager.kt +6 −4 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L private fun notifyException(e: Throwable, local: ResourceType?, remote: HttpUrl?) { val message: String var title: String = localCollection.title when (e) { is IOException, is InterruptedIOException -> { Loading @@ -855,11 +855,13 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L syncResult.stats.numIoExceptions++ } is UnauthorizedException -> { message = context.getString(R.string.sync_error_authentication_failed) message = context.getString(R.string.account_notification_invalid_login) syncResult.stats.numAuthExceptions++ title = "Account Manager" Log.d("vincent", "numAuthException ? ${syncResult.stats.numAuthExceptions}") // persistent session cookie is present. Probably the session is outDated. no need to show the notification if (accountSettings.containsPersistentCookie()) { if (accountSettings.containsPersistentCookie() && syncResult.stats.numAuthExceptions <= 1) { Logger.log.log(Level.FINE, "Authorization error. Session outDated") Log.d("vincent", "containts persistent cookie so returnbefore notif") return Loading Loading @@ -930,7 +932,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L Log.d("vincent", "about to build the notification if possible") val builder = NotificationUtils.newBuilder(context, channel) builder .setSmallIcon(R.drawable.ic_sync_problem_notify) .setContentTitle(localCollection.title) .setContentTitle(title) .setContentText(message) .setStyle(NotificationCompat.BigTextStyle(builder).bigText(message)) .setSubText(mainAccount.name) Loading Loading
app/src/main/kotlin/at/bitfire/davdroid/syncadapter/SyncManager.kt +6 −4 Original line number Diff line number Diff line Loading @@ -846,7 +846,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L private fun notifyException(e: Throwable, local: ResourceType?, remote: HttpUrl?) { val message: String var title: String = localCollection.title when (e) { is IOException, is InterruptedIOException -> { Loading @@ -855,11 +855,13 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L syncResult.stats.numIoExceptions++ } is UnauthorizedException -> { message = context.getString(R.string.sync_error_authentication_failed) message = context.getString(R.string.account_notification_invalid_login) syncResult.stats.numAuthExceptions++ title = "Account Manager" Log.d("vincent", "numAuthException ? ${syncResult.stats.numAuthExceptions}") // persistent session cookie is present. Probably the session is outDated. no need to show the notification if (accountSettings.containsPersistentCookie()) { if (accountSettings.containsPersistentCookie() && syncResult.stats.numAuthExceptions <= 1) { Logger.log.log(Level.FINE, "Authorization error. Session outDated") Log.d("vincent", "containts persistent cookie so returnbefore notif") return Loading Loading @@ -930,7 +932,7 @@ abstract class SyncManager<ResourceType: LocalResource<*>, out CollectionType: L Log.d("vincent", "about to build the notification if possible") val builder = NotificationUtils.newBuilder(context, channel) builder .setSmallIcon(R.drawable.ic_sync_problem_notify) .setContentTitle(localCollection.title) .setContentTitle(title) .setContentText(message) .setStyle(NotificationCompat.BigTextStyle(builder).bigText(message)) .setSubText(mainAccount.name) Loading