audio: effect: dispatch command when using device effect proxy
Bug: 268441977
Test: make
Change-Id: I571756ad549e8455226979b32177e22f4d5c66fc
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index bee9804..4e3f474 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -3472,6 +3472,23 @@
return mManagerCallback->removeEffectFromHal(&mDevicePort, effect);
}
+status_t DeviceEffectProxy::command(
+ int32_t cmdCode, const std::vector<uint8_t>& cmdData, int32_t maxReplySize,
+ std::vector<uint8_t>* reply) {
+ Mutex::Autolock _l(mProxyLock);
+ status_t status = EffectBase::command(cmdCode, cmdData, maxReplySize, reply);
+ if (status == NO_ERROR) {
+ for (auto& handle : mEffectHandles) {
+ sp<IAfEffectBase> effect = handle.second->effect().promote();
+ if (effect != nullptr) {
+ status = effect->command(cmdCode, cmdData, maxReplySize, reply);
+ }
+ }
+ }
+ ALOGV("%s status %d", __func__, status);
+ return status;
+}
+
bool DeviceEffectProxy::isOutput() const {
if (mDevicePort.id != AUDIO_PORT_HANDLE_NONE) {
return mDevicePort.role == AUDIO_PORT_ROLE_SINK;