Fix stylus hover spot not disappearing
When we turn off the stylus hover icon feature and turn on
“show touches”, we will use the touch spot display to show the stylus
hover icon. But currently, we don't remove the hover spot after
HOVER_EXIT, so the stylus hover spot will never disappear. We should
add corresponding logic to handle it.
This patch also refines a previous test to ensure that stylus events
can be handled correctly by PointerChoreographer.
Test: atest inputflinger_tests
Flag: EXEMPT bugfix
Bug: 353451540
Signed-off-by: Linnan Li <lilinnan@xiaomi.corp-partner.google.com>
Merged-In: I4b04992605ba19bdf3fc5db74580b919ef8356c0
Change-Id: I4b04992605ba19bdf3fc5db74580b919ef8356c0
diff --git a/services/inputflinger/PointerChoreographer.cpp b/services/inputflinger/PointerChoreographer.cpp
index 36e133b..a3d6d4a 100644
--- a/services/inputflinger/PointerChoreographer.cpp
+++ b/services/inputflinger/PointerChoreographer.cpp
@@ -264,7 +264,8 @@
const uint8_t actionIndex = MotionEvent::getActionIndex(args.action);
std::array<uint32_t, MAX_POINTER_ID + 1> idToIndex;
BitSet32 idBits;
- if (maskedAction != AMOTION_EVENT_ACTION_UP && maskedAction != AMOTION_EVENT_ACTION_CANCEL) {
+ if (maskedAction != AMOTION_EVENT_ACTION_UP && maskedAction != AMOTION_EVENT_ACTION_CANCEL &&
+ maskedAction != AMOTION_EVENT_ACTION_HOVER_EXIT) {
for (size_t i = 0; i < args.getPointerCount(); i++) {
if (maskedAction == AMOTION_EVENT_ACTION_POINTER_UP && actionIndex == i) {
continue;