Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7204d2dd authored by Ajay Panicker's avatar Ajay Panicker Committed by android-build-merger
Browse files

Prevent stack crash if there is only one player and it isn't active

am: c28dd0a6

Change-Id: I5158b1d3e684b776e058a4fa9de000088cdb3c2c
parents ecc3edf6 c28dd0a6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2045,7 +2045,8 @@ public final class Avrcp {
            int players = 1;
            for (Map.Entry<Integer, MediaPlayerInfo> entry : mMediaPlayerInfoList.entrySet()) {
                int idx = players;
                if (entry.getKey() == mCurrAddrPlayerID) idx = 0;
                if (entry.getKey() == mCurrAddrPlayerID || mMediaPlayerInfoList.size() == 1)
                    idx = 0;
                MediaPlayerInfo info = entry.getValue();
                playerIds[idx] = entry.getKey();
                playerTypes[idx] = info.getMajorType();