ensure that rtp connection is registered with connection manager

This commit is contained in:
Daniel Gultsch 2020-04-18 21:27:50 +02:00
parent c20c40a807
commit a12760300c
2 changed files with 8 additions and 1 deletions

View file

@ -513,6 +513,13 @@ public class JingleConnectionManager extends AbstractConnectionManager {
}
}
void ensureConnectionIsRegistered(final AbstractJingleConnection connection) {
if (connections.containsValue(connection)) {
return;
}
throw new IllegalStateException("JingleConnection has not been registered with connection manager");
}
public enum DeviceDiscoveryState {
SEARCHING, DISCOVERED, FAILED;

View file

@ -846,7 +846,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
}
private void setupWebRTC(final Set<Media> media, final List<PeerConnection.IceServer> iceServers) throws WebRTCWrapper.InitializationException {
//TODO ensure registered with connection manager
this.jingleConnectionManager.ensureConnectionIsRegistered(this);
final AppRTCAudioManager.SpeakerPhonePreference speakerPhonePreference;
if (media.contains(Media.VIDEO)) {
speakerPhonePreference = AppRTCAudioManager.SpeakerPhonePreference.SPEAKER;