diff options
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]); |