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

Commit dd57e23c authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "audio: Fix after aosp/2908743 (exit command handling)" into main am:...

Merge "audio: Fix after aosp/2908743 (exit command handling)" into main am: b5d5a9fa am: bdd34065

Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3084709



Change-Id: I6c7c6831038faa643374db2b8b8cf328a48c81db
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 15dd1a9e bdd34065
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -183,17 +183,19 @@ StreamInWorkerLogic::Status StreamInWorkerLogic::cycle() {
    switch (command.getTag()) {
        case Tag::halReservedExit: {
            const int32_t cookie = command.get<Tag::halReservedExit>();
            StreamInWorkerLogic::Status status = Status::CONTINUE;
            if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) {
                mDriver->shutdown();
                setClosed();
                status = Status::EXIT;
            } else {
                LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie;
            }
            if (cookie != 0) {  // This is an internal command, no need to reply.
                return Status::EXIT;
            } else {
                break;
                return status;
            }
            // `cookie == 0` can only occur in the context of a VTS test, need to reply.
            break;
        }
        case Tag::getStatus:
            populateReply(&reply, mIsConnected);
@@ -411,17 +413,19 @@ StreamOutWorkerLogic::Status StreamOutWorkerLogic::cycle() {
    switch (command.getTag()) {
        case Tag::halReservedExit: {
            const int32_t cookie = command.get<Tag::halReservedExit>();
            StreamOutWorkerLogic::Status status = Status::CONTINUE;
            if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) {
                mDriver->shutdown();
                setClosed();
                status = Status::EXIT;
            } else {
                LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie;
            }
            if (cookie != 0) {  // This is an internal command, no need to reply.
                return Status::EXIT;
            } else {
                break;
                return status;
            }
            // `cookie == 0` can only occur in the context of a VTS test, need to reply.
            break;
        }
        case Tag::getStatus:
            populateReply(&reply, mIsConnected);