diff options
author | Eric Laurent <elaurent@google.com> | 2010-03-06 15:46:31 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-03-08 06:50:44 -0800 |
commit | fe2e075e07a4764857c48fbe9b5a11b4d6423f1d (patch) | |
tree | 3e1e85a77780f70aba7e0a90c30125b8a727d9b7 /libs | |
parent | 239038094493b3b1ac262222d1f21254b48d4fc6 (diff) | |
download | frameworks_base-fe2e075e07a4764857c48fbe9b5a11b4d6423f1d.zip frameworks_base-fe2e075e07a4764857c48fbe9b5a11b4d6423f1d.tar.gz frameworks_base-fe2e075e07a4764857c48fbe9b5a11b4d6423f1d.tar.bz2 |
Fix issue 2317760: Change the priority between wired headset and A2DP.
Modified audio policy manager so that wired headset has precedence over A2DP headset.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/audioflinger/AudioPolicyManagerBase.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/audioflinger/AudioPolicyManagerBase.cpp b/libs/audioflinger/AudioPolicyManagerBase.cpp index 7b866c7..cfcc3ea 100644 --- a/libs/audioflinger/AudioPolicyManagerBase.cpp +++ b/libs/audioflinger/AudioPolicyManagerBase.cpp @@ -1290,7 +1290,7 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy, u a2dpOutputDesc->changeRefCount((AudioSystem::stream_type)i,-refCount); } } - // do not change newDevice is it was already set before this call by a previous call to + // do not change newDevice if it was already set before this call by a previous call to // getNewDevice() or checkOutputForStrategy() for a strategy with higher priority if (newDevice == 0 && hwOutputDesc->isUsedByStrategy(strategy)) { newDevice = getDeviceForStrategy(strategy, false); @@ -1466,6 +1466,12 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, case STRATEGY_MEDIA: { uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; + if (device2 == 0) { + device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; + } + if (device2 == 0) { + device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; + } #ifdef WITH_A2DP if (mA2dpOutput != 0) { if (strategy == STRATEGY_SONIFICATION && !a2dpUsedForSonification()) { @@ -1483,12 +1489,6 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, } #endif if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; - } - if (device2 == 0) { - device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; - } - if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; } |