Skip to content

Commit dbbfa70

Browse files
committed
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
1 parent 40a0376 commit dbbfa70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

media/java/android/media/MediaRouter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public void addCallback(int types, Callback cb) {
240240
for (int i = 0; i < count; i++) {
241241
final CallbackInfo info = sStatic.mCallbacks.get(i);
242242
if (info.cb == cb) {
243-
info.type &= types;
243+
info.type |= types;
244244
return;
245245
}
246246
}
@@ -342,6 +342,7 @@ static void addRoute(RouteInfo info) {
342342
if (cat.isGroupable() && !(info instanceof RouteGroup)) {
343343
// Enforce that any added route in a groupable category must be in a group.
344344
final RouteGroup group = new RouteGroup(info.getCategory());
345+
group.mSupportedTypes = info.mSupportedTypes;
345346
sStatic.mRoutes.add(group);
346347
dispatchRouteAdded(group);
347348
group.addRoute(info);

0 commit comments

Comments
 (0)