diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2014-12-17 17:38:45 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-17 17:38:45 +0000 |
commit | 8aadc515b57c78cbb07ae7d0cb2553148ef05947 (patch) | |
tree | 39c9146e8b3a4721bcafbc4b2f19158176ff00cc /services/audiopolicy | |
parent | 99429b40411790b85e19c57392bbd292a237c470 (diff) | |
parent | 71b52b5bb3be81bffa320241ca486fbf964d743e (diff) | |
download | frameworks_av-8aadc515b57c78cbb07ae7d0cb2553148ef05947.zip frameworks_av-8aadc515b57c78cbb07ae7d0cb2553148ef05947.tar.gz frameworks_av-8aadc515b57c78cbb07ae7d0cb2553148ef05947.tar.bz2 |
am 71b52b5b: Merge "Fix routing not happening after change in output device list" into lmp-mr1-dev
* commit '71b52b5bb3be81bffa320241ca486fbf964d743e':
Fix routing not happening after change in output device list
Diffstat (limited to 'services/audiopolicy')
-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]); |