From 87e28f7b352fb77f46e16ebcdd85cbf01396a203 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 3 Oct 2013 18:02:16 -0700 Subject: audio policy: fix DTMF tones volume while in call When voice call stream volume is at 0, DTMF are not heard at all. DTMF volume should follow the behavior of voice call volume which is never completely muted. Bug: 10932676. Change-Id: Iaf0e33284be75b00516a837907e66be3123e5331 --- audio/AudioPolicyManagerBase.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index 3ee1f0f..d7eb273 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -312,11 +312,19 @@ void AudioPolicyManagerBase::setPhoneState(int state) // force routing command to audio hardware when starting a call // even if no device change is needed force = true; + for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) { + mStreams[AUDIO_STREAM_DTMF].mVolumeCurve[j] = + sVolumeProfiles[AUDIO_STREAM_VOICE_CALL][j]; + } } else if (isStateInCall(oldState) && !isStateInCall(state)) { ALOGV(" Exiting call in setPhoneState()"); // force routing command to audio hardware when exiting a call // even if no device change is needed force = true; + for (int j = 0; j < DEVICE_CATEGORY_CNT; j++) { + mStreams[AUDIO_STREAM_DTMF].mVolumeCurve[j] = + sVolumeProfiles[AUDIO_STREAM_DTMF][j]; + } } else if (isStateInCall(state) && (state != oldState)) { ALOGV(" Switching between telephony and VoIP in setPhoneState()"); // force routing command to audio hardware when switching between telephony and VoIP @@ -2830,8 +2838,10 @@ const AudioPolicyManagerBase::VolumeCurvePoint }; // AUDIO_STREAM_SYSTEM, AUDIO_STREAM_ENFORCED_AUDIBLE and AUDIO_STREAM_DTMF volume tracks -// AUDIO_STREAM_RING on phones and AUDIO_STREAM_MUSIC on tablets (See AudioService.java). +// AUDIO_STREAM_RING on phones and AUDIO_STREAM_MUSIC on tablets. +// AUDIO_STREAM_DTMF tracks AUDIO_STREAM_VOICE_CALL while in call (See AudioService.java). // The range is constrained between -24dB and -6dB over speaker and -30dB and -18dB over headset. + const AudioPolicyManagerBase::VolumeCurvePoint AudioPolicyManagerBase::sDefaultSystemVolumeCurve[AudioPolicyManagerBase::VOLCNT] = { {1, -24.0f}, {33, -18.0f}, {66, -12.0f}, {100, -6.0f} -- cgit v1.1