Fix resampling logic for duplicate events.

When events with identical coordinates are
reported by the input driver, resampling can lead to
false change of direction due to extrapolation.
The added logic will compare the current event to the
previous event, and will use the previously resampled values
for the new event if the raw (as reported by the driver)
coordinates of the two events match.
This commit makes events with identical coordinates possible,
so it must be submitted together with the new impulse-based
VelocityTracker strategy commit. The currently used 2nd degree
polynomical unweighted least squares strategy cannot handle
consecutive events with identical coordinates.

Bug: 35412046
Test: Recorded bad scroll event on swordfish, and replayed
the event to reproduce this bug. To twitch is no longer observed.
Also tested common usecase scenarios on sailfish, no regressions observed.

Change-Id: Icb5cf6c76959f3514b8b94c09e38cc5434f31b23
(cherry picked from commit 0aeec07971d86c635412c672bd69d91f589a0cd9)
Merged-In: Icb5cf6c76959f3514b8b94c09e38cc5434f31b23
2 files changed