summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJames E. Blair <corvus@gnu.org>2009-01-17 13:30:20 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-03-03 16:24:40 -0800
commit6015dfc996dadefd1494cb3635928f8dce3b5a4c (patch)
tree7face7aa36b77ca691c46ceca249eb204a457bab /libs
parent007452f719a9b3d4f6e2f1cc7344b7bf332dd476 (diff)
downloadframeworks_native-6015dfc996dadefd1494cb3635928f8dce3b5a4c.zip
frameworks_native-6015dfc996dadefd1494cb3635928f8dce3b5a4c.tar.gz
frameworks_native-6015dfc996dadefd1494cb3635928f8dce3b5a4c.tar.bz2
Fix issue #1324: No audible call-waiting indication when in-call volume
is low http://code.google.com/p/android/issues/detail?id=1324 Re-base the internally generated in-call audio volume so that it is never muted, which is already the case for the hardware routed in-call audio.
Diffstat (limited to 'libs')
-rw-r--r--libs/audioflinger/AudioFlinger.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/audioflinger/AudioFlinger.cpp b/libs/audioflinger/AudioFlinger.cpp
index c330bc8..918b01f 100644
--- a/libs/audioflinger/AudioFlinger.cpp
+++ b/libs/audioflinger/AudioFlinger.cpp
@@ -800,13 +800,21 @@ status_t AudioFlinger::setStreamVolume(int stream, float value)
return BAD_VALUE;
}
- mStreamTypes[stream].volume = value;
status_t ret = NO_ERROR;
if (stream == AudioTrack::VOICE_CALL) {
AutoMutex lock(mHardwareLock);
mHardwareStatus = AUDIO_SET_VOICE_VOLUME;
ret = mAudioHardware->setVoiceVolume(value);
mHardwareStatus = AUDIO_HW_IDLE;
+ // FIXME: This is a temporary fix to re-base the internally
+ // generated in-call audio so that it is never muted, which is
+ // already the case for the hardware routed in-call audio.
+ // When audio stream handling is reworked, this should be
+ // addressed more cleanly. Fixes #1324; see discussion at
+ // http://review.source.android.com/8224
+ mStreamTypes[stream].volume = value * (1.0 - 1.0 / 6.0) + (1.0 / 6.0);
+ } else {
+ mStreamTypes[stream].volume = value;
}
return ret;
}
@@ -830,6 +838,11 @@ float AudioFlinger::streamVolume(int stream) const
if (uint32_t(stream) >= AudioTrack::NUM_STREAM_TYPES) {
return 0.0f;
}
+ if (stream == AudioTrack::VOICE_CALL) {
+ // FIXME: Re-base internally generated in-call audio,
+ // reverse of above in setStreamVolume.
+ return (mStreamTypes[stream].volume - (1.0 / 6.0)) / (1.0 - 1.0 / 6.0);
+ }
return mStreamTypes[stream].volume;
}