summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2024-04-29 11:39:38 -0700
committerMikhail Naganov <mnaganov@google.com>2024-04-29 11:39:38 -0700
commitfc1df623a9abe4fc8ce7a7b0540cc4c79423ed61 (patch)
tree53c884e048260e206e7bab18196cc45c9a1d9029
parent16bf9fca6716ef0f9c2b6ebfd39c30a3f6401d7d (diff)
downloadav-fc1df623a9abe4fc8ce7a7b0540cc4c79423ed61.tar.gz
libaudiohal@aidl: Handle stream resume uniformly (2)
The previous patch b27cb9babb7f0a5b8d579ca92e59e56f2e11dcd7 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
-rw-r--r--media/libaudiohal/impl/StreamHalAidl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/media/libaudiohal/impl/StreamHalAidl.cpp b/media/libaudiohal/impl/StreamHalAidl.cpp
index 97c9659a36..70e7949491 100644
--- a/media/libaudiohal/impl/StreamHalAidl.cpp
+++ b/media/libaudiohal/impl/StreamHalAidl.cpp
@@ -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;
}