From 397c0a0ac717e36b792b07b95f407a9b67d819be Mon Sep 17 00:00:00 2001 From: p42ity Date: Thu, 2 Jan 2025 13:20:49 +0100 Subject: [PATCH] Adjust call integration sounds. (cherry picked from commit 56316125822556b515ee786323f37497d26d0b09) --- .../services/CallIntegration.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/CallIntegration.java b/src/main/java/eu/siacs/conversations/services/CallIntegration.java index 30677ef2a..505b0decc 100644 --- a/src/main/java/eu/siacs/conversations/services/CallIntegration.java +++ b/src/main/java/eu/siacs/conversations/services/CallIntegration.java @@ -59,7 +59,7 @@ public class CallIntegration extends Connection { private static final List BROKEN_MANUFACTURES_UP_TO_11 = Arrays.asList("realme", "oppo", "oneplus"); - public static final int DEFAULT_TONE_VOLUME = 20; + public static final int DEFAULT_TONE_VOLUME = 60; private final Context context; @@ -126,11 +126,6 @@ public class CallIntegration extends Connection { this.callback.onCallIntegrationReject(); } - @Override - public void onPlayDtmfTone(char c) { - this.callback.applyDtmfTone("" + c); - } - @RequiresApi(api = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) @Override public void onAvailableCallEndpointsChanged(@NonNull List availableEndpoints) { @@ -378,7 +373,9 @@ public class CallIntegration extends Connection { requireAppRtcAudioManager().stopRingBack(); } } - if (state == STATE_DISCONNECTED) { + if (state == STATE_ACTIVE) { + startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_ANSWER, 100 ); + } else if (state == STATE_DISCONNECTED) { final var audioManager = this.appRTCAudioManager; if (audioManager != null) { audioManager.executeOnMain(audioManager::stop); @@ -388,8 +385,8 @@ public class CallIntegration extends Connection { public void success() { Log.d(Config.LOGTAG, "CallIntegration.success()"); - startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CALLDROP_LITE, 375); - this.destroyWithDelay(new DisconnectCause(DisconnectCause.LOCAL, null), 375); + startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CONFIRM, 600); + this.destroyWithDelay(new DisconnectCause(DisconnectCause.LOCAL, null), 600); } public void accepted() { @@ -403,8 +400,8 @@ public class CallIntegration extends Connection { public void error() { Log.d(Config.LOGTAG, "CallIntegration.error()"); - startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CALLDROP_LITE, 375); - this.destroyWithDelay(new DisconnectCause(DisconnectCause.ERROR, null), 375); + startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CONFIRM, 600); + this.destroyWithDelay(new DisconnectCause(DisconnectCause.ERROR, null), 600); } public void retracted() { @@ -621,7 +618,5 @@ public class CallIntegration extends Connection { void onCallIntegrationSilence(); void onCallIntegrationMicrophoneEnabled(boolean enabled); - - boolean applyDtmfTone(final String dtmf); } }