OSDN Git Service

Allow Java-land to request current track metadata through JNI
authorSal Savage <salsavage@google.com>
Thu, 30 Apr 2020 22:10:08 +0000 (15:10 -0700)
committerMyles Watson <mylesgw@google.com>
Fri, 8 May 2020 22:35:26 +0000 (22:35 +0000)
commitd39a5ba44ae86dcd4ccbb1ea19d8e5b137334fee
tree8964eba67acd70647daa62b3b89fa061bc0d034d
parentfd6bc2f4e1bcdf1b3287b00fbd249582d1552ca4
Allow Java-land to request current track metadata through JNI

AVRCP Targets are not supposed to give image handles over with metadata
until an AVRCP BIP client connects from a particular controller. Because
this connection can happen any time and there's nothing forcing a target
to send us a track changed notification to inform us of the new handle,
the best thing we can do to work with all devices is to request it when
we connect on BIP. Otherwise, we risk a race condition between the BIP
connection and any amount of track changed notifications that might
happen organically. Our JNI doesn't current support requesting current
track metadata.

This change adds/implements a get_current_track_metadata() method to the
JNI. This, paired with a change in /packages/apps/Bluetooth/, fixes the
above mentioned race condition and keeps us from missing out on possible
cover art image handles.

Bug: 152655644
Test: Build, flash, test with AVRCP target cover art devices
Change-Id: I9d1f28068b4fded61d5336da8d864fbd9ef34f98
Merged-In: I9d1f28068b4fded61d5336da8d864fbd9ef34f98
btif/src/btif_rc.cc
include/hardware/bt_rc.h