Spatializer: Increase freshness timeout to 120 ms.
Update the freshness timeout to 120 ms (2*connection interval + 20) to avoid frequently HT mode downgrade.
Bug: 239146742
Test: Manual verification with Pixel.
Merged-In: I8502e22b501f798e50bddd347356d2dbd400d792
Change-Id: I8502e22b501f798e50bddd347356d2dbd400d792
diff --git a/services/audiopolicy/service/SpatializerPoseController.cpp b/services/audiopolicy/service/SpatializerPoseController.cpp
index e012a0b..e7f4750 100644
--- a/services/audiopolicy/service/SpatializerPoseController.cpp
+++ b/services/audiopolicy/service/SpatializerPoseController.cpp
@@ -52,7 +52,9 @@
constexpr auto kPredictionDuration = 50ms;
// After not getting a pose sample for this long, we would treat the measurement as stale.
-constexpr auto kFreshnessTimeout = 50ms;
+// The max connection interval is 50ms, and HT sensor event interval can differ depending on the
+// sampling rate, scheduling, sensor eventQ FIFO etc. 120 (2 * 50 + 20) ms seems reasonable for now.
+constexpr auto kFreshnessTimeout = 120ms;
// Auto-recenter kicks in after the head has been still for this long.
constexpr auto kAutoRecenterWindowDuration = 6s;