Return InputTargets instead of TouchedWindows

Before this CL, TouchedWindows were getting returned from
findTouchedWindowTargetsLocked, just to be converted immediately to
InputTargets.

However, TouchedWindows are actually an implementation detail of
TouchState, and should not leak out from there.

In this CL, the first step is taken to fix this abstraction by returning
InputTargets where TouchedWindows are getting returned.

This will allow:
1. Removal of goto from dispatcher
2. Diff-based approach for generating InputTargets from old and new
   touch state

These updates will be attempted in follow-up CLs.

Bug: 211379801
Test: m inputflinger_tests && adb sync data && adb shell -t /data/nativetest64/inputflinger_tests/inputflinger_tests
Change-Id: I8b93719994ed383ad0f9bb848d84805470d95db9
diff --git a/services/inputflinger/dispatcher/TouchState.h b/services/inputflinger/dispatcher/TouchState.h
index b75e6ef..4025db8 100644
--- a/services/inputflinger/dispatcher/TouchState.h
+++ b/services/inputflinger/dispatcher/TouchState.h
@@ -43,6 +43,8 @@
     void clearWindowsWithoutPointers();
 
     void removeTouchedPointer(int32_t pointerId);
+    void removeTouchedPointerFromWindow(int32_t pointerId,
+                                        const sp<android::gui::WindowInfoHandle>& windowHandle);
     void addOrUpdateWindow(const sp<android::gui::WindowInfoHandle>& windowHandle,
                            ftl::Flags<InputTarget::Flags> targetFlags, BitSet32 pointerIds,
                            std::optional<nsecs_t> eventTime = std::nullopt);
@@ -62,6 +64,8 @@
     sp<android::gui::WindowInfoHandle> getFirstForegroundWindowHandle() const;
     bool isSlippery() const;
     sp<android::gui::WindowInfoHandle> getWallpaperWindow() const;
+    const TouchedWindow& getTouchedWindow(
+            const sp<android::gui::WindowInfoHandle>& windowHandle) const;
     // Whether any of the windows are currently being touched
     bool isDown() const;