OSDN Git Service

Fix issue 2305382: Pick up original call makes a noisy beep when wired headset connected.
authorEric Laurent <elaurent@google.com>
Tue, 23 Feb 2010 18:56:00 +0000 (10:56 -0800)
committerEric Laurent <elaurent@google.com>
Tue, 23 Feb 2010 18:56:00 +0000 (10:56 -0800)
The noise is the residual ring tone that is still playing while the call is answered and the
audio route changed to headset or earpiece.

The fix consists in muting the ringing tone when changing mode from ringtone to in call
and delaying the route change until the audio buffers are emptied.

include/hardware_legacy/AudioPolicyManagerBase.h

index de32926..58940b2 100644 (file)
@@ -35,6 +35,9 @@ namespace android {
 // Time in seconds during which we consider that music is still active after a music
 // track was stopped - see computeVolume()
 #define SONIFICATION_HEADSET_MUSIC_DELAY  5
+// Time in milliseconds during witch some streams are muted while the audio path
+// is switched
+#define MUTE_TIME_MS 2000
 
 #define NUM_TEST_OUTPUTS 5