Do not play a connection sound when establishing an audio-/videocall. Reduce volume of call integration sounds.

This commit is contained in:
p42ity 2024-12-21 19:31:50 +01:00
parent d32afb8858
commit 8ed61b5234
2 changed files with 2 additions and 21 deletions

View file

@ -62,8 +62,7 @@ public class CallIntegration extends Connection {
private static final List<String> BROKEN_MANUFACTURES_UP_TO_11 =
Arrays.asList("realme", "oppo", "oneplus");
public static final int DEFAULT_TONE_VOLUME = 60;
private static final int DEFAULT_MEDIA_PLAYER_VOLUME = 90;
public static final int DEFAULT_TONE_VOLUME = 20;
private final Context context;
@ -382,9 +381,7 @@ public class CallIntegration extends Connection {
requireAppRtcAudioManager().stopRingBack();
}
}
if (state == STATE_ACTIVE) {
playConnectedSound();
} else if (state == STATE_DISCONNECTED) {
if (state == STATE_DISCONNECTED) {
final var audioManager = this.appRTCAudioManager;
if (audioManager != null) {
audioManager.executeOnMain(audioManager::stop);
@ -392,22 +389,6 @@ public class CallIntegration extends Connection {
}
}
private void playConnectedSound() {
final var audioAttributes =
new AudioAttributes.Builder()
.setLegacyStreamType(AudioManager.STREAM_VOICE_CALL)
.build();
final var mediaPlayer =
MediaPlayer.create(
context,
R.raw.connected,
audioAttributes,
AudioManager.AUDIO_SESSION_ID_GENERATE);
mediaPlayer.setVolume(
DEFAULT_MEDIA_PLAYER_VOLUME / 100f, DEFAULT_MEDIA_PLAYER_VOLUME / 100f);
mediaPlayer.start();
}
public void success() {
Log.d(Config.LOGTAG, "CallIntegration.success()");
startTone(DEFAULT_TONE_VOLUME, ToneGenerator.TONE_CDMA_CALLDROP_LITE, 375);

Binary file not shown.