Do not handle connection state changes to "closed"

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 <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2022-11-28 09:12:27 +01:00 committed by Marcel Hibbe (Rebase PR Action)
parent 534bbddc88
commit 6728e3f063

View file

@ -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);