diff --git a/.changeset/hip-doors-notice.md b/.changeset/hip-doors-notice.md new file mode 100644 index 000000000..d5976dd54 --- /dev/null +++ b/.changeset/hip-doors-notice.md @@ -0,0 +1,5 @@ +--- +"client-sdk-android": patch +--- + +Remove reference to internal OkHttp method diff --git a/livekit-android-sdk/src/main/java/io/livekit/android/util/OkHttpCallExt.kt b/livekit-android-sdk/src/main/java/io/livekit/android/util/OkHttpCallExt.kt index 75a0ee5cc..034277f0c 100644 --- a/livekit-android-sdk/src/main/java/io/livekit/android/util/OkHttpCallExt.kt +++ b/livekit-android-sdk/src/main/java/io/livekit/android/util/OkHttpCallExt.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024 LiveKit, Inc. + * Copyright 2024-2025 LiveKit, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import kotlinx.coroutines.suspendCancellableCoroutine import okhttp3.Call import okhttp3.Callback import okhttp3.Response -import okhttp3.internal.closeQuietly import okio.IOException +import java.io.Closeable import kotlin.coroutines.resumeWithException // TODO: Switch to official executeAsync when released. @@ -52,3 +52,12 @@ suspend fun Call.executeAsync(): Response = }, ) } + +fun Closeable.closeQuietly() { + try { + close() + } catch (rethrown: RuntimeException) { + throw rethrown + } catch (_: Exception) { + } +}