From 70e8b5b4879034b05c7e92b242f51218dc570fcb Mon Sep 17 00:00:00 2001 From: Daniel Bateman Date: Thu, 29 Mar 2012 22:35:47 -0500 Subject: aries-common: Fix "tunnel voice" bug for Vibrant, possibly others. Problem: During incoming calls, some users sound very echoey to the caller. Hypothesis: setCallClockSync() is being called even entering MODE_RINGTONE, when it makes sense that it should only be called when actually entering the call itself, this also supports why it doesn't happen on outgoing calls, i.e. instantly entering the call and activating the call clock sync rather than activating it at the ringtone. Solution: Restrict setCallClockSync() to only fire when prevMode != IN_CALL && mMode == IN_CALL. Change-Id: Ie6c923846e98bb8b7e42520b831dbaf7f671d4d1 --- libaudio/AudioHardware.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp index ac2e65d..4064a95 100644 --- a/libaudio/AudioHardware.cpp +++ b/libaudio/AudioHardware.cpp @@ -387,8 +387,8 @@ status_t AudioHardware::setMode(int mode) status = AudioHardwareBase::setMode(mode); LOGV("setMode() : new %d, old %d", mMode, prevMode); if (status == NO_ERROR) { - // activate call clock in radio when entering in call or ringtone mode - if (prevMode == AudioSystem::MODE_NORMAL) + // activate call clock in radio when entering in call mode + if (mMode == AudioSystem::MODE_IN_CALL) { if ((!mActivatedCP) && (mSecRilLibHandle) && (connectRILDIfRequired() == OK)) { setCallClockSync(mRilClient, SOUND_CLOCK_START); -- cgit v1.1