~singpolyma/cheogram-android

b434c5d25bfec25d4906de37575d39c7e72c51a4 — Daniel Gultsch 4 months ago 7167d37
hold back candidates until after content-add
M src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java => src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +2 -1
@@ 738,6 738,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
                            + ContentAddition.summary(contentAcceptMap));
            modifyLocalContentMap(rtpContentMap);
            sendContentAccept(contentAcceptMap);
            this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true);
        } catch (final Exception e) {
            Log.d(Config.LOGTAG, "unable to accept content add", Throwables.getRootCause(e));
            webRTCWrapper.close();


@@ 871,7 872,6 @@ public class JingleRtpConnection extends AbstractJingleConnection
        webRTCWrapper.setRemoteDescription(sdp).get();
        setRemoteContentMap(restartContentMap);
        if (isOffer) {
            webRTCWrapper.setIsReadyToReceiveIceCandidates(false);
            final SessionDescription localSessionDescription = setLocalSessionDescription();
            setLocalContentMap(RtpContentMap.of(localSessionDescription, isInitiator()));
            // We need to respond OK before sending any candidates


@@ 2479,6 2479,7 @@ public class JingleRtpConnection extends AbstractJingleConnection
                        handleIqTimeoutResponse(response);
                    }
                });
        this.webRTCWrapper.setIsReadyToReceiveIceCandidates(true);
    }

    private void setLocalContentMap(final RtpContentMap rtpContentMap) {

M src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java => src/main/java/eu/siacs/conversations/xmpp/jingle/WebRTCWrapper.java +1 -0
@@ 596,6 596,7 @@ public class WebRTCWrapper {
    }

    synchronized ListenableFuture<SessionDescription> setLocalDescription() {
        this.setIsReadyToReceiveIceCandidates(false);
        return Futures.transformAsync(
                getPeerConnectionFuture(),
                peerConnection -> {