diff options
| author | 2023-08-14 13:59:40 -0700 | |
|---|---|---|
| committer | 2023-08-23 21:06:47 +0000 | |
| commit | ab3eded031046a0d101288d47c0e579c6b7c476d (patch) | |
| tree | 26ca539843ce0a9340f017fc4e64f7fdec4e8a5d /libs/gui/ConsumerBase.cpp | |
| parent | 65e13d9764957651da59ef6ffaf0f0392745bbca (diff) | |
Override VelocityTracker strategy for non-differential axes only
VelocityTracker may use different strategies, depending on the system
flags. By default, the behaviour is like this:
AXIS_X -> lsq2
AXIS_Y -> lsq2
AXIS_SCROLL -> impulse
However, if we provide a specific strategy to VT, then things would
change. The new map would look like this:
AXIS_X -> provided strategy
AXIS_Y -> provided strategy
AXIS_SCROLL -> provided strategy
This works fine if the user specifies "impulse" as the desired strategy,
because impulse supports all of the axes.
However, lsq2 only works in non-differential mode.
The combination of "AXIS_SCROLL -> lsq2" is not allowed.
To fix this, we only allow the specified strategy to affect
non-differential axes.
This is fine, because currently, impulse is the only strategy that can
work in the differential mode.
To reproduce the issue:
1. Run `atest VelocityTrackerTest`. Test should pass, because the
default strategy is being used.
2. Connect the device to internet
3. Reboot the device
4. Run `atest VelocityTrackerTest` again. Test should fail because the
device would pick up an "lsq2" strategy value and then try to run the
axis_scroll tests with it.
Bug: 295290374
Test: atest VelocityTrackerTest
Change-Id: I702a2a3e58db3ce2e0ff0c33122839a527eebab2
Merged-In: I702a2a3e58db3ce2e0ff0c33122839a527eebab2
(cherry picked from commit 8a2e589e28329fd597dbb0d14f4f8f443fe9a4b0)
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
0 files changed, 0 insertions, 0 deletions