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/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h
index 6df333a..70f3dd1 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.h
+++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -361,6 +361,12 @@
     bool hasResponsiveConnectionLocked(android::gui::WindowInfoHandle& windowHandle) const
             REQUIRES(mLock);
 
+    // Gets all the input targets (with their respective input channels) from the window handles
+    // passed as argument.
+    std::vector<InputTarget> getInputTargetsFromWindowHandlesLocked(
+            const std::vector<sp<android::gui::WindowInfoHandle>>& windowHandles) const
+            REQUIRES(mLock);
+
     /*
      * Validate and update InputWindowHandles for a given display.
      */
@@ -421,6 +427,9 @@
     void dispatchPointerCaptureChangedLocked(
             nsecs_t currentTime, const std::shared_ptr<PointerCaptureChangedEntry>& entry,
             DropReason& dropReason) REQUIRES(mLock);
+    void dispatchTouchModeChangeLocked(nsecs_t currentTime,
+                                       const std::shared_ptr<TouchModeEntry>& entry)
+            REQUIRES(mLock);
     void dispatchEventLocked(nsecs_t currentTime, std::shared_ptr<EventEntry> entry,
                              const std::vector<InputTarget>& inputTargets) REQUIRES(mLock);
     void dispatchSensorLocked(nsecs_t currentTime, const std::shared_ptr<SensorEntry>& entry,