Merge "audio: Update 'PauseSync' scenario in AudioStreamIoOutTest" into main am: 5e6d99b424 am: f453736f0d

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

Change-Id: I0ae1ee7ce46ab75e5ec46471ef2500bf3cd99133
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mikhail Naganov
2024-04-18 23:57:42 +00:00
committed by Automerger Merge Worker

View File

@@ -1040,7 +1040,9 @@ class StreamWriterLogic : public StreamCommonLogic {
<< ": received invalid byte count in the reply: " << reply.fmqByteCount;
return Status::ABORT;
}
if (getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
// It is OK for the implementation to leave data in the MQ when the stream is paused.
if (reply.state != StreamDescriptor::State::PAUSED &&
getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
LOG(ERROR) << __func__ << ": the HAL module did not consume all data from the data MQ: "
<< "available to write " << getDataMQ()->availableToWrite()
<< ", total size: " << getDataMQ()->getQuantumCount();
@@ -4550,9 +4552,8 @@ std::shared_ptr<StateSequence> makePauseCommands(bool isInput, bool isSync) {
std::make_pair(State::PAUSED, kStartCommand),
std::make_pair(State::ACTIVE, kPauseCommand),
std::make_pair(State::PAUSED, kBurstCommand),
std::make_pair(State::PAUSED, kStartCommand),
std::make_pair(State::ACTIVE, kPauseCommand)},
State::PAUSED);
std::make_pair(State::PAUSED, kFlushCommand)},
State::IDLE);
if (!isSync) {
idle.children().push_back(
d->makeNodes({std::make_pair(State::TRANSFERRING, kPauseCommand),