From ebb48e9320d07459d898556e3f48fca786b7201b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 15 Jan 2024 13:54:26 +0100 Subject: [PATCH] set correct video state for calls --- .../xmpp/jingle/JingleConnectionManager.java | 13 +++++++------ .../xmpp/jingle/JingleRtpConnection.java | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java index 9101b939a..fd5c4c9af 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -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 availableAudioDevices) {} @Override - public void onCallIntegrationReject() { - - } + public void onCallIntegrationReject() {} @Override - public void onCallIntegrationAnswer() { - - } + public void onCallIntegrationAnswer() {} } } diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index 2ecd91253..dc0980e1b 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -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) { this.proposedMedia = media; + this.callIntegration.setVideoState( + Media.audioOnly(media) + ? VideoProfile.STATE_AUDIO_ONLY + : VideoProfile.STATE_BIDIRECTIONAL); this.callIntegration.setInitialAudioDevice(CallIntegration.initialAudioDevice(media)); }