diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-25 03:32:29 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-08-25 03:32:29 +0000 |
commit | 5d9cfe347c6a9f65aa9fc4027d0a51df57651b33 (patch) | |
tree | 37a3f3c88381940e46bcdaec45048b6201de254d | |
parent | 0a90e80cf846ce7fd7972400a56ededa97b12aea (diff) | |
parent | 11a5949ba66c073598b8788b8ff94cbb0531d0a8 (diff) | |
download | android_packages_apps_Bluetooth-staging/lineage-15.0_rebase-android-8.0.0_r23.tar.gz android_packages_apps_Bluetooth-staging/lineage-15.0_rebase-android-8.0.0_r23.tar.bz2 android_packages_apps_Bluetooth-staging/lineage-15.0_rebase-android-8.0.0_r23.zip |
Merge cherrypicks of [2793689, 2793690, 2790745, 2793230, 2792812, 2793231, 2790746, 2790747, 2793232] into oc-dr1-releasestaging/lineage-15.0_rebase-android-8.0.0_r23
Change-Id: Id710db99c21ba79c7219650989562ca9adce2283
-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(); |