SyncPointerCapture (5/n): Move Pointer Capture to InputDispatcher
This CL re-implements Pointer Capture in InputDispatcher, moving it away for WindowManagerService. The pipeline for Pointer Capture is changed so that requests to enable and disable Pointer Capture from an app are redirected directly to InputDispatcher by InputManagerService. The new expected pipeline for Pointer Capture is as follows: - App requests Pointer Capture through InputManagerService with its window token. - InputManagerService gets the InputWindowToken for the WindowToken, and relays the Pointer Capture request to InputDispatcher. - Pointer Capture is enabled in InputFlinger: 1. InputDispatcher receives the Pointer Capture request, and ignores requests from windows that are not focused. InputDispatcherInterface::requestPointerCapture(windowToken, enabled) 2. InputDispatcher sets the Pointer Capture state through its policy, which sends a configuration change to InputReader. InputDispatcherPolicyInterface::setPointerCapture(enabled) 3. InputReader changes its configuration to enable/disable Pointer Capture, and sends notifyPointerCaptureChanged to InputDispatcher. InputListener::notifyPointerCaptureChanged(args) 4. The Pointer Capture change notification is sent to the input channel. - App receives a Pointer Capture change event through its InputChannel. The window that has Pointer Capture is tracked in InputDispatcher. If the window loses focus, Pointer Capture is disabled immediately, and InputDispatcher synthesizes a Pointer Capture change event to dispatch to the app before it sends the event signalling the focus loss. Bug: 141749603 Test: atest inputflinger_tests Test: atest PointerCaptureTest (CTS) Test: manual: Pointer Capture works Change-Id: Ie27f6e279af9b0d844160fb146476e1812fb02b3
Loading
Please register or sign in to comment