From 31363a9cb94e80330c335fede0b92b1953a09517 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Thu, 11 Oct 2012 18:06:33 -0700 Subject: [PATCH] Remote audio submix always has priority for media, only plays media Don't use force use mechanism for remote audio submix routing. Prevent streams of strategy sonification to be played over remote audio submix (e.g. WFD) and HDMI Bug 7318180 Change-Id: Ic5c87d3c568873dffea9002cf87ecf42b403cde6 --- audio/AudioPolicyManagerBase.cpp | 10 +++++----- include/hardware_legacy/AudioSystemLegacy.h | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index cacc37d..51b1501 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -387,8 +387,7 @@ void AudioPolicyManagerBase::setForceUse(AudioSystem::force_use usage, AudioSyst config != AudioSystem::FORCE_WIRED_ACCESSORY && config != AudioSystem::FORCE_ANALOG_DOCK && config != AudioSystem::FORCE_DIGITAL_DOCK && config != AudioSystem::FORCE_NONE && - config != AudioSystem::FORCE_NO_BT_A2DP && - config != AudioSystem::FORCE_REMOTE_SUBMIX) { + config != AudioSystem::FORCE_NO_BT_A2DP) { ALOGW("setForceUse() invalid config %d for FOR_MEDIA", config); return; } @@ -2187,8 +2186,8 @@ audio_devices_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy st case STRATEGY_MEDIA: { uint32_t device2 = AUDIO_DEVICE_NONE; - if (mHasRemoteSubmix - && mForceUse[AudioSystem::FOR_MEDIA] == AudioSystem::FORCE_REMOTE_SUBMIX) { + if (strategy != STRATEGY_SONIFICATION) { + // no sonification on remote submix (e.g. WFD) device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_REMOTE_SUBMIX; } if ((device2 == AUDIO_DEVICE_NONE) && @@ -2217,7 +2216,8 @@ audio_devices_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy st if (device2 == AUDIO_DEVICE_NONE) { device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET; } - if (device2 == AUDIO_DEVICE_NONE) { + if ((device2 == AUDIO_DEVICE_NONE) && (strategy != STRATEGY_SONIFICATION)) { + // no sonification on aux digital (e.g. HDMI) device2 = mAvailableOutputDevices & AUDIO_DEVICE_OUT_AUX_DIGITAL; } if (device2 == AUDIO_DEVICE_NONE) { diff --git a/include/hardware_legacy/AudioSystemLegacy.h b/include/hardware_legacy/AudioSystemLegacy.h index 0b9b4d0..6296b8b 100644 --- a/include/hardware_legacy/AudioSystemLegacy.h +++ b/include/hardware_legacy/AudioSystemLegacy.h @@ -288,7 +288,6 @@ public: FORCE_ANALOG_DOCK, FORCE_DIGITAL_DOCK, FORCE_NO_BT_A2DP, - FORCE_REMOTE_SUBMIX, FORCE_SYSTEM_ENFORCED, NUM_FORCE_CONFIG, FORCE_DEFAULT = FORCE_NONE