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

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

release-request-33b11ddd-d658-45bf-bdb2-acceb024fe39-for-git_oc-release-404276...

release-request-33b11ddd-d658-45bf-bdb2-acceb024fe39-for-git_oc-release-4042766 snap-temp-L87400000067730042

Change-Id: Ib46ba9820dd9a7a694fac787733ba14ebdcefe43
parents 958fca0e 90dcb467
Loading
Loading
Loading
Loading
+9 −20
Original line number Diff line number Diff line
@@ -946,23 +946,20 @@ public final class Avrcp {

    private void updateCurrentMediaState() {
        MediaAttributes currentAttributes = mMediaAttributes;
        PlaybackState newState = mCurrentPlayState;
        PlaybackState newState = null;
        if (mMediaController == null) {
            // Use A2DP state if we don't have a MediaControlller
            boolean isPlaying =
                    (mA2dpState == BluetoothA2dp.STATE_PLAYING) && mAudioManager.isMusicActive();
            if (isPlaying != isPlayingState(mCurrentPlayState)) {
                /* if a2dp is streaming, check to make sure music is active */
            PlaybackState.Builder builder = new PlaybackState.Builder();
            if (isPlaying) {
                    builder.setState(PlaybackState.STATE_PLAYING,
                            PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f);
                builder.setState(
                        PlaybackState.STATE_PLAYING, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 1.0f);
            } else {
                    builder.setState(PlaybackState.STATE_PAUSED,
                            PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f);
                builder.setState(
                        PlaybackState.STATE_PAUSED, PlaybackState.PLAYBACK_POSITION_UNKNOWN, 0.0f);
            }
            newState = builder.build();
            }
            mMediaAttributes = new MediaAttributes(null);
        } else {
            newState = mMediaController.getPlaybackState();
@@ -1570,14 +1567,6 @@ public final class Avrcp {
                        playersChanged = true;
                    }

                    List<android.media.session.MediaController> currentControllers =
                            getMediaControllers();
                    for (android.media.session.MediaController controller : currentControllers) {
                        if (!newControllers.contains(controller)) {
                            removeMediaController(controller);
                        }
                    }

                    if (playersChanged) {
                        mHandler.sendEmptyMessage(MSG_AVAILABLE_PLAYERS_CHANGED_RSP);
                        if (newControllers.size() > 0 && getAddressedPlayerInfo() == null) {