From b59068b46376c121aeea126ac5b68d6a989807a1 Mon Sep 17 00:00:00 2001 From: valere Date: Wed, 31 May 2023 09:52:43 +0200 Subject: [PATCH] missing suspend --- .../android/sdk/internal/crypto/RustCryptoService.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt index df435d024b..33fc13e728 100755 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt @@ -25,7 +25,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.cancelChildren import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking import kotlinx.coroutines.withContext import org.matrix.android.sdk.api.MatrixConfiguration import org.matrix.android.sdk.api.MatrixCoroutineDispatchers @@ -188,8 +187,8 @@ internal class RustCryptoService @Inject constructor( return if (longFormat) "Rust SDK $version, Vodozemac $vodozemac" else version } - override fun getMyCryptoDevice(): CryptoDeviceInfo { - return runBlocking { olmMachine.ownDevice() } + override suspend fun getMyCryptoDevice(): CryptoDeviceInfo = withContext(coroutineDispatchers.io) { + olmMachine.ownDevice() } override suspend fun fetchDevicesList(): List { @@ -341,7 +340,7 @@ internal class RustCryptoService @Inject constructor( */ override suspend fun getCryptoDeviceInfo(userId: String, deviceId: String?): CryptoDeviceInfo? { if (userId.isEmpty() || deviceId.isNullOrEmpty()) return null - return olmMachine.getCryptoDeviceInfo(userId, deviceId) + return withContext(coroutineDispatchers.io) { olmMachine.getCryptoDeviceInfo(userId, deviceId) } } override suspend fun getCryptoDeviceInfo(userId: String): List {