Treat HOVER_EXIT as continuation of existing gesture
Before this CL, the HOVER_EXIT events used to get treated the same way as the HOVER_ENTER or HOVER_MOVE events. However, that's not quite correct. These events can end gestures, but it never makes sense to use these for starting a new gesture. In this CL, we move the handling of HOVER_EXIT to Case 2 instead of Case 1 inside findTouchedWindowTargetsLocked. Now, both hovering and touching pointers will be considered there. This also means that we should modify the requirement of "at least 1 foreground window", because the gesture needs to be ended correctly even if there's no foreground window present. For example, the window might no longer be foreground, but it already started receiving touch. The foreground check is replaced by an explicit check for empty or exclusively ACTION_OUTSIDE targets. Bug: 273376858 Test: atest inputflinger_tests:InputDispatcherTest.HoverWhileWindowAppears Change-Id: Ib7562ae65ee505debaed92e04aea972221af255d
Loading
Please register or sign in to comment