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

Commit bd25dacc authored by Chong Zhang's avatar Chong Zhang
Browse files

wifi-display: fixes for PAUSE/PLAY state

PAUSE could be initiated by either source (via trigger method)
or sink, in latter case we have to allow PAUSE from PLAYING state.
Similarly PLAY should be allowed from PAUSED state.

Bug: 8922515

Change-Id: I475534aa4ffa6dc6844f59c5868d8f88291019ae
parent 20cb300b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1369,7 +1369,9 @@ status_t WifiDisplaySource::onPlayRequest(
        return ERROR_MALFORMED;
    }

    if (mState != AWAITING_CLIENT_PLAY) {
    if (mState != AWAITING_CLIENT_PLAY
     && mState != PAUSED_TO_PLAYING
     && mState != PAUSED) {
        ALOGW("Received PLAY request but we're in state %d", mState);

        sendErrorResponse(
@@ -1396,7 +1398,7 @@ status_t WifiDisplaySource::onPlayRequest(
        return err;
    }

    if (mState == PAUSED_TO_PLAYING) {
    if (mState == PAUSED_TO_PLAYING || mPlaybackSessionEstablished) {
        mState = PLAYING;
        return OK;
    }
@@ -1430,7 +1432,7 @@ status_t WifiDisplaySource::onPauseRequest(

    ALOGI("Received PAUSE request.");

    if (mState != PLAYING_TO_PAUSED) {
    if (mState != PLAYING_TO_PAUSED && mState != PLAYING) {
        return INVALID_OPERATION;
    }