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

Commit dbbfa702 authored by Adam Powell's avatar Adam Powell
Browse files

Fix MediaRouter bugs

Fix a bug where a newly added group had no supported types at the time
of callback dispatch, meaning that no registered callbacks would be
invoked.

Fix a bug where subscribed type flags were not updated properly when
re-adding a callback for new types.

Change-Id: I7d9f11b363ebdca692786cec1d432600946e5721
parent 40a0376e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ public class MediaRouter {
        for (int i = 0; i < count; i++) {
            final CallbackInfo info = sStatic.mCallbacks.get(i);
            if (info.cb == cb) {
                info.type &= types;
                info.type |= types;
                return;
            }
        }
@@ -342,6 +342,7 @@ public class MediaRouter {
        if (cat.isGroupable() && !(info instanceof RouteGroup)) {
            // Enforce that any added route in a groupable category must be in a group.
            final RouteGroup group = new RouteGroup(info.getCategory());
            group.mSupportedTypes = info.mSupportedTypes;
            sStatic.mRoutes.add(group);
            dispatchRouteAdded(group);
            group.addRoute(info);