summaryrefslogtreecommitdiff
path: root/services/inputflinger
AgeCommit message (Collapse)Author
2025-03-21Merge changes from topic "getSysfsRootPath" into main Prabir Pradhan
* changes: EventHub: Re-open Devices serially when AssociatedDevice changes InputReader: Add getter API for the sysfs node path of an InputDevice
2025-03-21Merge "EventHub: Process sysfs node changes from InputReader thread" into main Treehugger Robot
2025-03-21Merge "EventHub: Close opening device before deleting on sysfs change" into main Prabir Pradhan
2025-03-20Merge "InputDispatcher: Provide a way to transfer the entire gesture" into main Treehugger Robot
2025-03-19InputDispatcher: Provide a way to transfer the entire gesture Siarhei Vishniakou
In this CL, we modify the behaviour of 'transferTouchGesture' to also allow the caller to request that the entire gesture is transferred to the destination window. Suppose the original window receives ACTION_DOWN and calls transferTouchGesture to the destination window. Before this CL, the subsequent pointers would always be routed to the original window. In this CL, the caller of 'transferTouchGesture' can choose to transfer the 'entire gesture', meaning that subsequent pointers from the same gesture that land in the original window would automatically be sent to the destination window. Bug: 397979572 Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST Flag: com.android.input.flags.allow_transfer_of_entire_gesture Change-Id: I760ddb8aa8f329d0b21788e6d6e83c802015ee1d
2025-03-19EventHub: Re-open Devices serially when AssociatedDevice changes Prabir Pradhan
This CL changes behavior so that when an AssociatedDevice changes, all affected Devices will be re-opened serially, where the DEVICE_REMOVED notification of one device closing is followed by the DEVICE_ADDED signal of its new counterpart, before proceeding with the re-opening of the next affected Device. This is to temorarily curb the side-effects of delayed AssociatedDevice changes by reducing the number of cases where we send device removed notifications immediately after an input device is first connected, followed by the addition of a new InputDevice. These kind of "hotplug" events are detrimental to many tests and may have side effects in production. This CL relies on some assumptions on how devices will be merged in InputReader, so it does not solve the problem for all cases. It only aims to reduce the likelihood of impact temporarily until AssociatedDevice changes can be processed separately in InputReader, which is backlogged as b/281822656. Bug: 397208968 Test: Presubmit Flag: EXEMPT bug fix Change-Id: I61818076a720a5474de8cbeb431ddbceec6e1545
2025-03-18Merge "TouchpadInputMapper: dedup successive swipe lift gestures in metrics" ↵ Treehugger Robot
into main
2025-03-18EventHub: Process sysfs node changes from InputReader thread Prabir Pradhan
Before syfs node change notifications were processed by EventHub, all device openings and closings happened on the InputReader thread. The upper layer (InputReader) makes assumptions about EventHub Device states being synchronized with the notications of device additions and removals from EventHub to InputReader. The addition of sysfs node change processing moved some device openings and closings off of the InputReader thread, which can break the synchronization assumptions in InputReader. In this CL, we move sysfs node change processing to the InputReader thread. Bug: 397208968 Bug: 358694799 Test: Presubmit Flag: EXEMPT bug fix Change-Id: If6d70a12ddf74098c74b8360d31c4967ae6b3d03
2025-03-18InputReader: Add getter API for the sysfs node path of an InputDevice Prabir Pradhan
Bug: 397208968 Test: Presubmit Flag: EXEMPT bug fix Change-Id: I25f41f41ec1f1e47590eef21b982287caea193a6
2025-03-18EventHub: Close opening device before deleting on sysfs change Prabir Pradhan
We must unregister all fds from epoll before closing them to avoid the fds from remaining open and thus leaking. Prevent fd leaks by closing any opening device from epoll before closing the Device via its destructor when the sysfs node changes and triggers a device reopening. In this CL, we modify the closeDeviceLocked function to also look at mOpeningDevices when a device is being closed. Context: https://idea.popcount.org/2017-03-20-epoll-is-fundamentally-broken-22/ Bug: 397208968 Test: Presubmit Flag: EXEMPT bug fix Change-Id: I3de8a9413e68a0b7409e5d0bf56b9d76b7164b49
2025-03-18TouchpadInputMapper: dedup successive swipe lift gestures in metrics Harry Cutts
In tests, the Gestures library occasionally outputs two lift gestures in a row, which can cause inaccurate metrics reporting. To work around this, keep track of the previous gesture the metrics collector saw, and don't report additional swipe gestures if we see multiple lifts in a row. Bug: 397219482 Test: $ atest \ CtsInputHostTestCases:android.input.cts.hostside.InputAtomsTest Flag: TEST_ONLY Change-Id: Iac2b6ae68dc62e3a106a743b667eddd96a1a7a74
2025-03-17Add support for search modifier fallbacks Jimmy
Fixes a bug in where kcm fallbacks with search based modifiers could not activate since PhoneWindowManager would consume all search events. This prevented the InputDispatcher from generating the fallback. This change modifies the behavior so InputDispatcher handles whether the search-based event will attempt to generate a fallback. Bug: 384113980 Test: atest InputDispatcherTest Flag: com.android.hardware.input.fix_search_modifier_fallbacks Change-Id: Ib7eca10f00ec93fd46a93396b7908ff925dd705b
2025-03-17InputDispatcher: Initialize mWindowInfosVsyncId Prabir Pradhan
Bug: 402990967 Flag: EXEMPT bug fix Test: Presubmit Change-Id: Ib8f99c0285df211362a02e92063e3c78bf26b9fb
2025-03-14Merge "Remove old WindowInfosListener debug logging" into main Treehugger Robot
2025-03-13Remove old WindowInfosListener debug logging Patrick Williams
Bug: 402990967 Flag: EXEMPT refactor Test: presubmits Change-Id: I0676f0a39e895acac572c5c9de0417b12db22547
2025-03-11Add MaximumObscuringOpacityForTouch to input dump Arpit Singh
Bug: 245989146 Test: check dumpsys input Flag: EXEMPT log only update Change-Id: I26ab5e588bb04a37553298ab4990bb29cd974d50
2025-03-11Add display topology to input dump Arpit Singh
Add display topology to dump in Dispatcher and Choreographer for debugging. Bug: 245989146 Test: dumpsys input Flag: EXEMPT log only update Change-Id: I8e9eb4d5c3c88e1cb6aeaa35db07006b003aad93
2025-03-10[CD Cursor] Add DisplayTopologyValidator Arpit Singh
Add a DisplayTopologyValidator to verify assumptions made in the PointerChoreographer and InputDispatcher, some sanity checks on the topology graph to flag issues realted to topology for debugging. The validator will be used in the InputManager to validated and discard invalid topology updates. Test: atest inputflinger_tests Bug: 401219231 Flag: com.android.input.flags.enable_display_topology_validation Change-Id: I624bc32b73144cc047f317ef889f7f07cc1c3dfc
2025-03-06Merge "Cleanup hide_pointer_indicators_for_secure_windows flag" into main Treehugger Robot
2025-03-06Merge "Cleanup touchpad_typing_palm_rejection flag" into main Treehugger Robot
2025-03-06Cleanup hide_pointer_indicators_for_secure_windows flag Arpit Singh
Flag is in nextfood so we can remove it. Bug: 325252005 Test: atest --host inputflinger_tests Flag: EXEMPT removing hide_pointer_indicators_for_secure_windows Change-Id: I8b1695d19e30f3bf15eb316edd99c0a61412df78
2025-03-06Cleanup touchpad_typing_palm_rejection flag Arpit Singh
Flag is in nextfood so we can remove it. Bug: 301055381 Test: atest --host inputflinger_tests Flag: EXEMPT removing enable_touchpad_typing_palm_rejection Change-Id: I70afd61eb5f38719c928c002cc24ed99218ce6b5
2025-03-05Merge "Refactor interceptKeyBeforeQueueing tests in ↵ Treehugger Robot
FakeInputDispatcherPolicy" into main
2025-03-05Merge "[CD Cursor] Fix invalid displayId set when topology is not yet set" ↵ Nergi Rahardi
into main
2025-03-05Refactor interceptKeyBeforeQueueing tests in FakeInputDispatcherPolicy Jimmy
Refactor to explicitly set the `delay` of an intercept result, which allows granular return values. Bug: 384113980 Test: atest InputDispatcherTest Flag: TEST_ONLY Change-Id: I8c581780bc5fbac96fc00ac2750e5d015dbcc9f0
2025-03-05Merge "Add test to verify the repeated key when window focus changed" into main Arthur Hung
2025-03-05Merge "TouchInputMapper: Add logs for b/396796958" into main Treehugger Robot
2025-03-05Add test to verify the repeated key when window focus changed Arthur Hung
In previous version, when an user long press a key and it's not consumed by the policy, a synthesized repeat key will be delivered to the focused window even it changed to another one. This will add a new test to verify it won't synthesize the new repeat key when the focused window is changed. Flag: EXEMPT bugfix Bug: 400516905 Test: atest inputflinger_tests Change-Id: Iafc85800bfc292bc1daab6d70c67b8597757bac1
2025-03-05TouchInputMapper: Add logs for b/396796958 Harry Cutts
In this bug, we're seeing test flakes where touches don't get through to a test activity, and the raw event logs show "syncTouch: pointerCount 0 -> 1" multiple times in a row. To get us some better debugging data, dump the whole InputReader state as well as the last and next RawStates when this happens. Bug: 396796958 Test: enable raw event logs: $ adb shell 'stop && setprop log.tag.InputReaderRawEvents DEBUG && start' then touch the screen and check the dump appears in the logs. Test: touch screen and check output of $ adb shell dumpsys input Test: $ atest --host inputflinger_tests Test: $ m checkinput Flag: EXEMPT log only update Change-Id: I8f1c9ec772971f3e3deefbae94bcae678b1083f4
2025-03-05[CD Cursor] Fix invalid displayId set when topology is not yet set nergi
The issue here was that both currentCursor and topology has invalid displayId, but input devices have been set.. Which caused [Cursor|Touchpad]InputMapper to not get notified on DISPLAY_INFO reconfiguration, and rejecting all motion events. Bug: 399893492 Bug: 396568321 Test: Manually verified with attached cursor on reboot Flag: com.android.input.flags.connected_displays_associated_display_cursor_bugfix Change-Id: I016c646acdf6bd7b0fdb2840c852b825ccad9e1b
2025-03-04Merge "KeyboardInputMapper: Refactor alphabetic keyboard wake unit tests" ↵ Henry Barnor
into main
2025-03-04Merge "CapturedTouchpadEventConverter: clean up relative axes flag" into main Treehugger Robot
2025-03-03KeyboardInputMapper: Refactor alphabetic keyboard wake unit tests Henry Barnor
The mock device for KeyboardInputMapperUnitTest was not an alphabetic keyboard. Created subclasses with mock alphabetic keyboard and different flag states to enable test cases for alphabtic and non-alphabetic keyboards in addition to different flag states. Test: atest --host inputflinger_tests Bug: 394280942 Flag: TEST_ONLY Change-Id: Ia2faf945d3aa3ee138d99a2a2a854006c31c10da
2025-03-03CapturedTouchpadEventConverter: clean up relative axes flag Harry Cutts
This is now launched, so we can safely remove it. Bug: 374937381 Test: atest --host inputflinger_tests:CapturedTouchpadEventConverterTest Test: atest CtsHardwareTestCases:android.hardware.input.cts.tests.SonyDualshock4BluetoothTest Flag: EXEMPT removing com.android.input.flags.include_relative_axis_values_for_captured_touchpads Change-Id: I98912368cab71c8bb8691228e1e8dcab4e491634
2025-03-03Merge "KeyboardInputMapper_test: remove unused testDPadKeyRotation ↵ Treehugger Robot
parameter" into main
2025-02-28Merge changes Ib7bee2d2,Iea573032 into main Treehugger Robot
* changes: KeyboardInputMapper_test: send SYN_REPORTs KeyboardInputMapper_test: send UP in Process_SendsReadTime
2025-02-28KeyboardInputMapper_test: remove unused testDPadKeyRotation parameter Harry Cutts
Test: atest --host \ frameworks/native/services/inputflinger/tests/KeyboardInputMapper_test.cpp Bug: 245989146 Flag: TEST_ONLY Change-Id: Iacd4c73862bf88cf3d721b842c5a540493fa4397
2025-02-28KeyboardInputMapper_test: send SYN_REPORTs Harry Cutts
KeyboardInputMapper happens to be implemented in such a way that it acts on key events immediately, without waiting for SYN_REPORTs, so many of its tests don't send SYN_REPORTs at all. However, they really should, both to avoid depending on that implementation detail of KeyboardInputMapper, and to provide more realistic input. Test: atest --host \ frameworks/native/services/inputflinger/tests/KeyboardInputMapper_test.cpp Bug: 245989146 Flag: TEST_ONLY Change-Id: Ib7bee2d2203c5bdab67fdaf6df1e260ddb48dc95
2025-02-28KeyboardInputMapper_test: send UP in Process_SendsReadTime Harry Cutts
This was sending two key downs, rather than a down and an up. Test: atest --host \ frameworks/native/services/inputflinger/tests/KeyboardInputMapper_test.cpp Bug: 245989146 Flag: TEST_ONLY Change-Id: Iea57303277766dcfbe8be7e2cd32d0e88e5059d3
2025-02-25Merge "[CD Cursor] Apply selection logic to change cursor displayId" into main Nergi Rahardi
2025-02-25[CD Cursor] Apply selection logic to change cursor displayId nergi
In connected displays scenario, this tracks the latest display the cursor is at, within the DisplayTopology. By default, this will be set to topology primary display, and updated when mouse crossed to another display. Note: If associatedDisplay is in different topology, mouse will simply be on the associatedDisplay, keeping existing behavior Doc: go/connected-displays-cursor-behavior Bug: 396568321 Test: atest inputflinger_tests Test: atest InputTests Test: atest CtsInputTestCases Flag: com.android.input.flags.connected_displays_associated_display_cursor_bugfix Change-Id: I6a68d9cd5a4de06896e0e29104c25b8a4493b852
2025-02-21[CD Cursor] Fix cursorState lookup for non-primary displays Arpit Singh
In connected display scenario touchstate display for mouse is always identified by primary display. At present DispatcherTouchState::forTouchAndCursorStatesOnDisplay is the only API in TouchStates that does not adhere to this mapping. This can cause the lookup for cursorState to fail. IsPointerInWindow is the only public API in dispatcher that uses this and fails. This Cl updates the lookup and adds tests for API called with the non-primary display in topology. Test: inputflinger_tests with the flag enabled/disabled Bug: 395033854 Flag: com.android.input.flags.connected_displays_cursor Change-Id: I1515171802478a7132206562e41a7586b8ca8559
2025-02-21[CD Cursor] Update pointer display in line with topology update Arpit Singh
This CL fixes issues related to pointer display on topology update. When we are working with topology cursor display should only be updated when topology is updated or user moves the cursor between displays. This CL Specifically implements following behaviour: 1. Ignore setDefaultMouseDisplayId whith topology. 2. Only update pointer display when topology is set. 3. Fallback to the primary display id pointer display is removed. Test: atest inputflinger_tests Bug: 395033854 Flag: com.android.input.flags.connected_displays_cursor Change-Id: I576107b0ee5b81d596bdb91c796ceb6ac9eb2f73
2025-02-21Add method to setDefaultMouseDisplay in ChoreographerTest Arpit Singh
This CL adds setDefaultMouseDisplayId method to the PointerChoreographerTest base class. This will allow us to customize this in the next CL. Test: atest inputflinger_tests Bug: 245989146 Flag: EXEMPT TEST_ONLY Change-Id: Ieea0f252b21fc0eb3002201feb36bdb2bb546488
2025-02-19Merge "[CD Cursor] Enable gesture transfer across connected displays" into main Treehugger Robot
2025-02-19[CD Cursor] Enable gesture transfer across connected displays Arpit Singh
In case of a mouse touchState's displayId may not be same as touched window's displayId. This causes the gesture transfer for drag and drop to fail. To prevent this we should lookup for transfer target on all connected displays. Test: atest inputflinger_tests Bug: 393344208 Flag: com.android.input.flags.connected_displays_cursor Change-Id: Ib193f108c54655f2170585ae02228cda969977ea
2025-02-18Merge "HardwareStateConverter: clean up palm reporting flag" into main Treehugger Robot
2025-02-18HardwareStateConverter: clean up palm reporting flag Harry Cutts
This rolled out almost a year ago. Bug: 245989146 Test: $ atest --host inputflinger_tests Flag: EXEMPT removing com.android.input.flags.report_palms_to_gestures_library Change-Id: I7ab0381d20405fed14ac97453a59dfd7af3513c9
2025-02-18Merge "PointerChoreographer: Starting stylus hover gesture should fade ↵ Treehugger Robot
mouse" into main
2025-02-18Merge "Allow touchpad debug logs to be enabled on the fly" into main Treehugger Robot