diff --git a/app/ui/src/main/java/com/fsck/k9/ui/account/AccountsLiveData.kt b/app/ui/src/main/java/com/fsck/k9/ui/account/AccountsLiveData.kt index a2322bdff..1f34274f6 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/account/AccountsLiveData.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/account/AccountsLiveData.kt @@ -13,7 +13,7 @@ class AccountsLiveData(val preferences: Preferences) : LiveData>() private fun loadAccountsAsync() { GlobalScope.launch(Dispatchers.Main) { - val accounts = async { + val accounts = async(Dispatchers.IO) { loadAccounts() } diff --git a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt index 8b3d07487..5c5c65eb4 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupMessageLiveEvent.kt @@ -18,7 +18,7 @@ import java.io.InputStream class AutocryptSetupMessageLiveEvent(val messageCreator: AutocryptTransferMessageCreator) : SingleLiveEvent() { fun loadAutocryptSetupMessageAsync(openPgpApi: OpenPgpApi, account: Account) { GlobalScope.launch(Dispatchers.Main) { - val setupMessage = async { + val setupMessage = async(Dispatchers.IO) { loadAutocryptSetupMessage(openPgpApi, account) } diff --git a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt index 395d76b1f..0a2df83a4 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptSetupTransferLiveEvent.kt @@ -12,7 +12,7 @@ class AutocryptSetupTransferLiveEvent( fun sendMessageAsync(account: Account, setupMsg: AutocryptSetupMessage) { GlobalScope.launch(Dispatchers.Main) { - val setupMessage = async { + val setupMessage = async(Dispatchers.IO) { messagingController.sendMessageBlocking(account, setupMsg.setupMessage) }