diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-22 23:22:17 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-09-22 23:22:17 +0000 |
commit | 2fd7f1b5cccac229db45930a6cdcaa82e093d033 (patch) | |
tree | bf04cfdc71ba8bfe00a615d0de19238e3509532a | |
parent | 063f2bf9913d5cafe7151e6232973b83ad95ff9b (diff) | |
parent | 2f766501525329dec36a247956f913823bc4d7ba (diff) | |
download | android_packages_apps_Bluetooth-lineage-15.0.tar.gz android_packages_apps_Bluetooth-lineage-15.0.tar.bz2 android_packages_apps_Bluetooth-lineage-15.0.zip |
Merge cherrypicks of [2947251, 2947338, 2947252, 2947253, 2946095, 2946096, 2946097, 2946098, 2947211, 2947212, 2947254, 2947255, 2947256, 2947257, 2947258, 2947349, 2947350, 2947351, 2947352, 2947353, 2946976, 2946977, 2946978, 2946979, 2946980, 2947354, 2947355, 2947435, 2947356, 2947357, 2947358, 2947359, 2947360, 2947418, 2947421, 2947422, 2947306] into oc-r3-releaselineage-15.0
Change-Id: Iedb83451f9fb6838771971070d0352e71189cdda
-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(); |