summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJungshik Jang <jayjang@google.com>2014-09-05 21:25:48 +0900
committerJungshik Jang <jayjang@google.com>2014-09-05 21:25:48 +0900
commita1f9917243caafd1da5fa743c6fda1d0614ed167 (patch)
tree5ffd1f439162dab1f76b6b1bb51b03aa8f3901a8 /services
parent6a548e9114c4a283a6e08a2d35540f8549f44b82 (diff)
downloadframeworks_av-a1f9917243caafd1da5fa743c6fda1d0614ed167.zip
frameworks_av-a1f9917243caafd1da5fa743c6fda1d0614ed167.tar.gz
frameworks_av-a1f9917243caafd1da5fa743c6fda1d0614ed167.tar.bz2
Fix "invalid device combination" in system audio mode.
HDMI-CEC system audio mode removes speaker from output list. It also has multiple outputs by connected outputs. However, getDeviceForVolume() doesn't cover multiple output with no speaker or bluetooth case. This change picks one of system audio outputs in order. Bug: 17400026 Change-Id: I102fd0052c9c4c9543f9e8f3b16ec6815d7485d8
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index a805923..084c853 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -4634,8 +4634,15 @@ audio_devices_t AudioPolicyManager::getDeviceForVolume(audio_devices_t device)
// - one A2DP device + another device: happens with duplicated output. In this case
// retain the device on the A2DP output as the other must not correspond to an active
// selection if not the speaker.
+ // - HDMI-CEC system audio mode only output: give priority to available item in order.
if (device & AUDIO_DEVICE_OUT_SPEAKER) {
device = AUDIO_DEVICE_OUT_SPEAKER;
+ } else if (device & AUDIO_DEVICE_OUT_HDMI_ARC) {
+ device = AUDIO_DEVICE_OUT_HDMI_ARC;
+ } else if (device & AUDIO_DEVICE_OUT_AUX_LINE) {
+ device = AUDIO_DEVICE_OUT_AUX_LINE;
+ } else if (device & AUDIO_DEVICE_OUT_SPDIF) {
+ device = AUDIO_DEVICE_OUT_SPDIF;
} else {
device = (audio_devices_t)(device & AUDIO_DEVICE_OUT_ALL_A2DP);
}