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

Commit 3fc792fe authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

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

parents 3ecc9db4 093a20cb
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line 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++) {
    for (size_t routeIndex = 0; routeIndex < mOutputRoutes.size(); routeIndex++) {
        sp<SessionRoute> route = mOutputRoutes.valueAt(routeIndex);
        sp<SessionRoute> route = mOutputRoutes.valueAt(routeIndex);
        routing_strategy strat = getStrategy(route->mStreamType);
        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();
            return route->mDeviceDescriptor->type();
        }
        }
    }
    }