OSDN Git Service

AVRCP: Track players without active media sessions
authorMarie Janssen <jamuraa@google.com>
Tue, 2 May 2017 22:28:23 +0000 (15:28 -0700)
committerMarie Janssen <jamuraa@google.com>
Thu, 4 May 2017 00:50:58 +0000 (17:50 -0700)
commitd89304c6be6e1c332008dcbeab08889881064454
tree3938019bf81e35378322963a7435ffa80f6ac79a
parentf6c35442b0506c37bf339d35fc0df1ec52fa1606
AVRCP: Track players without active media sessions

Players can be selected as addressed by MediaSessionService, then
destroy and renew their MediaSession. We want them to continue to
be addressed.

Don't remove players that destroy their MediaSession, and just forget
the controller instead.

Remove players when their package is removed though.

Report "(unknown)" when we are asked for media info for an addressed
player that has no controller.

Fix a bug where we didn't send updated metadata when it changed.
Fix an ordering bug updating the media session.

Make logging more clear when we're adding / updating / removing players.
Add dumpsys log to confirm current mMediaController is correct.

Use @Nullable and @NonNull to help with distinguishing when
MediaController can be null in AddressedMediaPlayer.

Test: send pause / play from headset, look at bugreport to confirm
Change-Id: I083745f8988e67776716db2bec5e67b697e8ee67
Bug: 36357185
Fixes: 37865298
(cherry picked from commit 384011244f5a62ed34f198b8ba91341b4efb4fb6)
src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java
src/com/android/bluetooth/avrcp/Avrcp.java
src/com/android/bluetooth/avrcp/mockable/MediaController.java