Consider the screen still until proven otherwise
In order to avoid always forcing static mode after initialization or
recentering, consider the screen still by default.
This required adding a defaultValue option to the detector, to be used
during the initialization period.
Test: atest --host libheadtracking-test
Change-Id: I7f5a39a0fbca898c55f637e311ec1ea44a10d9f3
diff --git a/media/libheadtracking/HeadTrackingProcessor.cpp b/media/libheadtracking/HeadTrackingProcessor.cpp
index 257ee42..b2d2dbd 100644
--- a/media/libheadtracking/HeadTrackingProcessor.cpp
+++ b/media/libheadtracking/HeadTrackingProcessor.cpp
@@ -42,11 +42,13 @@
.rotationalDriftTimeConstant = options.rotationalDriftTimeConstant,
}),
mHeadStillnessDetector(StillnessDetector::Options{
+ .defaultValue = false,
.windowDuration = options.autoRecenterWindowDuration,
.translationalThreshold = options.autoRecenterTranslationalThreshold,
.rotationalThreshold = options.autoRecenterRotationalThreshold,
}),
mScreenStillnessDetector(StillnessDetector::Options{
+ .defaultValue = true,
.windowDuration = options.screenStillnessWindowDuration,
.translationalThreshold = options.screenStillnessTranslationalThreshold,
.rotationalThreshold = options.screenStillnessRotationalThreshold,