TouchEvent (3/n) Enhancing InputDispatcher to support TouchModeEvent
This CL provides the infrastructure to dispatch TouchModeEvent via
InputDispatcher. Remaining logic like permission check, Java integration, etc will be added in next incoming CLs.
Note:
InputDispatcher::requestTouchModeChange instantiate and enqueue TouchModeEvent.
InputDispatcher::dispatchTouchModeChangeLocked notifies all windows
about the touch mode update.
Test: atest inputflinger_tests
Bug: 193718270
Change-Id: I3cfeec0e9bc33737f15d6822242f7eb5e381a119
diff --git a/services/inputflinger/dispatcher/Entry.h b/services/inputflinger/dispatcher/Entry.h
index 8feb982..e27338e 100644
--- a/services/inputflinger/dispatcher/Entry.h
+++ b/services/inputflinger/dispatcher/Entry.h
@@ -39,6 +39,7 @@
SENSOR,
POINTER_CAPTURE_CHANGED,
DRAG,
+ TOUCH_MODE_CHANGED,
};
int32_t id;
@@ -185,7 +186,7 @@
float xOffset, float yOffset);
std::string getDescription() const override;
- virtual ~MotionEntry();
+ ~MotionEntry() override;
};
struct SensorEntry : EventEntry {
@@ -207,6 +208,15 @@
~SensorEntry() override;
};
+struct TouchModeEntry : EventEntry {
+ bool inTouchMode;
+
+ TouchModeEntry(int32_t id, nsecs_t eventTime, bool inTouchMode);
+ std::string getDescription() const override;
+
+ ~TouchModeEntry() override;
+};
+
// Tracks the progress of dispatching a particular event to a particular connection.
struct DispatchEntry {
const uint32_t seq; // unique sequence number, never 0