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

Commit ed231fb8 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-60a1dec6-db7d-4d2a-8ddf-8cf91c3bd1f8-for-git_oc-dr1-release-41...

release-request-60a1dec6-db7d-4d2a-8ddf-8cf91c3bd1f8-for-git_oc-dr1-release-4176699 snap-temp-L56000000081901251

Change-Id: Ibc0ee8a931e5ae5137b345bf6524243651d3d054
parents 68aee76c be8be56f
Loading
Loading
Loading
Loading
+19 −16
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ public final class Avrcp {
            }

            Log.v(TAG, "onQueueChanged: NowPlaying list changed, Queue Size = "+ queue.size());
            mHandler.sendEmptyMessage(MSG_NOW_PLAYING_CHANGED_RSP);
            mHandler.sendEmptyMessageDelayed(MSG_NOW_PLAYING_CHANGED_RSP, MEDIA_DWELL_TIME);
        }
    }

@@ -991,6 +991,8 @@ public final class Avrcp {
            }
            if (mAddrPlayerChangedNT == AvrcpConstants.NOTIFICATION_TYPE_INTERIM
                    && mReportedPlayerID != mCurrAddrPlayerID) {
                registerNotificationRspAvalPlayerChangedNative(
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED);
                registerNotificationRspAddrPlayerChangedNative(
                        AvrcpConstants.NOTIFICATION_TYPE_CHANGED, mCurrAddrPlayerID, sUIDCounter);
                mAddrPlayerChangedNT = AvrcpConstants.NOTIFICATION_TYPE_CHANGED;
@@ -2049,14 +2051,17 @@ public final class Avrcp {
            short[] featureBitMaskValues =
                    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()) {
                int idx = players;
                if (entry.getKey() == mCurrAddrPlayerID) idx = 0;
                MediaPlayerInfo info = entry.getValue();
                playerIds[players] = entry.getKey();
                playerTypes[players] = info.getMajorType();
                playerSubTypes[players] = info.getSubType();
                displayableNameArray[players] = info.getDisplayableName();
                playStatusValues[players] = info.getPlayStatus();
                playerIds[idx] = entry.getKey();
                playerTypes[idx] = info.getMajorType();
                playerSubTypes[idx] = info.getSubType();
                displayableNameArray[idx] = info.getDisplayableName();
                playStatusValues[idx] = info.getPlayStatus();

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

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

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

            if (DEBUG) Log.d(TAG, "prepareMediaPlayerRspObj: numPlayers = " + numPlayers);
@@ -2133,11 +2137,10 @@ public final class Avrcp {
                mMediaController = newController;
                if (mMediaController != null) {
                    mMediaController.registerCallback(mMediaControllerCb, mHandler);
                    mAddressedMediaPlayer.updateNowPlayingList(mMediaController);
                } else {
                    mAddressedMediaPlayer.updateNowPlayingList(null);
                    registerRsp = false;
                }
                mHandler.sendEmptyMessageDelayed(MSG_NOW_PLAYING_CHANGED_RSP, MEDIA_DWELL_TIME);
            }
        }
        scheduleMediaUpdate();