Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandar-apostolov committed Sep 25, 2024
1 parent 18f0a98 commit ac25fe7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ac25fe7

Please sign in to comment.