Switch to ImpulseVelocityTracker fling strategy.
The current default VelocityTrackerStrategy is lsq2,
which is using second-order least squares fits to
calculate the fling velocity. However, that strategy
has a few shortcomings, which should be fixed by the
impulse strategy.
Bug: 64680775
Bug: 35412046
Test: /data/nativetest/libinput_tests/VelocityTracker_test
(test will be fixed after this CL ends by re-recording some of the
flings that fail due to the implementation change of the
impulse strategy)
Change-Id: Ib4d70bc3c88892f01d29bc1cb8f5802ace938d45
diff --git a/libs/input/VelocityTracker.cpp b/libs/input/VelocityTracker.cpp
index e54f147..57eee12 100644
--- a/libs/input/VelocityTracker.cpp
+++ b/libs/input/VelocityTracker.cpp
@@ -107,7 +107,7 @@
// this is the strategy that applications will actually use. Be very careful
// when adjusting the default strategy because it can dramatically affect
// (often in a bad way) the user experience.
-const char* VelocityTracker::DEFAULT_STRATEGY = "lsq2";
+const char* VelocityTracker::DEFAULT_STRATEGY = "impulse";
VelocityTracker::VelocityTracker(const char* strategy) :
mLastEventTime(0), mCurrentPointerIdBits(0), mActivePointerId(-1) {