diff options
author | Eric Laurent <elaurent@google.com> | 2011-09-09 08:27:16 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-09-09 08:27:16 -0700 |
commit | c8f1c1e7c46e3a3d6f31d181c9597fe96919a388 (patch) | |
tree | 8fa3f03b464a457276cd98137c5e8369e710bc25 | |
parent | 81601acb5f23cfd63134717d4486a1d31e3a7694 (diff) | |
parent | 49cb776c1a5d056c345d90465f8006ef23d947b0 (diff) | |
download | device_samsung_crespo-c8f1c1e7c46e3a3d6f31d181c9597fe96919a388.zip device_samsung_crespo-c8f1c1e7c46e3a3d6f31d181c9597fe96919a388.tar.gz device_samsung_crespo-c8f1c1e7c46e3a3d6f31d181c9597fe96919a388.tar.bz2 |
Merge "audio HAL: fix some audio mode transitions"
-rw-r--r-- | libaudio/AudioHardware.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libaudio/AudioHardware.cpp b/libaudio/AudioHardware.cpp index c58e084..a189510 100644 --- a/libaudio/AudioHardware.cpp +++ b/libaudio/AudioHardware.cpp @@ -376,8 +376,10 @@ status_t AudioHardware::setMode(int mode) status = AudioHardwareBase::setMode(mode); LOGV("setMode() : new %d, old %d", mMode, prevMode); if (status == NO_ERROR) { + bool modeNeedsCPActive = mMode == AudioSystem::MODE_IN_CALL || + mMode == AudioSystem::MODE_RINGTONE; // activate call clock in radio when entering in call or ringtone mode - if (prevMode == AudioSystem::MODE_NORMAL) + if (modeNeedsCPActive) { if ((!mActivatedCP) && (mSecRilLibHandle) && (connectRILDIfRequired() == OK)) { setCallClockSync(mRilClient, SOUND_CLOCK_START); @@ -402,7 +404,7 @@ status_t AudioHardware::setMode(int mode) setVoiceVolume_l(mVoiceVol); mInCallAudioMode = true; } - if (mMode == AudioSystem::MODE_NORMAL && mInCallAudioMode) { + if (mMode != AudioSystem::MODE_IN_CALL && mInCallAudioMode) { setInputSource_l(mInputSource); if (mMixer != NULL) { TRACE_DRIVER_IN(DRV_MIXER_GET) @@ -431,7 +433,7 @@ status_t AudioHardware::setMode(int mode) mInCallAudioMode = false; } - if (mMode == AudioSystem::MODE_NORMAL) { + if (!modeNeedsCPActive) { if(mActivatedCP) mActivatedCP = false; } |