From 6728e3f063b18cdc173f930267dbc83e4191f85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Mon, 28 Nov 2022 09:12:27 +0100 Subject: [PATCH] Do not handle connection state changes to "closed" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The connection state changes to "closed" only when the connection is closed. However, closing a connection does not fire any event (not even the "iceConnectionStateChanged" event), so the event handler can be removed as it will never be executed. Signed-off-by: Daniel Calviño Sánchez --- .../com/nextcloud/talk/activities/CallActivity.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java index 343111e8d..f342be713 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java +++ b/app/src/main/java/com/nextcloud/talk/activities/CallActivity.java @@ -1971,7 +1971,7 @@ public class CallActivity extends CallBaseActivity { peerConnectionWrapperList.add(peerConnectionWrapper); PeerConnectionWrapper.PeerConnectionObserver peerConnectionObserver = - new CallActivityPeerConnectionObserver(sessionId, type); + new CallActivityPeerConnectionObserver(sessionId); peerConnectionObservers.put(sessionId + "-" + type, peerConnectionObserver); peerConnectionWrapper.addObserver(peerConnectionObserver); @@ -2566,11 +2566,9 @@ public class CallActivity extends CallBaseActivity { private class CallActivityPeerConnectionObserver implements PeerConnectionWrapper.PeerConnectionObserver { private final String sessionId; - private final String videoStreamType; - private CallActivityPeerConnectionObserver(String sessionId, String videoStreamType) { + private CallActivityPeerConnectionObserver(String sessionId) { this.sessionId = sessionId; - this.videoStreamType = videoStreamType; } @Override @@ -2588,12 +2586,6 @@ public class CallActivity extends CallBaseActivity { updateSelfVideoViewIceConnectionState(iceConnectionState); } - if (iceConnectionState == PeerConnection.IceConnectionState.CLOSED) { - endPeerConnection(sessionId, VIDEO_STREAM_TYPE_SCREEN.equals(videoStreamType)); - - return; - } - if (iceConnectionState == PeerConnection.IceConnectionState.FAILED) { if (webSocketClient != null && webSocketClient.getSessionId() != null && webSocketClient.getSessionId().equals(sessionId)) { setCallState(CallStatus.PUBLISHER_FAILED);