summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/managerdefault
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-06-11 12:33:29 -0700
committerEric Laurent <elaurent@google.com>2015-06-11 12:33:29 -0700
commit093a20cbe70d0033c085ef7be90b9f1bbacb3335 (patch)
tree1e4ecd5a5cfe13d30d3221070511d5f68c7d4a75 /services/audiopolicy/managerdefault
parent4599da7f4ca67a323aa64d84c1b79e3ce6ab9f41 (diff)
downloadframeworks_av-093a20cbe70d0033c085ef7be90b9f1bbacb3335.zip
frameworks_av-093a20cbe70d0033c085ef7be90b9f1bbacb3335.tar.gz
frameworks_av-093a20cbe70d0033c085ef7be90b9f1bbacb3335.tar.bz2
audio policy: fix explicit routing and accessibility
If a session has an active explicit routing request, this routing must also be applied to accessibility prompts if accessibility usage is currrently remapped to the strategy used by this session. Bug: 20873151. Change-Id: I97c6ece98cf1af9c64c2d2eb1fe382c7c0d657b4
Diffstat (limited to 'services/audiopolicy/managerdefault')
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 0adaac9..bded309 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -4064,7 +4064,14 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
for (size_t routeIndex = 0; routeIndex < mOutputRoutes.size(); routeIndex++) {
sp<SessionRoute> route = mOutputRoutes.valueAt(routeIndex);
routing_strategy strat = getStrategy(route->mStreamType);
- if (strat == strategy && route->isActive()) {
+ // Special case for accessibility strategy which must follow any strategy it is
+ // currently remapped to
+ bool strategyMatch = (strat == strategy) ||
+ ((strategy == STRATEGY_ACCESSIBILITY) &&
+ ((mEngine->getStrategyForUsage(
+ AUDIO_USAGE_ASSISTANCE_ACCESSIBILITY) == strat) ||
+ (strat == STRATEGY_MEDIA)));
+ if (strategyMatch && route->isActive()) {
return route->mDeviceDescriptor->type();
}
}