AVRCP: Only send the active player for media player listings

Some carkits will try to connect to the first player in the media player
list (Harman BMW) while other carkits will try to connect to the last player
in the listing (Magneti BMW). Send only one player in the listing so that
it doesn't matter if it connects to the first or the last.

Bug: 64991621
Bug: 64749777
Test: Connect to Harman BMW and see that the player listing only has one entry
      with multiple players installed, on Magneti carkit see that the carkit
      sets the current addressed player instead of a player that wasn't

Change-Id: Ia8410473a5642bcc4ac7d1986c8c647fb7a4d78d
(cherry picked from commit 82cfeee4ed9139eeb55e6823d9b721ba17db8b25)
(cherry picked from commit 37b7b5b41a1ef3a872b93fd292a6c8129b34f347)
(cherry picked from commit ff67f992d4df21bd3dbe7be1f935bbffed3083a1)
diff --git a/src/com/android/bluetooth/avrcp/Avrcp.java b/src/com/android/bluetooth/avrcp/Avrcp.java
index 08adf81..61d7adf 100644
--- a/src/com/android/bluetooth/avrcp/Avrcp.java
+++ b/src/com/android/bluetooth/avrcp/Avrcp.java
@@ -2043,7 +2043,12 @@
     /* prepare media list & return the media player list response object */
     private MediaPlayerListRsp prepareMediaPlayerRspObj() {
         synchronized (mMediaPlayerInfoList) {
-            int numPlayers = mMediaPlayerInfoList.size();
+            // TODO(apanicke): This hack will go away as soon as a developer
+            // option to enable or disable player selection is created. Right
+            // now this is needed to fix BMW i3 carkits and any other carkits
+            // that might try to connect to a player that isnt the current
+            // player based on this list
+            int numPlayers = 1;
             int[] playerIds = new int[numPlayers];
             byte[] playerTypes = new byte[numPlayers];
@@ -2058,7 +2063,10 @@
             int players = mMediaPlayerInfoList.containsKey(mCurrAddrPlayerID) ? 1 : 0;
             for (Map.Entry<Integer, MediaPlayerInfo> entry : mMediaPlayerInfoList.entrySet()) {
                 int idx = players;
-                if (entry.getKey() == mCurrAddrPlayerID) idx = 0;
+                if (entry.getKey() == mCurrAddrPlayerID)
+                    idx = 0;
+                else
+                    continue; // TODO(apanicke): Remove, see above note
                 MediaPlayerInfo info = entry.getValue();
                 playerIds[idx] = entry.getKey();
                 playerTypes[idx] = info.getMajorType();