From ac25fe79bc5a6778ef0589d6a3b0b3baeb674276 Mon Sep 17 00:00:00 2001 From: Aleksandar Apostolov Date: Wed, 25 Sep 2024 16:56:38 +0200 Subject: [PATCH] Resolve merge conflicts --- .../io/getstream/video/android/core/StreamVideoImpl.kt | 1 + .../core/notifications/internal/service/CallService.kt | 5 +++-- .../io/getstream/video/android/core/sounds/RingingConfig.kt | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt index 470bcf2097..98385e2a06 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/StreamVideoImpl.kt @@ -56,6 +56,7 @@ import io.getstream.video.android.core.socket.common.token.TokenProvider import io.getstream.video.android.core.sounds.Sounds import io.getstream.video.android.core.utils.LatencyResult import io.getstream.video.android.core.utils.getLatencyMeasurementsOKHttp +import io.getstream.video.android.core.utils.safeCall import io.getstream.video.android.core.utils.safeSuspendingCall import io.getstream.video.android.core.utils.safeSuspendingCallWithResult import io.getstream.video.android.core.utils.toEdge diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/CallService.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/CallService.kt index e1385b962d..94b76a5238 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/CallService.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/notifications/internal/service/CallService.kt @@ -47,6 +47,7 @@ import io.getstream.video.android.core.notifications.NotificationHandler.Compani import io.getstream.video.android.core.notifications.NotificationHandler.Companion.INTENT_EXTRA_CALL_DISPLAY_NAME import io.getstream.video.android.core.notifications.internal.receivers.ToggleCameraBroadcastReceiver import io.getstream.video.android.core.utils.safeCall +import io.getstream.video.android.core.utils.safeCallWithDefault import io.getstream.video.android.core.utils.startForegroundWithServiceType import io.getstream.video.android.model.StreamCallId import io.getstream.video.android.model.streamCallDisplayName @@ -152,7 +153,7 @@ internal open class CallService : Service() { fun buildStopIntent( context: Context, callServiceConfiguration: CallServiceConfig = callServiceConfig(), - ) = safeCall(Intent(context, CallService::class.java)) { + ) = safeCallWithDefault(Intent(context, CallService::class.java)) { val intent = callServiceConfiguration.callServicePerType.firstNotNullOfOrNull { val serviceClass = it.value if (isServiceRunning(context, serviceClass)) { @@ -202,7 +203,7 @@ internal open class CallService : Service() { ) } - private fun isServiceRunning(context: Context, serviceClass: Class<*>): Boolean = safeCall( + private fun isServiceRunning(context: Context, serviceClass: Class<*>): Boolean = safeCallWithDefault( true, ) { val activityManager = context.getSystemService( diff --git a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/RingingConfig.kt b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/RingingConfig.kt index 9042748f31..f6350cf448 100644 --- a/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/RingingConfig.kt +++ b/stream-video-android-core/src/main/kotlin/io/getstream/video/android/core/sounds/RingingConfig.kt @@ -23,6 +23,7 @@ import androidx.annotation.RawRes import io.getstream.log.StreamLog import io.getstream.video.android.core.R import io.getstream.video.android.core.utils.safeCall +import io.getstream.video.android.core.utils.safeCallWithDefault import org.jetbrains.annotations.ApiStatus // Interface & API @@ -80,7 +81,7 @@ public fun defaultResourcesRingingConfig(context: Context): RingingConfig = obje public fun deviceRingtoneRingingConfig(context: Context): RingingConfig = object : RingingConfig { private val streamResSoundConfig = defaultResourcesRingingConfig(context) override val incomingCallSoundUri: Uri? - get() = safeCall(default = null) { + get() = safeCallWithDefault(default = null) { RingtoneManager.getActualDefaultRingtoneUri( context, RingtoneManager.TYPE_RINGTONE, @@ -134,7 +135,7 @@ public fun RingingConfig.toSounds() = Sounds(this) // Internal utilities private fun Int?.toUriOrNUll(context: Context): Uri? = - safeCall(default = null) { + safeCallWithDefault(default = null) { if (this != null) { Uri.parse("android.resource://${context.packageName}/$this") } else {