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

Commit bd4b726f authored by Oliver Woodman's avatar Oliver Woodman
Browse files

System Router: Don't filter by individual prefs

Individual discovery preferences are not supposed to be
applied for system router instances. There was a bug in
ag/17071600 that caused them to be applied incorrectly.

Test: atest SystemMediaRouter2Test
Bug: 223378315
Change-Id: I778530ed0e7611c8c9433aa20cf0e0bbc4d2cc61
parent f594db70
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1118,6 +1118,11 @@ public final class MediaRouter2 {
    private List<MediaRoute2Info> filterRoutesWithIndividualPreference(
            List<MediaRoute2Info> routes, RouteDiscoveryPreference discoveryPreference) {
        List<MediaRoute2Info> filteredRoutes = new ArrayList<>();
        if (isSystemRouter()) {
            // Individual discovery preferences do not apply for the system router.
            filteredRoutes.addAll(routes);
            return filteredRoutes;
        }
        for (MediaRoute2Info route : routes) {
            if (!route.hasAnyFeatures(discoveryPreference.getPreferredFeatures())) {
                continue;