Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bdc92b6 authored by cketti's avatar cketti
Browse files

Update kotlinx.coroutines to version 1.6.4

parent d26921e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@ package com.fsck.k9
import android.content.Context
import androidx.annotation.GuardedBy
import androidx.annotation.RestrictTo
import com.fsck.k9.helper.sendBlockingSilently
import com.fsck.k9.mail.MessagingException
import com.fsck.k9.mailstore.LocalStoreProvider
import com.fsck.k9.preferences.AccountManager
@@ -19,6 +18,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.buffer
import kotlinx.coroutines.flow.callbackFlow
@@ -135,7 +135,7 @@ class Preferences internal constructor(
            val listener = AccountsChangeListener {
                val account = getAccount(accountUuid)
                if (account != null) {
                    sendBlockingSilently(account)
                    trySendBlocking(account)
                } else {
                    close()
                }
@@ -155,7 +155,7 @@ class Preferences internal constructor(
            send(accounts)

            val listener = AccountsChangeListener {
                sendBlockingSilently(accounts)
                trySendBlocking(accounts)
            }
            addOnAccountsChangeListener(listener)

+0 −16
Original line number Diff line number Diff line
package com.fsck.k9.helper

import kotlinx.coroutines.channels.ClosedSendChannelException
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.channels.sendBlocking

/**
 * Like [sendBlocking], but ignores [ClosedSendChannelException].
 */
fun <E> SendChannel<E>.sendBlockingSilently(element: E) {
    try {
        sendBlocking(element)
    } catch (e: ClosedSendChannelException) {
        // Ignore
    }
}
+4 −4
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ import com.fsck.k9.Account.FolderMode
import com.fsck.k9.DI
import com.fsck.k9.controller.MessagingController
import com.fsck.k9.controller.SimpleMessagingListener
import com.fsck.k9.helper.sendBlockingSilently
import com.fsck.k9.mail.FolderClass
import com.fsck.k9.preferences.AccountManager
import kotlinx.coroutines.CoroutineDispatcher
@@ -13,6 +12,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.channels.trySendBlocking
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.buffer
import kotlinx.coroutines.flow.callbackFlow
@@ -65,14 +65,14 @@ class FolderRepository(
            val folderStatusChangedListener = object : SimpleMessagingListener() {
                override fun folderStatusChanged(statusChangedAccount: Account, folderId: Long) {
                    if (statusChangedAccount.uuid == account.uuid) {
                        sendBlockingSilently(getDisplayFolders(account, displayMode))
                        trySendBlocking(getDisplayFolders(account, displayMode))
                    }
                }
            }
            messagingController.addListener(folderStatusChangedListener)

            val folderSettingsChangedListener = FolderSettingsChangedListener {
                sendBlockingSilently(getDisplayFolders(account, displayMode))
                trySendBlocking(getDisplayFolders(account, displayMode))
            }
            messageStore.addFolderSettingsChangedListener(folderSettingsChangedListener)

@@ -173,7 +173,7 @@ class FolderRepository(
            send(getPushFolders(account, folderMode))

            val listener = FolderSettingsChangedListener {
                sendBlockingSilently(getPushFolders(account, folderMode))
                trySendBlocking(getPushFolders(account, folderMode))
            }
            messageStore.addFolderSettingsChangedListener(listener)

+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ buildscript {

        versions = [
                'kotlin': '1.7.10',
                'kotlinCoroutines': '1.6.0',
                'kotlinCoroutines': '1.6.4',
                'jetbrainsAnnotations': '23.0.0',
                'androidxAppCompat': '1.4.1',
                'androidxActivity': '1.4.0',