Felix HAL: Added IVibrator event logs in dumpsys.

Ported the changes made in legacyHAL to Felix HAL
which involves adding the IVibrator event to the
HwApi to produce a friendly debugging logs.

Bug: 376330571
Flag: EXEMPT log only update
Test: Flash to device and verified dumpsys
Change-Id: I54262b7451b1ab07669eb9b7e5ad3c4cd3477016
Signed-off-by: Zouberou Sayibou <zouberou@google.com>
This commit is contained in:
Zouberou Sayibou 2024-11-05 03:14:22 +00:00
parent eed7c72e34
commit e9101cc010
7 changed files with 63 additions and 8 deletions

View file

@ -29,6 +29,13 @@ namespace android {
namespace hardware {
namespace vibrator {
void HwApiBase::recordEvent(const char *func, const std::string &value) {
std::lock_guard<std::mutex> lock(mRecordsMutex);
mRecords.emplace_back(std::make_unique<Record<std::string>>
(HwApiBase::RecordType::EVENT, func, value, nullptr));
mRecords.pop_front();
}
HwApiBase::HwApiBase() {
mPathPrefix = std::getenv("HWAPI_PATH_PREFIX") ?: "";
if (mPathPrefix.empty()) {