summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2025-03-21Add a unit test for receiving 'finish' message after channel close Siarhei Vishniakou
After the input channel is closed, the messages that were previously written to the fd should still be readable. However, in some cases, if the fd is closed with data in the fd's buffer, the data may be discarded. This is confirmed by the attached unit test. Add an explanation of this to the InputChannel implementation, so that this behaviour is documented. Bug: 376713684 Test: TEST=libinput_tests; m $TEST && adb sync data && adb shell -t /data/nativetest64/$TEST/$TEST --gtest_filter="*ReceiveAfterClose*" --gtest_repeat=100000 --gtest_break_on_failure Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST --gtest_filter="*ReceiveAfterClose*" --gtest_repeat=100000 --gtest_break_on_failure Flag: TEST_ONLY Change-Id: I67a6a6432c4756283c8f2cca3c01210a3bcdb42e
2025-03-18Merge "Update thermal headroom listener API doc for NDK" into main Xiang Wang
2025-03-18Merge "frameworks/native: Include stdint.h for int32_t type" into main am: ↵ Steven Moreland
1a8be4f98b am: d3418085a0 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3526633 Change-Id: I4bc7559197eadb25b81f44cb625c941a11bf78e0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-03-18Merge "frameworks/native: Include stdint.h for int32_t type" into main Steven Moreland
2025-03-17Update thermal headroom listener API doc for NDK Xiang Wang
Copy over the SDK doc suggested from API review Test: n/a Flag: EXEMPT NDK Bug: n/a Change-Id: I68b3a241fe337d2b6c34936251cbf8c1eeb0aee4
2025-03-17Merge "Refactor PowerHalController and add a binding for composition data" ↵ Matt Buckley
into main
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-11Merge "[CD Cursor] Add DisplayTopologyValidator" into main Arpit Singh
2025-03-10Refactor PowerHalController and add a binding for composition data Matt Buckley
This patch refactors some of the calls to use the "hal::" syntax used elsewhere for ADPF, and adds (currently unused) wrappers for sending composition data. Bug: 360908317 Flag: EXEMPT refactor Test: atest libpowermanager_test Change-Id: Ib9b2fec37b8e1431ba2c4ba0658db658f28429fa
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-10Merge "Add dev option override flag to connected display cursor flag" into main Treehugger Robot
2025-03-10Add dev option override flag to connected display cursor flag Arpit Singh
Adding the dev option flag that guards the dev option UI before checking the override value. We will fall back to connected displays cursor flag if dev option override is not available. Test: manual and presubmit Bug: 401213103 Flag: EXEMPT only changes the flagging logic Change-Id: Ib9fb9a66deaf1d58b36218039d1854e287be7ce5
2025-03-05frameworks/native: Include stdint.h for int32_t type Biswapriyo Nath
This commit fixes the following compiler error with gcc 14.2.0. native/include/android/configuration.h:531:1: error: 'int32_t' does not name a type 531 | int32_t AConfiguration_getMcc(AConfiguration* config); | ^~~~~~~ native/include/android/configuration.h:536:52: error: 'int32_t' has not been declared 536 | void AConfiguration_setMcc(AConfiguration* config, int32_t mcc); | ^~~~~~~ Change-Id: I11fd658d799801fb6267ab48d4a890cab2086121
2025-03-04Remove the API comment on calculation window superset Xiang Wang
Bug: 346604998 Flag: EXEMPT doc only Test: n/a Change-Id: Icfc2869a5cf602dd4dc37b2f296591c26d62114f
2025-02-28Merge "[owners] Remove alexeykuzmin@google.com from include/OWNERS" into ↵ Ronald Braunstein
main am: 48f26a3c63 am: fbc03c98b5 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3509843 Change-Id: Icb33038b2f1a2e688498a31a899e17a2ff99c6e5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-28Merge "[owners] Remove alexeykuzmin@google.com from include/OWNERS" into ↵ Ronald Braunstein
main am: 48f26a3c63 Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3509843 Change-Id: If9b13915f2355867d2fbaa5aace33fd79eabf55f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-26Merge 25Q1 (ab/12770256) to aosp-main-future Xin Li
Bug: 385190204 Merged-In: I0fb567cbcca67a2fc6c088f652c8af570b8d7e53 Change-Id: Iaae8cd491ff963cf422f4b19c54be33e1244a9a1
2025-02-26[owners] Remove alexeykuzmin@google.com from include/OWNERS Owner Cleanup Bot
This suggested change is automatically generated based on group memberships and affiliations. Please approve this change and vote the highest CR. This will keep the OWNERs file tidy. We ask that you do not ignore this change and approve it unless you know a reason the OWNER should remain. It can always be reverted if needed. If this change is in error, vote the lowest CR value (i.e. reject the CL) and the bot will abandon it. See the owner's recent review activity for context: https://android-review.googlesource.com/q/alexeykuzmin@google.com To report an issue, file a bug in the Infra>Codereview component. Change-Id: I344973946d32b25d103e7367cdbc1fe3fbd93758
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-21Introduce ftl::ignore Lloyd Pique
`ftl::ignore` works like `std::ignore`, but one can also ignore multiple values using `operator()`. `ftl::ignore(a, b);` is more compact than `std::ignore = a; std::ignore = b;`, and conveys the same idea. Bug: 185536303 Flag: EXEMPT New library code Test: atest ftl_test Change-Id: Ice549328eeffb90f59f7b902809def48f583d157
2025-02-18Merge changes I7c2108a2,I23fa0e50,I20d02933 into main Treehugger Robot
* changes: inputflinger: Restricted invalid MotionEvent button enum values inputflinger: Restricted invalid InputDeviceClass enum values inputflinger: only use UTF-8 characters in device name and location
2025-02-18inputflinger: Restricted invalid MotionEvent button enum values Akhilesh Sanikop
Fixes an issue by passing valid MotionEvent buttons through NotifyMotionArgs() in FuzzedInputStream.h. Added IfThisThenThat Lint to remind the actionButton to sync Test: m frameworks/native/services/inputflinger/tests/fuzzers Bug: 392345690 Flag: EXEMPT bugfix in fuzzer Change-Id: I7c2108a255114b24e6544aa930696079e4f06b77
2025-02-17Move utility functions related to isFromSource to Input.h Arpit Singh
Moving following function to a common file to avoid duplication. 1. isStylusHoverEvent 2. isFromMouse 3. isFromTouchpad 4. isFromDrawingTablet 5. isHoverAction 6. isMouseOrTouchpad Test: atest inputflinger_tests Bug: 245989146 Flag: EXEMPT refactor Change-Id: I9538646f126e792897c525e7e698f6acde4aaa22
2025-02-14[CD Cursor] Devopts override for connected displays flag Arpit Singh
Add and use a sysprop based override for connected displays cursor flag. Override is expected to require an restart on change. Allowing us to cache its value. Test: atest inputflinger_tests Bug: 362719483 Flag: com.android.input.flags.connected_displays_cursor Change-Id: I8634e61eb57c82b2b4c904239a4d407ce69f97d8
2025-02-10Add empty, dump methods to BlockingQueue Siarhei Vishniakou
BlockingQueue can now be dumped (since the user can't access its internal state, and it's too clunky to be making a copy just so that we can destructively print it). Also, "empty" method is useful when converting code from std containers to the BlockingQueue. At the same time, mark the "size" method as const. Bug: 376713684 Test: used in another CL in frameworks/base. build only here Flag: EXEMPT refactor Change-Id: I3fda00b793b512bdba4c85dbf561dfc5e9724601
2025-02-06Merge "Reduce heap allocations in BLASTBufferQueue." into main Anton Ivanov
2025-02-07Reduce heap allocations in BLASTBufferQueue. Anton Ivanov
* Replace std::unordered_map members with ftl::SmallMap with empirically determined sizes. * Eliminate creating an unnecessary std::vector Test: unit, manual Bug: 285377983 Flag: EXEMPT refactoring Change-Id: I20402bf58d6619573cb1ff85be5092447f841b8a
2025-02-05InputVerifier: verify button events and states (attempt 2) Harry Cutts
Check the following things: * BUTTON_PRESS and _RELEASE actions have a single, valid action button * No redundant BUTTON_PRESS or _RELEASE actions (i.e. for buttons that are already pressed or released) * Button state remains consistent throughout the stream, i.e.: * Buttons are only added to the state by BUTTON_PRESS (though DOWN events can have "pending" buttons on them) * Buttons are only removed from the state by BUTTON_RELEASE * When a DOWN event has pending buttons in its state, it is immediately followed by a BUTTON_PRESS for each one We could also verify that press and release events for primary, secondary, and tertiary buttons are accompanied by down and up events. However, I couldn't find any documentation that states which buttons should result in down or up events, so I haven't implemented this for now. This is the second attempt to land this change, due to the original causing test failures. Change I5c259c13d433d3010d2cf9c6fe01e08ba5990ef7 fixes the failures. v2 also adds a separate flag for button state verification, as it is actually used in production to check events injected by assistive technologies, whether or not the flag that I previously thought was guarding it is enabled. Test: connect a mouse and a touchpad, enable the verifier, play around with the buttons, and check that any issues found by the verifier appear to be legitimate. (I found b/391298464 , and checked that the verifier caught a button problem with a partial fix to b/372571823 .) Test: atest --host libinput_rust_tests Test: atest --host frameworks/native/libs/input/tests/InputVerifier_test.cpp Test: atest --host \ frameworks/native/services/inputflinger/tests/InputDispatcher_test.cpp Bug: 392870542 Flag: com.android.input.flags.enable_button_state_verification Change-Id: I46f489b26df8785563e41e58135b6b5de4ff62a2
2025-02-03[CD cursor] Adjust for density when moving cursor between displays Arpit Singh
Connected displays may have different densities we need to adjust our calculations to consider this when cursor moves between displays. Test: atest inputflinger_tests Bug: 367660694 Flag: com.android.input.flags.connected_displays_cursor Change-Id: Iecc262cf2efdda3249aff69d5ac157b4c434a575
2025-01-29Merge "Move external MultiTouch test into InputMapperUnitTest" into main Treehugger Robot
2025-01-29Merge "Tracks whether an injected MotionEvent came from an accessibility ↵ Daniel Norman
tool." into main
2025-01-29Move external MultiTouch test into InputMapperUnitTest Siarhei Vishniakou
This test is broken because it relies on an incorrect ACTION_CANCEL event being generated. Move this test over to the new InputMapperUnitTest infra before fixing it in subsequent CLs. Bug: 378308551 Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST Flag: TEST_ONLY Change-Id: I016fb66f7fcbe957cd5b6e8ca86513cb8c372cd3
2025-01-27Tracks whether an injected MotionEvent came from an accessibility tool. Daniel Norman
This property can be checked by the View to allow sensitive views to ignore gestures injected by non-tool accessibility services. Sensitive views should continue responding to gestures injected by Accessibility Tools. Note: The files in this change do not reference the new flag, but this change is a no-op if the flag is not enabled. See other change in this topic. Bug: 284180538 Flag: android.view.accessibility.prevent_a11y_nontool_from_injecting_into_sensitive_views Test: atest InputDispatcher_test.cpp Test: See other change in topic for tests using this property Change-Id: I40ba79852045aaefe84f7ab87d5e08c42509f1e7
2025-01-27DisplayTopologyGraph offset in dp and store densities Piotr Wilczyński
Bug: 384668407 Bug: 362719483 Flag: com.android.server.display.feature.flags.display_topology Test: m Change-Id: I6d398b3af6609b0774b34e4b3f80e3afc136ed7c
2025-01-24Revert "InputVerifier: verify button events and states" Priyanka Advani (xWF)
This reverts commit fb477b1399b4501acdb2516b6a0a00765dd8aba3. Reason for revert: Droidmonitor created revert due to b/392150793. Will be verifying through ABTD before submission. Change-Id: Ie2c9d9e4271addf5b198e34875ee02082b0132ba
2025-01-23InputVerifier: verify button events and states Harry Cutts
Check the following things: * BUTTON_PRESS and _RELEASE actions have a single, valid action button * No redundant BUTTON_PRESS or _RELEASE actions (i.e. for buttons that are already pressed or released) * Button state remains consistent throughout the stream, i.e.: * Buttons are only added to the state by BUTTON_PRESS (though DOWN events can have "pending" buttons on them) * Buttons are only removed from the state by BUTTON_RELEASE * When a DOWN event has pending buttons in its state, it is immediately followed by a BUTTON_PRESS for each one We could also verify that press and release events for primary, secondary, and tertiary buttons are accompanied by down and up events. However, I couldn't find any documentation that states which buttons should result in down or up events, so I haven't implemented this for now. Test: connect a mouse and a touchpad, enable the verifier, play around with the buttons, and check that any issues found by the verifier appear to be legitimate. (I found b/391298464, and checked that the verifier caught a button problem with a partial fix to b/372571823.) Test: atest --host libinput_rust_tests Test: atest --host frameworks/native/libs/input/tests/InputVerifier_test.cpp Test: atest --host \ frameworks/native/services/inputflinger/tests/InputDispatcher_test.cpp Bug: 372571823 Flag: com.android.input.flags.enable_inbound_event_verification Change-Id: I59b886bfb632f0f26ee58c40f82f447f5ea59b41
2025-01-17Merge "Add myself to OWNERS" into main am: a5f4c789d5 am: 0fe9ef285b Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3433090 Change-Id: Ie07dabdc4e35c2c0043e501e7f76b52305a9d476 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-17Merge "Add myself to OWNERS" into main Treehugger Robot
2025-01-10Merge "Add a private API to set mocking hint manager for testing" into main Treehugger Robot
2025-01-09Merge "[audio] Add AudioManager getNativeInterface" into main Treehugger Robot
2025-01-08Merge "Update private API owner for system health" into main am: 1f55f7d4e2 ↵ Treehugger Robot
am: 9b1101b6fb Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/3433106 Change-Id: Iddd5843d798e2bad63c8f9e41ceb8e0b97b8343f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-07Document what onKeyEvent/onMotionEvent return values mean Vishnu Nair
Change-Id: I9ca51a93af79360cd57aabba08d83f968618308c Fixes: 346593383 Test: n/a Flag: EXEMPT docs
2025-01-07Add a private API to set mocking hint manager for testing Xiang Wang
Updated the doc of interval methods as they won't fail now Bug: 346604998 Flag: EXEMPT ndk Test: atest NativeSystemHealthUnitTest SystemHealthManagerUnitTest NativeSystemHealthTest HeadroomTest Change-Id: Ia8a3d921f831ee0c07b16926500581fc2a8d5b00
2025-01-06[audio] Add AudioManager getNativeInterface Atneya Nair
Migrate to a sub-interface for native accessibly methods so we don't have to manually parcel/transact new additions. The existing methods will either be removed, or folded into the native interface via ongoing refactoring. Test: compiles Bug: 376481063 Flag: EXEMPT mechanical refactor Change-Id: Ief320a181c1c21076f1b1c8d1372808505bcd460
2025-01-06Introduce ftl::Finalizer{<F>,Std,Ftl,Ftl1,Ftl2,Ftl3} Lloyd Pique
A Finalizer ensures a final cleanup function is executed when it is destroyed. The cleanup can also be explicitly invoked before destruction, or canceled so it is not executed. As they are meant for one-time cleanup, Finalizers are moveable but not copyable. The templated `Finalizer<F>` can be constructed from any function object that can be invoked with no arguments and that returns void. If `F` can be default constructed, then `Finalizer<F>` can be default constructed. `ftl::FinalizerStd` is an alias that uses `std::function` as the function object type. `ftl::FinalizerFtl`, `ftl::FinalizerFtl1`, `ftl::FinalizerFtl2` and `ftl::FinalizerFtl3` are aliases that use `ftl::Function` as the type, with increasing amounts of fixed-size internal storage for captured values. These are useful when specifying a return type or a storage type, and are all default-construcible. Bug: 185536303 Flag: EXEMPT New library code Test: atest ftl_test Change-Id: If4a130873ae38727e5bafd634344ae341640e742
2025-01-06Merge "Address NDK API review feedback" into main Matt Buckley
2025-01-02Add myself to OWNERS Atneya Nair
Change-Id: I2b56ae76aa31c3b5fb8372a99e54848d8cc736af Test: none Bug: trivial Flag: EXEMPT docs_only
2024-12-30Merge "Add support to disable mouse acceleration" into main Michael Checo
2024-12-27Add support to disable mouse acceleration Michael Checo
Bug: 382276176 Test: atest CursorInputMapperUnitTest Flag: com.android.hardware.input.pointer_acceleration Change-Id: I431ac6fa3b918b1d292528f614e06532837c4a82