summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2014-11-18 20:23:27 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-18 20:23:27 +0000
commit9544a8e904955f4b96ec9f2d6f4edc2a72afd270 (patch)
treef50154cfe53b481c0694b9c0ad31d1b1d235183e /services
parent3126b50345a9fc0e5d6d9e58226795735e04932f (diff)
parentbfa77b5c687f217e26267693306aaa6cc8a63672 (diff)
downloadframeworks_av-9544a8e904955f4b96ec9f2d6f4edc2a72afd270.zip
frameworks_av-9544a8e904955f4b96ec9f2d6f4edc2a72afd270.tar.gz
frameworks_av-9544a8e904955f4b96ec9f2d6f4edc2a72afd270.tar.bz2
am bfa77b5c: am 8cd37d67: Merge "audio policy: do not prevent routing to A2DP when suspended." into lmp-mr1-dev
* commit 'bfa77b5c687f217e26267693306aaa6cc8a63672': audio policy: do not prevent routing to A2DP when suspended.
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index fff7746..20a72b0 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -3983,9 +3983,17 @@ uint32_t AudioPolicyManager::getStrategyForAttr(const audio_attributes_t *attr)
// usage to strategy mapping
switch (attr->usage) {
+ case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY:
+ if (isStreamActive(AUDIO_STREAM_RING) || isStreamActive(AUDIO_STREAM_ALARM)) {
+ return (uint32_t) STRATEGY_SONIFICATION;
+ }
+ if (isInCall()) {
+ return (uint32_t) STRATEGY_PHONE;
+ }
+ // FALL THROUGH
+
case AUDIO_USAGE_MEDIA:
case AUDIO_USAGE_GAME:
- case AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY:
case AUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE:
case AUDIO_USAGE_ASSISTANCE_SONIFICATION:
return (uint32_t) STRATEGY_MEDIA;
@@ -4185,7 +4193,7 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
// when not in a phone call, phone strategy should route STREAM_VOICE_CALL to A2DP
if (!isInCall() &&
(mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0) && !mA2dpSuspended) {
+ (getA2dpOutput() != 0)) {
device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
if (device) break;
device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
@@ -4220,7 +4228,7 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
// A2DP speaker when forcing to speaker output
if (!isInCall() &&
(mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0) && !mA2dpSuspended) {
+ (getA2dpOutput() != 0)) {
device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
if (device) break;
}
@@ -4282,7 +4290,7 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
}
if ((device2 == AUDIO_DEVICE_NONE) &&
(mForceUse[AUDIO_POLICY_FORCE_FOR_MEDIA] != AUDIO_POLICY_FORCE_NO_BT_A2DP) &&
- (getA2dpOutput() != 0) && !mA2dpSuspended) {
+ (getA2dpOutput() != 0)) {
device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP;
if (device2 == AUDIO_DEVICE_NONE) {
device2 = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;