refactor: failed and disconnect events only handled if either the reconnect or the timeout runnables are not set

This commit is contained in:
jubb 2022-03-29 16:57:43 +11:00
parent 4c984de9ff
commit 413e65e905
1 changed files with 1 additions and 1 deletions

View File

@ -807,7 +807,7 @@ class WebRtcCallService: Service(), CallManager.WebRtcListener {
val intent = Intent(this, WebRtcCallService::class.java)
.setAction(ACTION_ICE_CONNECTED)
startService(intent)
} else if (newState in arrayOf(FAILED, DISCONNECTED) && scheduledReconnect == null) {
} else if (newState in arrayOf(FAILED, DISCONNECTED) && (scheduledReconnect == null && scheduledTimeout == null)) {
callManager.callId?.let { callId ->
callManager.postConnectionEvent(Event.IceDisconnect) {
callManager.postViewModelState(CallViewModel.State.CALL_RECONNECTING)