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

Commit facc94ef authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Automerger Merge Worker
Browse files

Merge "libaudiohal@aidl: Handle stream resume uniformly" into main am: d9ae2399 am: 93c16a35

parents dd09ef07 93c16a35
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -370,11 +370,9 @@ status_t StreamHalAidl::resume(StreamDescriptor::Reply* reply) {
    if (mIsInput) {
        return sendCommand(makeHalCommand<HalCommand::Tag::burst>(0), reply);
    } else {
        if (mContext.isAsynchronous()) {
        if (const auto state = getState(); state == StreamDescriptor::State::IDLE) {
            // Handle pause-flush-resume sequence. 'flush' from PAUSED goes to
            // IDLE. We move here from IDLE to ACTIVE (same as 'start' from PAUSED).
            const auto state = getState();
            if (state == StreamDescriptor::State::IDLE) {
            StreamDescriptor::Reply localReply{};
            StreamDescriptor::Reply* innerReply = reply ?: &localReply;
            RETURN_STATUS_IF_ERROR(
@@ -385,9 +383,13 @@ status_t StreamHalAidl::resume(StreamDescriptor::Reply* reply) {
                return INVALID_OPERATION;
            }
            return OK;
            }
        }
        } else if (state == StreamDescriptor::State::PAUSED) {
            return sendCommand(makeHalCommand<HalCommand::Tag::start>(), reply);
        } else {
            ALOGE("%s: unexpected stream state: %s (expected IDLE or PAUSED)",
                        __func__, toString(state).c_str());
            return INVALID_OPERATION;
        }
    }
}