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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user