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
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(
return err;
}
- if (mState == PAUSED_TO_PLAYING) {
+ if (mState == PAUSED_TO_PLAYING || mPlaybackSessionEstablished) {
mState = PLAYING;
return OK;
}
ALOGI("Received PAUSE request.");
- if (mState != PLAYING_TO_PAUSED) {
+ if (mState != PLAYING_TO_PAUSED && mState != PLAYING) {
return INVALID_OPERATION;
}