OSDN Git Service

Fix resampling logic for duplicate events.
authorSiarhei Vishniakou <svv@google.com>
Mon, 12 Jun 2017 14:01:41 +0000 (15:01 +0100)
committerSiarhei Vishniakou <svv@google.com>
Fri, 4 Aug 2017 22:23:39 +0000 (15:23 -0700)
commit0aeec07971d86c635412c672bd69d91f589a0cd9
tree5db0f86bf2810168f328ac337e3e18a03b0c3bbb
parent00a4ea970bab16ef5675e866cd856a0d9919f0c5
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
include/input/InputTransport.h
libs/input/InputTransport.cpp