diff options
author | Adam Powell <adamp@google.com> | 2012-06-24 14:30:46 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2012-06-24 14:32:04 -0700 |
commit | dbbfa702a09f6d2d36dee1b552442d04a4673f89 (patch) | |
tree | a16c72409533902cded3d9583be22317d092108e | |
parent | 40a0376ea5ac597d8df04fd3e4ad8bde7ac7c9ec (diff) | |
download | frameworks_base-dbbfa702a09f6d2d36dee1b552442d04a4673f89.zip frameworks_base-dbbfa702a09f6d2d36dee1b552442d04a4673f89.tar.gz frameworks_base-dbbfa702a09f6d2d36dee1b552442d04a4673f89.tar.bz2 |
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
-rw-r--r-- | media/java/android/media/MediaRouter.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/media/java/android/media/MediaRouter.java b/media/java/android/media/MediaRouter.java index 8a9a764..357bf4e 100644 --- a/media/java/android/media/MediaRouter.java +++ b/media/java/android/media/MediaRouter.java @@ -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); |