Implement Stylus Prediction Metrics
Fills out the implementation and tests for MotionPredictorMetricsManager.
(Cherry pick of ag/23861881 from udc-qpr-dev)
Test: atest frameworks/native/libs/input/tests/MotionPredictorMetricsManager_test.cpp
Test: Manual testing on-device, computed metric values seem reasonable.
Bug: 268245099
Change-Id: Iec18415de9c3070f2b285c5c82f5a5e0ceaaf471
diff --git a/libs/input/MotionPredictor.cpp b/libs/input/MotionPredictor.cpp
index 0961a9d..b5a5e72 100644
--- a/libs/input/MotionPredictor.cpp
+++ b/libs/input/MotionPredictor.cpp
@@ -137,10 +137,7 @@
// Pass input event to the MetricsManager.
if (!mMetricsManager) {
- mMetricsManager =
- std::make_optional<MotionPredictorMetricsManager>(mModel->config()
- .predictionInterval,
- mModel->outputLength());
+ mMetricsManager.emplace(mModel->config().predictionInterval, mModel->outputLength());
}
mMetricsManager->onRecord(event);