OSDN Git Service

AVRCP: Report current playing item for now playing
authorMarie Janssen <jamuraa@google.com>
Thu, 6 Apr 2017 23:38:23 +0000 (16:38 -0700)
committerMarie Janssen <jamuraa@google.com>
Thu, 20 Apr 2017 16:02:34 +0000 (16:02 +0000)
commitb3436e976055f684050be9afdadc73645316806a
treea49dee9a1aeac08a749a7fe628a7a7b977d4fe0c
parent180c9367c92b4dc1e0ba854e5cafe4641d756ab0
AVRCP: Report current playing item for now playing

According to the Bluetooth AVRCP 1.6.1 (p79):
 In the case where the media player does not natively support a Now
 Playing folder, it may present a folder containing one item, the
 currently playing media element, as would be returned by a
 GetElementAttributes command with the now playing UID.

Send this one-item list back when we don't have a queue, and try to
refresh the queue from the current player when we need to.

When a browsable player is selected, it's illegal for us to send a
response to EVT_TRACK_CHANGED with the now playing UID, so make up a
fake qid for this one item list in this case, since ids are only valid
within the current folder for database-unaware players anyway.

Respond with "no players available" when we actually don't have a
player.

Also fixes a bug where we would try to send the current queue back twice,
and reduces logspam in the main message handler by half.

Test: connect to carkit, test basic playback
Bug: 32800406
Bug: 36645066
Bug: 36055995
Bug: 36645066
Change-Id: Ia16c05bfc849359ca857b03edd5a75e21f13d6fb
(cherry picked from commit 5cbc96dc8da6b455c0d0a142d27274708ac1f208)
src/com/android/bluetooth/avrcp/AddressedMediaPlayer.java
src/com/android/bluetooth/avrcp/Avrcp.java
src/com/android/bluetooth/avrcp/AvrcpHelperClasses.java