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

Commit b83d2293 authored by Ajay Panicker's avatar Ajay Panicker
Browse files

Treat the buffering state as playing

If the player bounces between buffering and playing there could be an
issue where the carkit retrieves the playback state and it is sent as
stopped even if AVRCP thinks its playing internally.

Bug: 79528664
Test: See in snooplogs that when playing music from the cloud, the
buffering state is sent as playing.

Change-Id: I7afb16af75b4f7f4f301b8f802a0084db25ff00b
(cherry picked from commit 16708910)
parent 201ac16f
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -573,11 +573,6 @@ public class MediaPlayerList {
                return;
            }

            if (data.state.getState() == PlaybackState.STATE_BUFFERING) {
                Log.d(TAG, "mediaUpdatedCallback(): Currently buffering, deferring update");
                return;
            }

            sendMediaUpdate(data);
        }
    };
+1 −1
Original line number Diff line number Diff line
@@ -48,12 +48,12 @@ class PlayStatus {

    static byte playbackStateToAvrcpState(int playbackState) {
        switch (playbackState) {
            case PlaybackState.STATE_BUFFERING:
            case PlaybackState.STATE_STOPPED:
            case PlaybackState.STATE_NONE:
            case PlaybackState.STATE_CONNECTING:
                return PlayStatus.STOPPED;

            case PlaybackState.STATE_BUFFERING:
            case PlaybackState.STATE_PLAYING:
                return PlayStatus.PLAYING;