From a78747eaa275083cbd52159bc7bc2b0e55cb4bee Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 21 Jan 2024 11:08:43 +0100 Subject: [PATCH] react to onSilence() and stop ringtone --- .../eu/siacs/conversations/services/CallIntegration.java | 7 +++++++ .../conversations/xmpp/jingle/JingleConnectionManager.java | 5 +++++ .../conversations/xmpp/jingle/JingleRtpConnection.java | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/services/CallIntegration.java b/src/main/java/eu/siacs/conversations/services/CallIntegration.java index f07ebe28d..fa262768b 100644 --- a/src/main/java/eu/siacs/conversations/services/CallIntegration.java +++ b/src/main/java/eu/siacs/conversations/services/CallIntegration.java @@ -300,6 +300,11 @@ public class CallIntegration extends Connection { return this.appRTCAudioManager; } + @Override + public void onSilence() { + this.callback.onCallIntegrationSilence(); + } + @Override public void onStateChanged(final int state) { Log.d(Config.LOGTAG, "onStateChanged(" + state + ")"); @@ -473,5 +478,7 @@ public class CallIntegration extends Connection { void onCallIntegrationReject(); void onCallIntegrationAnswer(); + + void onCallIntegrationSilence(); } } 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 9dee8904d..8541f6a44 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnectionManager.java @@ -1156,5 +1156,10 @@ public class JingleConnectionManager extends AbstractConnectionManager { @Override public void onCallIntegrationAnswer() {} + + @Override + public void onCallIntegrationSilence() { + + } } } 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 df48ee8d7..74eb4abd0 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -2718,6 +2718,11 @@ public class JingleRtpConnection extends AbstractJingleConnection xmppConnectionService.startActivity(intent); } + @Override + public void onCallIntegrationSilence() { + xmppConnectionService.getNotificationService().stopSoundAndVibration(); + } + @Override public void onAudioDeviceChanged( final CallIntegration.AudioDevice selectedAudioDevice,