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

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

Send available players changed with addressed player changed am: cc75e0ce

am: 255c5f81

Change-Id: Ia771490f87651adb4ea623cd25e5b3733b5a81f3
parents 254bceca 255c5f81
Loading
Loading
Loading
Loading
+17 −13
Original line number Original line Diff line number Diff line
@@ -991,6 +991,8 @@ public final class Avrcp {
            }
            }
            if (mAddrPlayerChangedNT == AvrcpConstants.NOTIFICATION_TYPE_INTERIM
            if (mAddrPlayerChangedNT == AvrcpConstants.NOTIFICATION_TYPE_INTERIM
                    && mReportedPlayerID != mCurrAddrPlayerID) {
                    && mReportedPlayerID != mCurrAddrPlayerID) {
                registerNotificationRspAvalPlayerChangedNative(
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED);
                registerNotificationRspAddrPlayerChangedNative(
                registerNotificationRspAddrPlayerChangedNative(
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED, mCurrAddrPlayerID, sUIDCounter);
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED, mCurrAddrPlayerID, sUIDCounter);
                mAddrPlayerChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED;
                mAddrPlayerChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED;
@@ -2049,14 +2051,17 @@ public final class Avrcp {
            short[] featureBitMaskValues =
            short[] featureBitMaskValues =
                    new short[numPlayers * AvrcpConstants.AVRC_FEATURE_MASK_SIZE];
                    new short[numPlayers * AvrcpConstants.AVRC_FEATURE_MASK_SIZE];


            int players = 0;
            // Reserve the first spot for the currently addressed player
            int players = 1;
            for (Map.Entry<Integer, MediaPlayerInfo> entry : mMediaPlayerInfoList.entrySet()) {
            for (Map.Entry<Integer, MediaPlayerInfo> entry : mMediaPlayerInfoList.entrySet()) {
                int idx = players;
                if (entry.getKey() == mCurrAddrPlayerID) idx = 0;
                MediaPlayerInfo info = entry.getValue();
                MediaPlayerInfo info = entry.getValue();
                playerIds[players] = entry.getKey();
                playerIds[idx] = entry.getKey();
                playerTypes[players] = info.getMajorType();
                playerTypes[idx] = info.getMajorType();
                playerSubTypes[players] = info.getSubType();
                playerSubTypes[idx] = info.getSubType();
                displayableNameArray[players] = info.getDisplayableName();
                displayableNameArray[idx] = info.getDisplayableName();
                playStatusValues[players] = info.getPlayStatus();
                playStatusValues[idx] = info.getPlayStatus();


                short[] featureBits = info.getFeatureBitMask();
                short[] featureBits = info.getFeatureBitMask();
                for (int numBit = 0; numBit < featureBits.length; numBit++) {
                for (int numBit = 0; numBit < featureBits.length; numBit++) {
@@ -2064,19 +2069,18 @@ public final class Avrcp {
                    byte octet = (byte) (featureBits[numBit] / 8);
                    byte octet = (byte) (featureBits[numBit] / 8);
                    /* gives the bit position within the octet */
                    /* gives the bit position within the octet */
                    byte bit = (byte) (featureBits[numBit] % 8);
                    byte bit = (byte) (featureBits[numBit] % 8);
                    featureBitMaskValues[(players * AvrcpConstants.AVRC_FEATURE_MASK_SIZE)
                    featureBitMaskValues[(idx * AvrcpConstants.AVRC_FEATURE_MASK_SIZE) + octet] |=
                            + octet] |= (1 << bit);
                            (1 << bit);
                }
                }


                /* printLogs */
                /* printLogs */
                if (DEBUG) {
                if (DEBUG) {
                    Log.d(TAG, "Player " + playerIds[players] + ": " + displayableNameArray[players]
                    Log.d(TAG, "Player " + playerIds[idx] + ": " + displayableNameArray[idx]
                                    + " type: " + playerTypes[players] + ", "
                                    + " type: " + playerTypes[idx] + ", " + playerSubTypes[idx]
                                    + playerSubTypes[players] + " status: "
                                    + " status: " + playStatusValues[idx]);
                                    + playStatusValues[players]);
                }
                }


                players++;
                if (idx != 0) players++;
            }
            }


            if (DEBUG) Log.d(TAG, "prepareMediaPlayerRspObj: numPlayers = " + numPlayers);
            if (DEBUG) Log.d(TAG, "prepareMediaPlayerRspObj: numPlayers = " + numPlayers);