summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2014-12-17 17:31:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-12-17 17:31:33 +0000
commit71b52b5bb3be81bffa320241ca486fbf964d743e (patch)
tree39c9146e8b3a4721bcafbc4b2f19158176ff00cc /services
parent277c7b8c41436125742339d8c80bccf0f2b086d9 (diff)
parentfe472e292ab50c121ff93dffa3b54c96feedcfef (diff)
downloadframeworks_av-71b52b5bb3be81bffa320241ca486fbf964d743e.zip
frameworks_av-71b52b5bb3be81bffa320241ca486fbf964d743e.tar.gz
frameworks_av-71b52b5bb3be81bffa320241ca486fbf964d743e.tar.bz2
Merge "Fix routing not happening after change in output device list" into lmp-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp18
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]);