Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 800de5c6 authored by Eric Laurent's avatar Eric Laurent Committed by Android Git Automerger
Browse files

am 3fc792fe: Merge "audio policy: fix explicit routing and accessibility" into mnc-dev

* commit '3fc792fe':
  audio policy: fix explicit routing and accessibility
parents cadc1505 3fc792fe
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4069,7 +4069,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();
        }
    }