summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-10-03 18:02:16 -0700
committerEric Laurent <elaurent@google.com>2013-10-03 18:02:16 -0700
commit87e28f7b352fb77f46e16ebcdd85cbf01396a203 (patch)
tree642a8ee553a5306d7e9408e3972c291e4a4e3b07 /audio
parent727fef1b1a8cb6d6609ec99a749fcd9573a3417d (diff)
downloadhardware_libhardware_legacy-87e28f7b352fb77f46e16ebcdd85cbf01396a203.zip
hardware_libhardware_legacy-87e28f7b352fb77f46e16ebcdd85cbf01396a203.tar.gz
hardware_libhardware_legacy-87e28f7b352fb77f46e16ebcdd85cbf01396a203.tar.bz2
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
Diffstat (limited to 'audio')
-rw-r--r--audio/AudioPolicyManagerBase.cpp12
1 files changed, 11 insertions, 1 deletions
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}