diff options
author | android-build-prod (mdb) <android-build-team-robot@google.com> | 2017-11-10 01:16:40 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-10 01:16:40 +0000 |
commit | 165e353e520e19bf9ac19f3e3440bdcd1bbc09c9 (patch) | |
tree | bf04cfdc71ba8bfe00a615d0de19238e3509532a | |
parent | da04aa1c0dc2c34d9c5cfa94f894607617027e49 (diff) | |
parent | 7b8a112bedd0f6213d229bc8a8c7c00941343dcd (diff) | |
download | Bluetooth-165e353e520e19bf9ac19f3e3440bdcd1bbc09c9.tar.gz |
Merge "Snap for 4444158 from 6adb8973e1bea0f803f73c21aaaa777b2e71d7b2 to oreo-cts-release" into oreo-cts-releaseandroid-cts-8.0_r9android-cts-8.0_r8android-cts-8.0_r7android-cts-8.0_r6android-cts-8.0_r5android-cts-8.0_r4android-cts-8.0_r26android-cts-8.0_r25android-cts-8.0_r24android-cts-8.0_r23android-cts-8.0_r22android-cts-8.0_r21android-cts-8.0_r20android-cts-8.0_r19android-cts-8.0_r18android-cts-8.0_r17android-cts-8.0_r16android-cts-8.0_r15android-cts-8.0_r14android-cts-8.0_r13android-cts-8.0_r12android-cts-8.0_r11android-cts-8.0_r10oreo-cts-release
-rw-r--r-- | src/com/android/bluetooth/avrcp/Avrcp.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/bluetooth/avrcp/Avrcp.java b/src/com/android/bluetooth/avrcp/Avrcp.java index 08adf818d..61d7adf06 100644 --- a/src/com/android/bluetooth/avrcp/Avrcp.java +++ b/src/com/android/bluetooth/avrcp/Avrcp.java @@ -2043,7 +2043,12 @@ public final class Avrcp { /* 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 @@ public final class Avrcp { 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(); |