Merge "Add replySize for EFFECT_CMD_RESET to align with other commands" into main am: c5441018e5 am: da2fbfa9de am: ba3942a7e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2758285
Change-Id: I6d3b17f812061646e9155535f6ba990e70391463
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/media/libaudiohal/impl/EffectConversionHelperAidl.cpp b/media/libaudiohal/impl/EffectConversionHelperAidl.cpp
index ae73262..196b432 100644
--- a/media/libaudiohal/impl/EffectConversionHelperAidl.cpp
+++ b/media/libaudiohal/impl/EffectConversionHelperAidl.cpp
@@ -255,37 +255,37 @@
status_t EffectConversionHelperAidl::handleReset(uint32_t cmdSize __unused,
const void* pCmdData __unused, uint32_t* replySize,
void* pReplyData) {
- if (!replySize || !pReplyData) {
+ if (!replySize || *replySize != sizeof(int) || !pReplyData) {
ALOGE("%s parameter invalid, replySize %s pReplyData %p", __func__,
numericPointerToString(replySize).c_str(), pReplyData);
return BAD_VALUE;
}
- return statusTFromBinderStatus(mEffect->command(CommandId::RESET));
+ return *(int *)pReplyData = statusTFromBinderStatus(mEffect->command(CommandId::RESET));
}
status_t EffectConversionHelperAidl::handleEnable(uint32_t cmdSize __unused,
const void* pCmdData __unused,
uint32_t* replySize, void* pReplyData) {
- if (!replySize || !pReplyData) {
+ if (!replySize || *replySize != sizeof(int) || !pReplyData) {
ALOGE("%s parameter invalid, replySize %s pReplyData %p", __func__,
numericPointerToString(replySize).c_str(), pReplyData);
return BAD_VALUE;
}
- return statusTFromBinderStatus(mEffect->command(CommandId::START));
+ return *(int *)pReplyData = statusTFromBinderStatus(mEffect->command(CommandId::START));
}
status_t EffectConversionHelperAidl::handleDisable(uint32_t cmdSize __unused,
const void* pCmdData __unused,
uint32_t* replySize, void* pReplyData) {
- if (!replySize || !pReplyData) {
+ if (!replySize || *replySize != sizeof(int) || !pReplyData) {
ALOGE("%s parameter invalid, replySize %s pReplyData %p", __func__,
numericPointerToString(replySize).c_str(), pReplyData);
return BAD_VALUE;
}
- return statusTFromBinderStatus(mEffect->command(CommandId::STOP));
+ return *(int *)pReplyData = statusTFromBinderStatus(mEffect->command(CommandId::STOP));
}
status_t EffectConversionHelperAidl::handleSetAudioSource(uint32_t cmdSize, const void* pCmdData,
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index fe13e26..223fc29 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -829,7 +829,10 @@
if (mStatus != NO_ERROR || mEffectInterface == 0) {
return;
}
- mEffectInterface->command(EFFECT_CMD_RESET, 0, NULL, 0, NULL);
+
+ int reply = 0;
+ uint32_t replySize = sizeof(reply);
+ mEffectInterface->command(EFFECT_CMD_RESET, 0, NULL, &replySize, &reply);
}
status_t EffectModule::configure()