audio: Add support for dumping info from effect HAL modules
The implementation uses IBase::debug() method which can write
debugging info into the provided file descriptor (same model
as used for devices and streams).
Bug: 69939533
Test: adb shell dumpsys media.audio_flinger
Change-Id: I7876fd43a7066c0f081ea2ca0b3b4b37bbdf8e6c
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index 84608b6..3c0d878 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -710,6 +710,14 @@
return Result::OK;
}
+Return<void> Effect::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /* options */) {
+ if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
+ uint32_t cmdData = fd->data[0];
+ (void)sendCommand(EFFECT_CMD_DUMP, "DUMP", sizeof(cmdData), &cmdData);
+ }
+ return Void();
+}
+
} // namespace implementation
} // namespace CPP_VERSION
} // namespace effect