audio: Improve logging in remote submix module
Implement IModule::dump to display the current state in
the audioflinger dump.
Throttle repetitive logging when there is nothing to read.
Remove stale comment for already fixed b/307586684.
Bug: 307586684
Test: adb shell dumpsys media.audio_flinger
Change-Id: I1f1f6e1658d035d46af3a933a825b20a78c7f297
diff --git a/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp b/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
index 7bc783c..b44f37b 100644
--- a/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/ModuleRemoteSubmix.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "AHAL_ModuleRemoteSubmix"
+#include <stdio.h>
#include <vector>
#include <android-base/logging.h>
@@ -174,4 +175,9 @@
return kMinLatencyMs;
}
+binder_status_t ModuleRemoteSubmix::dump(int fd, const char** /*args*/, uint32_t /*numArgs*/) {
+ dprintf(fd, "\nSubmixRoutes:\n%s\n", r_submix::SubmixRoute::dumpRoutes().c_str());
+ return STATUS_OK;
+}
+
} // namespace aidl::android::hardware::audio::core