Loading audio/aidl/default/Stream.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -183,17 +183,19 @@ StreamInWorkerLogic::Status StreamInWorkerLogic::cycle() { switch (command.getTag()) { switch (command.getTag()) { case Tag::halReservedExit: { case Tag::halReservedExit: { const int32_t cookie = command.get<Tag::halReservedExit>(); const int32_t cookie = command.get<Tag::halReservedExit>(); StreamInWorkerLogic::Status status = Status::CONTINUE; if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { mDriver->shutdown(); mDriver->shutdown(); setClosed(); setClosed(); status = Status::EXIT; } else { } else { LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; } } if (cookie != 0) { // This is an internal command, no need to reply. if (cookie != 0) { // This is an internal command, no need to reply. return Status::EXIT; return status; } else { break; } } // `cookie == 0` can only occur in the context of a VTS test, need to reply. break; } } case Tag::getStatus: case Tag::getStatus: populateReply(&reply, mIsConnected); populateReply(&reply, mIsConnected); Loading Loading @@ -411,17 +413,19 @@ StreamOutWorkerLogic::Status StreamOutWorkerLogic::cycle() { switch (command.getTag()) { switch (command.getTag()) { case Tag::halReservedExit: { case Tag::halReservedExit: { const int32_t cookie = command.get<Tag::halReservedExit>(); const int32_t cookie = command.get<Tag::halReservedExit>(); StreamOutWorkerLogic::Status status = Status::CONTINUE; if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { mDriver->shutdown(); mDriver->shutdown(); setClosed(); setClosed(); status = Status::EXIT; } else { } else { LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; } } if (cookie != 0) { // This is an internal command, no need to reply. if (cookie != 0) { // This is an internal command, no need to reply. return Status::EXIT; return status; } else { break; } } // `cookie == 0` can only occur in the context of a VTS test, need to reply. break; } } case Tag::getStatus: case Tag::getStatus: populateReply(&reply, mIsConnected); populateReply(&reply, mIsConnected); Loading Loading
audio/aidl/default/Stream.cpp +10 −6 Original line number Original line Diff line number Diff line Loading @@ -183,17 +183,19 @@ StreamInWorkerLogic::Status StreamInWorkerLogic::cycle() { switch (command.getTag()) { switch (command.getTag()) { case Tag::halReservedExit: { case Tag::halReservedExit: { const int32_t cookie = command.get<Tag::halReservedExit>(); const int32_t cookie = command.get<Tag::halReservedExit>(); StreamInWorkerLogic::Status status = Status::CONTINUE; if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { mDriver->shutdown(); mDriver->shutdown(); setClosed(); setClosed(); status = Status::EXIT; } else { } else { LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; } } if (cookie != 0) { // This is an internal command, no need to reply. if (cookie != 0) { // This is an internal command, no need to reply. return Status::EXIT; return status; } else { break; } } // `cookie == 0` can only occur in the context of a VTS test, need to reply. break; } } case Tag::getStatus: case Tag::getStatus: populateReply(&reply, mIsConnected); populateReply(&reply, mIsConnected); Loading Loading @@ -411,17 +413,19 @@ StreamOutWorkerLogic::Status StreamOutWorkerLogic::cycle() { switch (command.getTag()) { switch (command.getTag()) { case Tag::halReservedExit: { case Tag::halReservedExit: { const int32_t cookie = command.get<Tag::halReservedExit>(); const int32_t cookie = command.get<Tag::halReservedExit>(); StreamOutWorkerLogic::Status status = Status::CONTINUE; if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { if (cookie == (mContext->getInternalCommandCookie() ^ getTid())) { mDriver->shutdown(); mDriver->shutdown(); setClosed(); setClosed(); status = Status::EXIT; } else { } else { LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; LOG(WARNING) << __func__ << ": EXIT command has a bad cookie: " << cookie; } } if (cookie != 0) { // This is an internal command, no need to reply. if (cookie != 0) { // This is an internal command, no need to reply. return Status::EXIT; return status; } else { break; } } // `cookie == 0` can only occur in the context of a VTS test, need to reply. break; } } case Tag::getStatus: case Tag::getStatus: populateReply(&reply, mIsConnected); populateReply(&reply, mIsConnected); Loading