diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-26 18:41:29 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-26 18:41:29 +0000 |
commit | 51a7a41514622e68998b4f77022f8a93af530588 (patch) | |
tree | 22adcb96a1f813d00f0d63eab778d85463bc10ea /services/audiopolicy | |
parent | 121143d5242a790d0bd01fe1b9cec5d28a1ba1d7 (diff) | |
parent | 5bf757cfb8b43e5d92be95a8c700e4b7839f6730 (diff) | |
download | frameworks_av-51a7a41514622e68998b4f77022f8a93af530588.zip frameworks_av-51a7a41514622e68998b4f77022f8a93af530588.tar.gz frameworks_av-51a7a41514622e68998b4f77022f8a93af530588.tar.bz2 |
am 5bf757cf: am 087eb332: Merge "audio policy: do not route accessibility prompts to compressed output" into lmp-mr1-dev
* commit '5bf757cfb8b43e5d92be95a8c700e4b7839f6730':
audio policy: do not route accessibility prompts to compressed output
Diffstat (limited to 'services/audiopolicy')
-rw-r--r-- | services/audiopolicy/AudioPolicyManager.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 8ca0b96..cd8df2f 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4355,6 +4355,21 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate // FIXME: STRATEGY_ACCESSIBILITY and STRATEGY_REROUTING follow STRATEGY_MEDIA for now case STRATEGY_ACCESSIBILITY: + if (strategy == STRATEGY_ACCESSIBILITY) { + // do not route accessibility prompts to a digital output currently configured with a + // compressed format as they would likely not be mixed and dropped. + for (size_t i = 0; i < mOutputs.size(); i++) { + sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i); + audio_devices_t devices = desc->device() & + (AUDIO_DEVICE_OUT_HDMI | AUDIO_DEVICE_OUT_SPDIF | AUDIO_DEVICE_OUT_HDMI_ARC); + if (desc->isActive() && !audio_is_linear_pcm(desc->mFormat) && + devices != AUDIO_DEVICE_NONE) { + availableOutputDeviceTypes = availableOutputDeviceTypes & ~devices; + } + } + } + // FALL THROUGH + case STRATEGY_REROUTING: case STRATEGY_MEDIA: { uint32_t device2 = AUDIO_DEVICE_NONE; |