set correct video state for calls

This commit is contained in:
Daniel Gultsch 2024-01-15 13:54:26 +01:00
parent 6975299a28
commit ebb48e9320
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 12 additions and 6 deletions

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.xmpp.jingle;
import android.telecom.VideoProfile;
import android.util.Base64;
import android.util.Log;
@ -732,6 +733,10 @@ public class JingleConnectionManager extends AbstractConnectionManager {
}
final CallIntegration callIntegration =
new CallIntegration(mXmppConnectionService.getApplicationContext());
callIntegration.setVideoState(
Media.audioOnly(media)
? VideoProfile.STATE_AUDIO_ONLY
: VideoProfile.STATE_BIDIRECTIONAL);
callIntegration.setInitialAudioDevice(CallIntegration.initialAudioDevice(media));
final RtpSessionProposal proposal =
RtpSessionProposal.of(account, with.asBareJid(), media, callIntegration);
@ -1111,13 +1116,9 @@ public class JingleConnectionManager extends AbstractConnectionManager {
Set<CallIntegration.AudioDevice> availableAudioDevices) {}
@Override
public void onCallIntegrationReject() {
}
public void onCallIntegrationReject() {}
@Override
public void onCallIntegrationAnswer() {
}
public void onCallIntegrationAnswer() {}
}
}

View file

@ -2,6 +2,7 @@ package eu.siacs.conversations.xmpp.jingle;
import android.content.Intent;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.util.Log;
import androidx.annotation.NonNull;
@ -2838,6 +2839,10 @@ public class JingleRtpConnection extends AbstractJingleConnection
void setProposedMedia(final Set<Media> media) {
this.proposedMedia = media;
this.callIntegration.setVideoState(
Media.audioOnly(media)
? VideoProfile.STATE_AUDIO_ONLY
: VideoProfile.STATE_BIDIRECTIONAL);
this.callIntegration.setInitialAudioDevice(CallIntegration.initialAudioDevice(media));
}