diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 23:25:39 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-21 23:25:39 +0000 |
commit | 6adb8973e1bea0f803f73c21aaaa777b2e71d7b2 (patch) | |
tree | bf04cfdc71ba8bfe00a615d0de19238e3509532a | |
parent | 16aed86d1203719826b68c6f9d5bd17e50d7a9fd (diff) | |
parent | eb978012030d0eb5449b8a5b41d041ba42db1c46 (diff) | |
download | Bluetooth-6adb8973e1bea0f803f73c21aaaa777b2e71d7b2.tar.gz |
Merge cherrypicks of [2940345, 2938007, 2940429, 2939599, 2939600, 2940430, 2940431, 2940432, 2940433, 2939601, 2939602, 2940112, 2940113, 2940114, 2940115, 2940116, 2938720, 2938721, 2938722, 2938723, 2938724, 2939603, 2939604, 2939605, 2939608, 2938725, 2938008, 2940438, 2940439, 2938727, 2940549, 2940551, 2940553, 2938335, 2940555, 2940557, 2940440] into oc-releaseandroid-8.0.0_r28oreo-release
Change-Id: If0b35a0fc42a3c3f4649c92524b747ed0ed2910f
-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(); |