TouchpadInputMapper: add timer provider
Adding a timer provider allows the Gestures library to perform some
asynchronous tasks, including ones which improve tap-to-click detection.
Bug: 297192727
Test: set the
persist.device_config.aconfig_flags.input.com.android.input.flags.enable_gestures_library_timer_provider
sysprop to true, restart, then make fast tap-to-click gestures
(where the finger is contacting for fewer than 3 frames) on the
touchpad, and check they're reported immediately
Change-Id: Ib9b8dacc71c88b6fd47bdd747f90ef6a44b37cc4
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.h b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
index 47d712e..a68ae43 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
@@ -34,6 +34,7 @@
#include "gestures/GestureConverter.h"
#include "gestures/HardwareStateConverter.h"
#include "gestures/PropertyProvider.h"
+#include "gestures/TimerProvider.h"
#include "include/gestures.h"
@@ -56,6 +57,7 @@
ConfigurationChanges changes) override;
[[nodiscard]] std::list<NotifyArgs> reset(nsecs_t when) override;
[[nodiscard]] std::list<NotifyArgs> process(const RawEvent* rawEvent) override;
+ [[nodiscard]] std::list<NotifyArgs> timeoutExpired(nsecs_t when) override;
void consumeGesture(const Gesture* gesture);
@@ -80,6 +82,7 @@
std::shared_ptr<PointerControllerInterface> mPointerController;
PropertyProvider mPropertyProvider;
+ TimerProvider mTimerProvider;
// The MultiTouchMotionAccumulator is shared between the HardwareStateConverter and
// CapturedTouchpadEventConverter, so that if the touchpad is captured or released while touches
@@ -92,7 +95,6 @@
CapturedTouchpadEventConverter mCapturedEventConverter;
bool mPointerCaptured = false;
- bool mProcessing = false;
bool mResettingInterpreter = false;
std::vector<Gesture> mGesturesToProcess;