diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-12-17 17:43:22 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-17 17:43:22 +0000 |
commit | 22dfb93254de370d401706728aba1f032ef1b172 (patch) | |
tree | 7adc8458ed0b666dd0e9e623067583ccb3b677a1 /services | |
parent | 93118cd96233b682be95a3eb114d88d69c8cc416 (diff) | |
parent | 8aadc515b57c78cbb07ae7d0cb2553148ef05947 (diff) | |
download | frameworks_av-22dfb93254de370d401706728aba1f032ef1b172.zip frameworks_av-22dfb93254de370d401706728aba1f032ef1b172.tar.gz frameworks_av-22dfb93254de370d401706728aba1f032ef1b172.tar.bz2 |
am 8aadc515: am 71b52b5b: Merge "Fix routing not happening after change in output device list" into lmp-mr1-dev
* commit '8aadc515b57c78cbb07ae7d0cb2553148ef05947':
Fix routing not happening after change in output device list
Diffstat (limited to 'services')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 3fe0547..a3389e0 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4055,6 +4055,24 @@ void AudioPolicyManager::checkOutputForStrategy(routing_strategy strategy) SortedVector<audio_io_handle_t> srcOutputs = getOutputsForDevice(oldDevice, mPreviousOutputs); SortedVector<audio_io_handle_t> dstOutputs = getOutputsForDevice(newDevice, mOutputs); + // also take into account external policy-related changes: add all outputs which are + // associated with policies in the "before" and "after" output vectors + ALOGVV("checkOutputForStrategy(): policy related outputs"); + for (size_t i = 0 ; i < mPreviousOutputs.size() ; i++) { + const sp<AudioOutputDescriptor> desc = mPreviousOutputs.valueAt(i); + if (desc != 0 && desc->mPolicyMix != NULL) { + srcOutputs.add(desc->mIoHandle); + ALOGVV(" previous outputs: adding %d", desc->mIoHandle); + } + } + for (size_t i = 0 ; i < mOutputs.size() ; i++) { + const sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i); + if (desc != 0 && desc->mPolicyMix != NULL) { + dstOutputs.add(desc->mIoHandle); + ALOGVV(" new outputs: adding %d", desc->mIoHandle); + } + } + if (!vectorsEqual(srcOutputs,dstOutputs)) { ALOGV("checkOutputForStrategy() strategy %d, moving from output %d to output %d", strategy, srcOutputs[0], dstOutputs[0]); |