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

Commit 16708910 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
parent e26a3835
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -577,11 +577,6 @@ public class MediaPlayerList {
                return;
                return;
            }
            }


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

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


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


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