Spatializer: Log latency requests to/from output sink
Test: verify latency commands sent
Bug: 259477444
Change-Id: Iaa45dab95add534fc668d6b8c45492f82fa9bfc6
diff --git a/services/audiopolicy/service/Spatializer.h b/services/audiopolicy/service/Spatializer.h
index bcbd92b..7415b1e 100644
--- a/services/audiopolicy/service/Spatializer.h
+++ b/services/audiopolicy/service/Spatializer.h
@@ -165,14 +165,10 @@
std::string toString(unsigned level) const NO_THREAD_SAFETY_ANALYSIS;
static std::string toString(audio_latency_mode_t mode) {
- switch (mode) {
- case AUDIO_LATENCY_MODE_FREE:
- return "LATENCY_MODE_FREE";
- case AUDIO_LATENCY_MODE_LOW:
- return "LATENCY_MODE_LOW";
- }
- return "EnumNotImplemented";
- };
+ // We convert to the AIDL type to print (eventually the legacy type will be removed).
+ const auto result = legacy2aidl_audio_latency_mode_t_LatencyMode(mode);
+ return result.has_value() ? media::toString(*result) : "unknown_latency_mode";
+ }
/**
* Format head to stage vector to a string, [0.00, 0.00, 0.00, -1.29, -0.50, 15.27].