mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 18:36:21 +03:00
Ensure the incoming call will not ring forever, in case the call is not ended by another way (#8178)
Add a safe 2 minutes timer.
This commit is contained in:
parent
9e74afc9b1
commit
52082a9def
2 changed files with 11 additions and 0 deletions
1
changelog.d/8178.bugfix
Normal file
1
changelog.d/8178.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Ensure the incoming call will not ring forever, in case the call is not ended by another way.
|
|
@ -34,6 +34,8 @@ import im.vector.app.features.call.vectorCallService
|
|||
import im.vector.app.features.session.coroutineScope
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.asCoroutineDispatcher
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.extensions.orFalse
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.logger.LoggerTag
|
||||
|
@ -386,6 +388,14 @@ class WebRtcCallManager @Inject constructor(
|
|||
// Maybe increase sync freq? but how to set back to default values?
|
||||
}
|
||||
}
|
||||
|
||||
// ensure the incoming call will not ring forever
|
||||
sessionScope?.launch {
|
||||
delay(2 * 60 * 1000 /* 2 minutes */)
|
||||
if (mxCall.state is CallState.LocalRinging) {
|
||||
onCallEnded(mxCall.callId, EndCallReason.INVITE_TIMEOUT, rejected = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCallAnswerReceived(callAnswerContent: CallAnswerContent) {
|
||||
|
|
Loading…
Reference in a new issue