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

Commit fc1df623 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudiohal@aidl: Handle stream resume uniformly (2)

The previous patch b27cb9ba
did not allow resuming from `TRANSFER_PAUSED` and
`DRAIN_PAUSED` states that actuall allow receiving
of the `start` command.

Bug: 336948057
Test: repro steps in the bug
Change-Id: I79c6ac436242b1e829e214468f592e4b3328f70d
parent 16bf9fca
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -379,10 +379,12 @@ status_t StreamHalAidl::resume(StreamDescriptor::Reply* reply) {
                return INVALID_OPERATION;
            }
            return OK;
        } else if (state == StreamDescriptor::State::PAUSED) {
        } else if (state == StreamDescriptor::State::PAUSED ||
                   state == StreamDescriptor::State::TRANSFER_PAUSED ||
                   state == StreamDescriptor::State::DRAIN_PAUSED) {
            return sendCommand(makeHalCommand<HalCommand::Tag::start>(), reply);
        } else {
            ALOGE("%s: unexpected stream state: %s (expected IDLE or PAUSED)",
            ALOGE("%s: unexpected stream state: %s (expected IDLE or one of *PAUSED states)",
                        __func__, toString(state).c_str());
            return INVALID_OPERATION;
        }