OSDN Git Service

AVRCP: Pick a media player ASAP
authorMarie Janssen <jamuraa@google.com>
Sat, 22 Apr 2017 01:22:54 +0000 (18:22 -0700)
committerMarie Janssen <jamuraa@google.com>
Tue, 25 Apr 2017 00:23:31 +0000 (17:23 -0700)
Fix things to pick a "default media player" as soon as we can so that
connected devices have something to send media commands to.  This is
also in line with the spec.

Previously we were not detecting when we didn't have a media player
selected and selecting one.

Test: boot with com.android.music and connect to carkit, check logs
Bug: 36016671
Change-Id: I89175a3d513635d7cf8b75f5010967b99d5490aa
(cherry picked from commit 793470cef61d887cc26ce793e21e411733af8b38)

src/com/android/bluetooth/avrcp/Avrcp.java

index 497acc1..5ac5e03 100644 (file)
@@ -1568,7 +1568,7 @@ public final class Avrcp {
 
                     if (playersChanged) {
                         mHandler.sendEmptyMessage(MSG_AVAILABLE_PLAYERS_CHANGED_RSP);
-                        if (newControllers.size() > 0 && (mAddressedMediaPlayer == null)) {
+                        if (newControllers.size() > 0 && (mMediaController == null)) {
                             if (DEBUG)
                                 Log.v(TAG,
                                         "No addressed player but active sessions, taking first.");