- May 02, 2024
-
-
Dan Albert authored
They're deprecated, but still needed by most users, as the replacement is not available until API 29. Restore the docs and explain the bugs. Bug: None Test: treehugger Change-Id: I4227ce3f0ee57a73a13e394cd48373accf4a58a3
-
Dan Albert authored
Add the soon-to-be-required removal message for ALooper_pollAll, and expand the docs for both ALooper_pollAll and ALooper_pollOnce to make the reason for removal clear, and to explain the fix callers should apply. Bug: https://github.com/android/ndk/issues/2014 Test: treehugger Change-Id: I020a280346d1ff9f5fcbec4c153dee8319cdf539
-
Dan Albert authored
Bug: None Test: treehugger Change-Id: I3a52883fba0e31f05e50cd51193bbb306418b18a
-
- Apr 02, 2024
-
-
Marijn Suijten authored
By declaring the ABI of `enum` types, the `enum` type can now be used in place of a raw and untyped integer in function parameters and structure fields, self-documenting what the possible values are. Test: treehugger Change-Id: I6b9cf8b36b16e23c0e992f8155452bd194e6e1ad Signed-off-by:
Marijn Suijten <marijns95@gmail.com>
-
Dan Albert authored
Bug: https://github.com/android/ndk/issues/1920 Test: treehugger Change-Id: Ib8296e7b9c86809d16fbde0787d016095a189387
-
- Mar 21, 2024
-
-
Linnan Li authored
Because of the existence of extra spaces, the owner of keycodes.h is not configured as expected. We should delete this extra spaces. Bug: none Test: After merging, check whether the owner of keycodes.h includes all users under INPUT_OWNER Change-Id: I634c49f53a4633bdee3cdefbf0debae4dff90a47
-
- Feb 23, 2024
-
-
Dan Albert authored
This is far from the only C incompatibility in this file, but it's the one that's most likely to not break builds, so I'm starting small. This is a source compat break, but not an ABI break. Bug: https://github.com/android/ndk/issues/1920 Test: treehugger Change-Id: I5a32762fa61b1399fb354397479603858184ea05
-
- Jan 18, 2024
-
-
Prashanth Swaminathan authored
The looper.h header introduced __REMOVED_IN, which requires the sys/cdefs.h header to provide definitions for the macro. Add them here and update files that include looper.h to not provide their own definitions of __REMOVED_IN. Further, update comments to clarify that the additional defines are in place to satisfy builds that use glibc or Windows/MacOS libcs. Bug: 14257980 Change-Id: Ia524b7e180c5137e84c205a77dc219b9e9e41608
-
- Jan 03, 2024
-
-
Arpit Singh authored
We don't yet have a way to determine if a device can actually report a usage code. Adding a flag to mark usage code as fallback only mapping. Bug: 297094448 Bug: 317838112 Test: atest inputflinger_tests Change-Id: I137113d0dc9a1c8abf523b96942486be176d0240 Merged-In: I137113d0dc9a1c8abf523b96942486be176d0240
-
- Dec 13, 2023
-
-
Lloyd Pique authored
ftl::Function<F, N> is a container for function object, and can mostly be used in place of std::function<F>. Unlike std::function<F>, a ftl::Function<F, N>: * Uses a static amount of memory (controlled by N), and never any dynamic allocation. * Satisfies the std::is_trivially_copyable<> trait. * Satisfies the std::is_trivially_destructible<> trait. However to satisfy those constraints, the contained function object must also satisfy those constraints, meaning certain types (like std::unique_ptr's) cannot be part of the contained function object type. The size of a ftl::Function<F, N> is guaranteed to be: sizeof(std::intptr_t) * (N + 2) If not specified, N defaults to zero, which is big enough to store a lambda that captures a single pointer (such as "this" for forwarding to a member function. By comparison, sizeof(std::function) == sizeof(std::intptr_t) * 4, at least with on x86-64 with clang 15. Compile time checks are performed that the constraints are all satisfied, and that the value of N is large enough to contain the desired function object type. ftl::make_function is a helper function to construct a ftl::Function, and will deduce the template type arguments. In addition to constructing a ftl::Function for a function object, ftl::make_function has overloads for creating a ftl::Function which will invoke a member function or a free (non-member) function. ftl::no_op is a helper value to construct a ftl::Function<F, N> that does nothing, except default construct a return value, if one is needed. A unit test is also included to demonstrate and verify the implementation, including asserting that function objects which don't meet the requirements cannot be used. The test also asserts some non-obvious corner cases for handling argument and return value conversions to match how std::function behaves. Bug: 279581095 Test: atest ftl_test Change-Id: I268facb106a248d0766e931595291036bc606fb7
-
- Dec 11, 2023
-
-
Siarhei Vishniakou authored
This makes it more convenient to dump windows from other places during debugging. For example, this could also be called from setInputWindows to inspect all of the window flags that might be changing. Bug: 312714754 Test: adb shell dumpsys input Change-Id: I2ace23bec1231f3a318e1b6a19f146b588e077b6
-
Yi Kong authored
DisplayViewport.h:133:29: warning: format specifies type 'int' but the argument has type 'ui::Rotation' [-Wformat] Test: presubmit Change-Id: Ie656a3da47f2155b106014dff967d5b2d05998d9
-
- Dec 08, 2023
-
-
Cody Heiner authored
The MetricsManager needs to receive UP/CANCEL events to trigger atom reporting. I must have moved these lines around during the refactor and overlooked this mistake. This change also modifies MotionPredictor and MetricsManager to hold a "ReportAtomFunction" to facilitate testing. Test: `statsd_testdrive 718` shows atoms reported with `adb shell setenforce 0`. Test: `atest frameworks/native/libs/input/tests/MotionPredictor_test.cpp -c` passes. Test: `atest frameworks/native/libs/input/tests/MotionPredictorMetricsManager_test.cpp -c` passes. Bug: 311066949 Change-Id: Icbb709bbb7cf548512e0d9aa062783d554b857e3
-
- Nov 27, 2023
-
-
Peiyong Lin authored
Previously we introduced the reportActualWorkDuration API without specifying the work duration for each components, this patch introduces a separate API that allows clients to send work duration with each component to allow fine grained scheduling strategy. Bug: b/284324521 Test: atest PerformanceHintNativeTest Test: atest PerformanceHintManagerTest Change-Id: Ie68657dece0d7fef5843df798472adb9108f534f
-
- Nov 20, 2023
-
-
Tomasz Wasilczyk authored
Also, reuse dupFd method instead of calling ::dup directly. Test: m libinput Test: m libinputdispatcher Bug: 302723053 Change-Id: Ie6e4f1ea9cfc00b4c2be44dcc8922a17de129cfb
-
Jorim Jaggi authored
Revert submission 24997733-adpf-gpu-plumbing Reason for revert: b/311102554 Reverted changes: /q/submissionid:24997733-adpf-gpu-plumbing Change-Id: Ifd3973cc97b7be525c5e936ab6764b727de1804d
-
- Nov 17, 2023
-
-
Tomasz Wasilczyk authored
Test: mma Bug: 302723053 Change-Id: I52f14cadb027b3f854946d5315dce3d23aa21b19
-
- Nov 10, 2023
-
-
Peiyong Lin authored
Previously we introduced the reportActualWorkDuration API without specifying the work duration for each components, this patch introduces a separate API that allows clients to send work duration with each component to allow fine grained scheduling strategy. Bug: b/284324521 Test: atest PerformanceHintNativeTest Test: atest PerformanceHintManagerTest Change-Id: Ia2e66ae173255acee3f05fa99177659604976aa1
-
- Nov 09, 2023
-
-
Xiang Wang authored
Bug: b/288119641 Test: atest NativeThermalTest Change-Id: I2ba820da74b290a25ff1edf8d278b9200dfaf950
-
- Nov 08, 2023
-
-
Siarhei Vishniakou authored
Initial version of a fuzzer for InputDispatcher. The goal is to reproduce crashes that are triggered by the fatal logs, mainly around: 1) mismatching downtime / eventTimes 2) unexpected hover events Currently, the fuzzer runs without hitting those targets. However, it hits an ODR due to rect so currently it has to run without checking for ODRs. It also currently hits an out of memory issue after a short run, finding a problem in AStatsManager_setPullAtomCallback packages/modules/StatsD/lib/libstatspull/stats_pull_atom_callback.cpp:397:46 Bug: 281806933 Test: FUZZER=inputflinger_input_dispatcher_fuzzer; m $FUZZER && ASAN_OPTIONS=detect_odr_violation=0 $ANDROID_HOST_OUT/fuzz/x86_64/$FUZZER/$FUZZER Test: atest inputflinger_benchmarks Change-Id: I465ea11520fc9cc21886646c0ecf20dc529b2698
-
- Nov 03, 2023
-
-
Prabir Pradhan authored
Bug: 210460522 Bug: 309154937 Test: atest inputflinger_tests Change-Id: If07a2d1dd0043e4959ed20b086fa5afef26bd751
-
- Oct 28, 2023
-
-
Siarhei Vishniakou authored
To fully support palm rejection, we should not produce any velocity for pointers that have been marked as palm. This can be achieved by erasing the corresponding pointer state in VelocityTracker for ACTION_POINTER_UP with FLAG_CANCELED events, or for all pointers in ACTION_CANCEL events. The pointers that have not been canceled will still produce the correct velocity. Bug: 236772648 Test: TEST=libinput_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST Change-Id: I67ecae6b4bff2eb63f9cff416841031dea3ed680
-
- Oct 24, 2023
-
-
Siarhei Vishniakou authored
When KeyCharacterMap is read from parcel, there's no need to force the caller to store the object in a shared pointer. We can return a unique_ptr first, and let the caller decide on how exactly that lifetime should be managed. Bug: 274058082 Test: presubmit Change-Id: I8c5ec1e32a9304f6ad186bc0279f4c7bcbab77d8
-
- Oct 18, 2023
-
-
Siarhei Vishniakou authored
This function is now getting moved to Input.h. We are also making its behaviour deterministic: if at least one pointer is stylus, then the event is a stylus event (unless the source wasn't set to "stylus"). This way, an event with 1 finger and 1 stylus pointers will have the same consistent behaviour, regardless of the order that the pointers are stored inside the event. Bug: 211379801 Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST Change-Id: Ie164e32b7c0e9cf21b3819b01a03ac2885666191
-
- Oct 09, 2023
-
-
Elliott Hughes authored
Bug: https://github.com/android/ndk/issues/1933 Test: treehugger Change-Id: Ifbb4d08722aa953f3e86d770e8d6c9017ab9d680
-
- Oct 02, 2023
-
-
Arpit Singh authored
We don't yet have a way to determine if a device can actually report a usage code. Adding a flag to mark usage code as fallback only mapping. Bug: 297094448 Test: atest inputflinger_tests Change-Id: I137113d0dc9a1c8abf523b96942486be176d0240
-
- Sep 27, 2023
-
-
Siarhei Vishniakou authored
Check for the source inside InputVerifier. Sources like MOUSE_RELATIVE could send ACTION_MOVE events without a prior DOWN event. Verifying such streams is tricky, so let's simply skip such events for now. Also in this CL, add some verifications to the number of pointers inside the event. Bug: 211379801 Test: enable event verification and run native tests Test: atest inputflinger_tests libinput_tests Change-Id: I3703ba57af7ede77712b91b7429ac46c0624a616
-
- Sep 25, 2023
-
-
Dominik Laskowski authored
Change-Id: I3a0c6b46197debe5985d386b56bb1178e24d85f9
-
- Sep 23, 2023
-
-
Ady Abraham authored
Bug: 300701739 Test: presubmit Change-Id: I235275b5d299efea779851434c392ca4e07ca4fd
-
- Sep 15, 2023
-
-
Elliott Hughes authored
Current wrong formatting: https://developer.android.com/ndk/reference/group/bitmap#androidbitmap_compress Bug: https://github.com/android/ndk/issues/1933 Test: treehugger Change-Id: I7174c728fbe589e1d80be82a5f0df56e054c9609
-
Elliott Hughes authored
These words are meant to be in the code _font_, not in their own separate code _blocks_. See https://developer.android.com/ndk/reference/group/thermal#athermal_getthermalheadroom for the current wrong formatting. Bug: https://github.com/android/ndk/issues/1933 Test: treehugger Change-Id: I2a30439bd58dd1435c4efb525a90e06631fbe6cf
-
Elliott Hughes authored
Also fix an 'a'/'an' typo. Bug: https://github.com/android/ndk/issues/1933 Test: treehugger Change-Id: Ifd505772dce79ebd68d928c67775030e2fd98d3f
-
- Sep 12, 2023
-
-
Harry Cutts authored
Adding a timer provider allows the Gestures library to perform some asynchronous tasks, including ones which improve tap-to-click detection. Bug: 297192727 Test: set the persist.device_config.aconfig_flags.input.com.android.input.flags.enable_gestures_library_timer_provider sysprop to true, restart, then make fast tap-to-click gestures (where the finger is contacting for fewer than 3 frames) on the touchpad, and check they're reported immediately Change-Id: Ib9b8dacc71c88b6fd47bdd747f90ef6a44b37cc4
-
- Sep 06, 2023
-
-
Prabir Pradhan authored
In the change with ID Ibee1e7dc5021296bdb5871dec59d8d4978fcf0c9, we introduced lambdas at the tracing sites so that we could conditionally execute the code to generate the tracing string only when tracing was enabled. However, it seems like the introduction of the lambdas, especially ones that capture everything by reference, have added a performance burden, causing ~5% increase in latency in the input pipeline. In this CL, we remove the lambdas from the tracing sites, and instead rely on the expression evaluation guarantees of the ternary to ensure that the expression to generate the trace message will only be evaluated when the condition is true. Bug: 297462790 Test: Will evaluate perf metric after submitting Change-Id: I69b37551c4b23256c64544e0ddf4b5b39a9403fb
-
- Aug 23, 2023
-
-
Siarhei Vishniakou authored
VelocityTracker may use different strategies, depending on the system flags. By default, the behaviour is like this: AXIS_X -> lsq2 AXIS_Y -> lsq2 AXIS_SCROLL -> impulse However, if we provide a specific strategy to VT, then things would change. The new map would look like this: AXIS_X -> provided strategy AXIS_Y -> provided strategy AXIS_SCROLL -> provided strategy This works fine if the user specifies "impulse" as the desired strategy, because impulse supports all of the axes. However, lsq2 only works in non-differential mode. The combination of "AXIS_SCROLL -> lsq2" is not allowed. To fix this, we only allow the specified strategy to affect non-differential axes. This is fine, because currently, impulse is the only strategy that can work in the differential mode. To reproduce the issue: 1. Run `atest VelocityTrackerTest`. Test should pass, because the default strategy is being used. 2. Connect the device to internet 3. Reboot the device 4. Run `atest VelocityTrackerTest` again. Test should fail because the device would pick up an "lsq2" strategy value and then try to run the axis_scroll tests with it. Bug: 295290374 Test: atest VelocityTrackerTest Change-Id: I702a2a3e58db3ce2e0ff0c33122839a527eebab2 Merged-In: I702a2a3e58db3ce2e0ff0c33122839a527eebab2 (cherry picked from commit 8a2e589e)
-
- Aug 22, 2023
-
-
Prabir Pradhan authored
Previously, we traced using ATRACE_NAME inside an if condition after checking if atrace was enabled. This was so that we could avoid the addtional overhead of formatting the trace string when there's no ongoing trace. Since ATRACE_NAME is expected to be scoped trace of the call, doing it inside an if condition means the scope of the trace ends immediately once we leave the inner scope of the conditional. This essentially makes all of our scoped traces point traces. We get around this by adding a new helper macro ATRACE_NAME_IF that takes a lambda that formats the message. This way, we can avoid the formatting overhead and ensure the entire scope of the method is traced. Bug: 210460522 Test: manual: take a trace with Perfetto Change-Id: Ibee1e7dc5021296bdb5871dec59d8d4978fcf0c9
-
- Aug 21, 2023
-
-
Cody Heiner authored
Fills out the implementation and tests for MotionPredictorMetricsManager. (main cherry pick: ag/24451072) Test: atest frameworks/native/libs/input/tests/MotionPredictorMetricsManager_test.cpp Test: Manual testing on-device, computed metric values seem reasonable. Bug: 268245099 Merged-In: Iec18415de9c3070f2b285c5c82f5a5e0ceaaf471 Change-Id: I0def0dae626adbbe33e1ed90c08b2cae867cde01
-
Cody Heiner authored
Fills out the implementation and tests for MotionPredictorMetricsManager. (Cherry pick of ag/23861881 from udc-qpr-dev) Test: atest frameworks/native/libs/input/tests/MotionPredictorMetricsManager_test.cpp Test: Manual testing on-device, computed metric values seem reasonable. Bug: 268245099 Change-Id: Iec18415de9c3070f2b285c5c82f5a5e0ceaaf471
-
- Aug 14, 2023
-
-
Siarhei Vishniakou authored
To ensure Java is in sync with native, move these consts to IInputConstants.aidl. Test: none Bug: 295290374 Change-Id: I616f4e969e5b7ec72263db62f225f85786f5e923
-
Siarhei Vishniakou authored
VelocityTracker may use different strategies, depending on the system flags. By default, the behaviour is like this: AXIS_X -> lsq2 AXIS_Y -> lsq2 AXIS_SCROLL -> impulse However, if we provide a specific strategy to VT, then things would change. The new map would look like this: AXIS_X -> provided strategy AXIS_Y -> provided strategy AXIS_SCROLL -> provided strategy This works fine if the user specifies "impulse" as the desired strategy, because impulse supports all of the axes. However, lsq2 only works in non-differential mode. The combination of "AXIS_SCROLL -> lsq2" is not allowed. To fix this, we only allow the specified strategy to affect non-differential axes. This is fine, because currently, impulse is the only strategy that can work in the differential mode. To reproduce the issue: 1. Run `atest VelocityTrackerTest`. Test should pass, because the default strategy is being used. 2. Connect the device to internet 3. Reboot the device 4. Run `atest VelocityTrackerTest` again. Test should fail because the device would pick up an "lsq2" strategy value and then try to run the axis_scroll tests with it. Bug: 295290374 Test: atest VelocityTrackerTest Change-Id: I702a2a3e58db3ce2e0ff0c33122839a527eebab2
-