@@ -63,6 +63,7 @@ import io.getstream.video.android.model.User
63
63
import kotlinx.coroutines.CoroutineScope
64
64
import kotlinx.coroutines.Deferred
65
65
import kotlinx.coroutines.Dispatchers
66
+ import kotlinx.coroutines.InternalCoroutinesApi
66
67
import kotlinx.coroutines.SupervisorJob
67
68
import kotlinx.coroutines.async
68
69
import kotlinx.coroutines.awaitAll
@@ -124,7 +125,6 @@ import retrofit2.HttpException
124
125
import java.net.ConnectException
125
126
import java.util.*
126
127
import kotlin.coroutines.Continuation
127
- import kotlin.coroutines.resumeWithException
128
128
129
129
internal const val WAIT_FOR_CONNECTION_ID_TIMEOUT = 5000L
130
130
internal const val defaultAudioUsage = AudioAttributes .USAGE_VOICE_COMMUNICATION
@@ -1025,6 +1025,7 @@ internal class StreamVideoImpl internal constructor(
1025
1025
}
1026
1026
}
1027
1027
1028
+ @OptIn(InternalCoroutinesApi ::class )
1028
1029
suspend fun _selectLocation (): Result <String > {
1029
1030
return wrapAPICall {
1030
1031
val url = " https://hint.stream-io-video.com/"
@@ -1033,7 +1034,9 @@ internal class StreamVideoImpl internal constructor(
1033
1034
val response = suspendCancellableCoroutine { continuation ->
1034
1035
call.enqueue(object : Callback {
1035
1036
override fun onFailure (call : okhttp3.Call , e : java.io.IOException ) {
1036
- continuation.resumeWithException(e)
1037
+ continuation.tryResumeWithException(e)?.let {
1038
+ continuation.completeResume(it)
1039
+ }
1037
1040
}
1038
1041
1039
1042
override fun onResponse (call : okhttp3.Call , response : Response ) {
0 commit comments