Loading src/com/android/bluetooth/avrcp/Avrcp.java +17 −13 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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++) { Loading @@ -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); Loading Loading
src/com/android/bluetooth/avrcp/Avrcp.java +17 −13 Original line number Original line Diff line number Diff line Loading @@ -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; Loading Loading @@ -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++) { Loading @@ -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); Loading