Skip to content

Commit 603ddf7

Browse files
committed
taking into account when the current call is not yet available and defaulting to the audio call mode
1 parent ffdd10b commit 603ddf7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

vector/src/main/java/im/vector/app/core/services/CallRingPlayer.kt

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import android.os.VibrationEffect
2828
import android.os.Vibrator
2929
import androidx.core.content.getSystemService
3030
import im.vector.app.R
31-
import im.vector.app.features.call.audio.CallAudioManager
31+
import im.vector.app.features.call.audio.CallAudioManager.Mode
3232
import im.vector.app.features.call.webrtc.WebRtcCallManager
3333
import im.vector.app.features.notifications.NotificationUtils
3434
import org.matrix.android.sdk.api.extensions.orFalse
@@ -124,9 +124,8 @@ class CallRingPlayerOutgoing(
124124
}
125125

126126
private fun WebRtcCallManager.setAudioModeToCallType() {
127-
currentCall.get()?.let {
128-
audioManager.setMode(if (it.mxCall.isVideoCall) CallAudioManager.Mode.VIDEO_CALL else CallAudioManager.Mode.AUDIO_CALL)
129-
}
127+
val callMode = if (currentCall.get()?.mxCall?.isVideoCall.orFalse()) Mode.VIDEO_CALL else Mode.AUDIO_CALL
128+
audioManager.setMode(callMode)
130129
}
131130

132131
fun stop() {

0 commit comments

Comments
 (0)