Cancel ongoing touchpad move gesture if user starts typing
To improve touchpad palm rejection while typing, this change will cancel
any ongoing touchpad move gesture if user starts typing on keyboard. In
this change we:
1. Introduce a new flag to gaurd this change
2. Add behaviour to cancel ongoing gesture
Bug: 301055381
Test: atest inputflinger_tests
Change-Id: I0830cb24f2046380e140cddd71096b8a611c51de
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.h b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
index ece0eca..897edca 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.h
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.h
@@ -113,6 +113,8 @@
// ADISPLAY_ID_NONE to target the focused display. If there is no display target (i.e.
// std::nullopt), all events will be ignored.
std::optional<int32_t> mDisplayId;
+
+ nsecs_t mGestureStartTime{0};
};
} // namespace android