Private and typo

This commit is contained in:
Benoit Marty 2020-09-11 16:25:30 +02:00
parent ab2a55d417
commit 236f7f8e28

View file

@ -91,23 +91,23 @@ class VectorCallViewModel @AssistedInject constructor(
val proximityManager: CallProximityManager val proximityManager: CallProximityManager
) : VectorViewModel<VectorCallViewState, VectorCallViewActions, VectorCallViewEvents>(initialState) { ) : VectorViewModel<VectorCallViewState, VectorCallViewActions, VectorCallViewEvents>(initialState) {
var call: MxCall? = null private var call: MxCall? = null
var connectionTimoutTimer: Timer? = null private var connectionTimeoutTimer: Timer? = null
var hasBeenConnectedOnce = false private var hasBeenConnectedOnce = false
private val callStateListener = object : MxCall.StateListener { private val callStateListener = object : MxCall.StateListener {
override fun onStateUpdate(call: MxCall) { override fun onStateUpdate(call: MxCall) {
val callState = call.state val callState = call.state
if (callState is CallState.Connected && callState.iceConnectionState == PeerConnection.PeerConnectionState.CONNECTED) { if (callState is CallState.Connected && callState.iceConnectionState == PeerConnection.PeerConnectionState.CONNECTED) {
hasBeenConnectedOnce = true hasBeenConnectedOnce = true
connectionTimoutTimer?.cancel() connectionTimeoutTimer?.cancel()
connectionTimoutTimer = null connectionTimeoutTimer = null
} else { } else {
// do we reset as long as it's moving? // do we reset as long as it's moving?
connectionTimoutTimer?.cancel() connectionTimeoutTimer?.cancel()
if (hasBeenConnectedOnce) { if (hasBeenConnectedOnce) {
connectionTimoutTimer = Timer().apply { connectionTimeoutTimer = Timer().apply {
schedule(object : TimerTask() { schedule(object : TimerTask() {
override fun run() { override fun run() {
session.callSignalingService().getTurnServer(object : MatrixCallback<TurnServerResponse> { session.callSignalingService().getTurnServer(object : MatrixCallback<TurnServerResponse> {