Remove TouchState::split variable
Instead of storing this state and mutating it in various places, let's
replace the variable with some logic about whether a touch should be
split.
Ideally, we wouldn't even have custom logic for split vs non-split, but
this is a starting point before we can refactor the code further.
The short-term goal is to simplify the findTouchedWindowTargetsLocked
function.
Bug: 211379801
Test: atest inputflinger_tests
Change-Id: I799c2e11a72052a2867710593b18e05011ca44b6
diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h
index c2fe196..3b44a8e 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.h
+++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -541,6 +541,7 @@
// shade is pulled down while we are counting down the timeout).
void resetNoFocusedWindowTimeoutLocked() REQUIRES(mLock);
+ bool shouldSplitTouch(const TouchState& touchState, const MotionEntry& entry) const;
int32_t getTargetDisplayId(const EventEntry& entry);
sp<android::gui::WindowInfoHandle> findFocusedWindowTargetLocked(
nsecs_t currentTime, const EventEntry& entry, nsecs_t* nextWakeupTime,