From b8b980862def5dabda94f79b194b2020ae3316ab Mon Sep 17 00:00:00 2001 From: Zouberou Sayibou Date: Wed, 18 Dec 2024 21:51:53 +0000 Subject: [PATCH] Felix HAL: Added RECORD_COMPOSE macro for composite effects. Added the composite vector effects to HAL dumpsys instead of the size. Bug: 376330571 Flag: EXEMPT log only update Test: Flash to device and verified dumpsys Test: atest VibratorHalCs40l26TestSuitePrivate Change-Id: I59efffdbe78bc865ca60a30d8c6a9bdc855def6b Signed-off-by: Zouberou Sayibou --- vibrator/cs40l26/Vibrator.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/vibrator/cs40l26/Vibrator.cpp b/vibrator/cs40l26/Vibrator.cpp index 787700d..cabaf71 100644 --- a/vibrator/cs40l26/Vibrator.cpp +++ b/vibrator/cs40l26/Vibrator.cpp @@ -53,6 +53,16 @@ namespace vibrator { } \ } +#define RECORD_COMPOSE(...) \ + std::string effectString = ""; \ + for (auto &effect : composite) { \ + effectString += effect.toString() + ", "; \ + } \ + this->mHwApiDef->recordEvent(__func__, effectString.c_str()); \ + if (this->mIsDual) { \ + this->mHwApiDual->recordEvent(__func__, effectString.c_str()); \ + } \ + static constexpr uint16_t FF_CUSTOM_DATA_LEN_MAX_COMP = 2044; // (COMPOSE_SIZE_MAX + 1) * 8 + 4 static constexpr uint16_t FF_CUSTOM_DATA_LEN_MAX_PWLE = 2302; @@ -977,7 +987,7 @@ ndk::ScopedAStatus Vibrator::compose(const std::vector &composi const std::shared_ptr &callback) { ATRACE_NAME("Vibrator::compose"); ALOGD("Vibrator::compose"); - RECORD("composite.size = %zu", composite.size()); + RECORD_COMPOSE(composite); uint16_t size; uint16_t nextEffectDelay;