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
This commit is contained in:
Mikhail Naganov
2019-02-22 14:28:26 -08:00
parent fa4333b8e5
commit fa02144f8d
24 changed files with 70 additions and 0 deletions

View File

@@ -710,6 +710,14 @@ Return<Result> Effect::close() {
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