summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2022-05-02MotionEvent: Add backwards compatible initialize() functionLuK1337
After 0957669 changed MotionEvent::initialize() function signature, libwfdnative.so compiled for Android 12 fails to load. Change-Id: I8ad721adc0f00610836df62826d74d7da6764a39
2022-03-12Merge SP2A.220305.013Haamed Gheibi
Bug: 220074017 Change-Id: Ic33b5a6c518f7aa587e6c7cf0bfd6df4c795782b
2022-01-06Fix KeyCharacterMap overlays by reloading base overlay before applying ↵Philip Junker
another overlay. Add all fields to parcel (mLoadFileName, mLayoutOverlayApplied, mKeysByScanCode, mKeysByUsageCode). Add all fields to equality operator. Add tests to libinput_tests. Bug: 210090260 Test: Manually verified that layout changes correctly. Test: atest libinput_tests Change-Id: I1777b87e5c2ce8a0dbd42ad48748ea9e669c9139 (cherry picked from commit 90bc949048f2b91fa841cb8272381af8c301c055)
2021-12-20Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: I150f73a64f5a58f4f21aa695c55905cde2002078
2021-09-20Use sequence numbers to synchronize enabling Pointer Capture (1/2)Prabir Pradhan
InputReader only processes configuration change from its main thread. This means that if there is more than one Pointer Capture change request when the thread is busy or sleeping, it will only process the latest one. To ensure requests to enable Pointer Capture are synchronized with Dispatcher, we must use sequence numbers. Requests to enable Pointer Capture have a sequence number. Requests to disable Pointer Capture do not have a value. Bug: 195312888 Test: atest inputflinger_tests Test: manual with GeforceNow app, see bug. Merged-In: I6ae9c5498dc2f783b4c7211fa3665d42e29d2919 Change-Id: I6ae9c5498dc2f783b4c7211fa3665d42e29d2919
2021-09-06Use sequence numbers to synchronize enabling Pointer Capture (1/2)Prabir Pradhan
InputReader only processes configuration change from its main thread. This means that if there is more than one Pointer Capture change request when the thread is busy or sleeping, it will only process the latest one. To ensure requests to enable Pointer Capture are synchronized with Dispatcher, we must use sequence numbers. Requests to enable Pointer Capture have a sequence number. Requests to disable Pointer Capture do not have a value. Bug: 195312888 Test: atest inputflinger_tests Test: manual with GeforceNow app, see bug. Merged-In: I6ae9c5498dc2f783b4c7211fa3665d42e29d2919 Change-Id: I6ae9c5498dc2f783b4c7211fa3665d42e29d2919
2021-07-28Merge "Implement native PerformanceHint API" into sc-dev am: ae7324cddcTreeHugger Robot
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15326197 Change-Id: I7b8198b2b345fcc8f53bc603a719e7e4ce2e732b
2021-07-27Merge SP1A.210723.002Scott Lobdell
Change-Id: Idb25236ffd2e9e5244103979a8dcf1f7ead361f4
2021-07-21Implement native PerformanceHint APIBo Liu
Test: None Bug: 194204196 Change-Id: Ied0068d5069522befd14a7ca60d4fc39b47754d1
2021-07-14Plumb through display orientation separate from transformEvan Rosky
This is exclusively used for getRaw compatibility. The input transform can include window rotation and also, apparently, nested view rotations as it the events get mutated by ui-toolkit. Bug: 187686656 Test: cd frameworks/native/services/inputflinger && atest Change-Id: I2fd7a2b2acbe422d962d0646d41c60eb48160620
2021-07-14Merge SP1A.210709.002Haamed Gheibi
Change-Id: I1320e500a404b187169775b05d01095bf95a5818
2021-07-06Merge "Fix AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT for non-linux builds" ↵Diego Perez
into sc-dev am: 199ca20ef4 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15215271 Change-Id: I2e468854742a154f04b476e7a86bbd3343ef93dc
2021-07-06Fix AMOTION_EVENT_FLAG_IS_ACCESSIBILITY_EVENT for non-linux buildsDiego Perez
Remove semicolon as there are more enum elements. Bug: 192643379 Test: build for non-linux host Change-Id: Ia9e90f382d50ec52f0bad9c186031fd7ca29053a
2021-07-02Merge "Fix FLAG_IS_ACCESSIBILITY_EVENT for non-linux builds" into sc-dev am: ↵TreeHugger Robot
8f5d73a62a Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15175856 Change-Id: If03ba00992ed22420e1642d8f57d334376cdb7bf
2021-07-02Fix FLAG_IS_ACCESSIBILITY_EVENT for non-linux buildsDiego Perez
Remove semicolon as there are more enum elements. Bug: 192643379 Test: build for non-linux host Change-Id: Id1f622180d7c567d68cb9997317d14868453395b
2021-07-01Merge "Set FLAG_IS_ACCESSIBILITY_EVENT for events injected from ↵TreeHugger Robot
accessibility" into sc-dev am: 61cfde719b Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/15019654 Change-Id: I8dae253b5b0a54beb9696d3e6e2395be6b3a08e6
2021-06-30Set FLAG_IS_ACCESSIBILITY_EVENT for events injected from accessibilitySiarhei Vishniakou
If an input event was modified or injected by accessibility, set the appropriate flag. This helps applications distinguish the real hardware events from synthesized events. This also allows a11y services more flexibility in modifying the event streams coming from real hardware. Bug: 152399927 Bug: 175069843 Test: atest inputflinger_tests libinput_tests Change-Id: I805cba4c84582fa4cd4e0892ec00428d4b255ec6
2021-06-29Renamed and moved InputWindow and related fileschaviw
In preparation for the hierarchy listener interface, moved the InputWindow structs into libgui and have libinput dependant on libgui. Also renamed InputWindow to exclude Input since it will be used for more generic purposes. Test: Builds and flashes Bug: 188792659 Change-Id: I24262cbc14d409c00273de0024a672394a959e5f Merged-In: I24262cbc14d409c00273de0024a672394a959e5f
2021-06-24Merge SP1A.210618.002Scott Lobdell
Change-Id: Ia81b7f1e599800a0e6f62bd22498f867d8af32ee
2021-06-22Merge SP1A.210616.001Daniel Norman
Change-Id: I44a5ef0c7858857635265f5dc64a92ebd4b367c3
2021-06-16Avoid aidl usage on mac buildsSiarhei Vishniakou
We do not have libbinder on mac, so that rules out using aidl files for mac builds. To unbreak sdk_mac build targets, just use constant values directly on mac instead of trying to use IInputConstants. Bug: 152399927 Test: forrest Change-Id: I21697ec02dbb215edd89d2f6849c9147f490af99
2021-06-15Merge "Use the injected device id for events that are a11y trusted" into sc-devSiarhei Vishniakou
2021-06-14Merge SP1A.210604.001Scott Lobdell
Change-Id: I973aba6b24c5a18f50cc414db6437aaee94648d9
2021-06-08Return a copy of InputDeviceLightInfo instead of pointerSiarhei Vishniakou
Refactor InputReaderInterface to return a copy instead of pointer. This will ensure that we don't read from memory that's been freed. Also, refactor InputDevice api's to return a list of infos instead of having to query each individually. In all usages so far, there's no need to get a specific info by type. Bug: 190126442 Test: atest inputflinger_tests libinput_tests Change-Id: I7f993a14259bb802e2631663c1c8bb65cc9b6702
2021-06-04Use the injected device id for events that are a11y trustedSiarhei Vishniakou
If an event is a trusted event coming from accessibility, then allow the device id that's provided in the InputEvent to be used during injection. That means, events injected from accessibility will not always have device id == -1 (VIRTUAL_DEVICE_ID). The only exception are the events coming from external accessibility services (MotionEventInjector). For simplicity, we mark all of those events as untrusted. The flow is as follows: 1. When a11y is enabled, mInputFilterEnabled is set in InputDispatcher 2. Every event processed by dispatcher is first sent to InputFilter (=== accessibility). 3. The event from dispatcher sent to a11y has new flag, POLICY_FLAG_ACCESSIBILITY_TRUSTED. 4. By default, a11y passes all the policy flags back to inputdispatcher when it tries to reinject the event. 5. If a11y hits a path where untrusted events may be injected, it removes the FLAG_A11Y_TRUSTED from the policyFlags and continues the event handling. 6. Eventually, if a11y does not handle the input event, it sends it back to InputDispatcher using 'injectInputEvent(..., policyFlags)'. 7. InputDispatcher will look at the policyFlags of the injected event. If the new flag is present, InputDispatcher will create EventEntry with the provided device id. Otherwise, it will create EventEntry with the virtual device id (-1). 8. The events received by the apps will now have the original device id if a11y is enabled. Test: atest CtsInputTestCases:android.input.cts.GamepadWithAccessibilityTest Test: atest VerifyInputEventTest Bug: 175069843 Change-Id: Ie6399654f4434fdc8232e50373b6277d2f43a864
2021-05-24Merge "Change native lights to be consistent with java API." into sc-devChris Ye
2021-05-19Merge SP1A.210513.004Chris Gross
Change-Id: I7a7655d05c95f123294975b602580879e9d41708
2021-05-17Remove LatencyStatistics from dispatcherSiarhei Vishniakou
Currently, InputDispatcher is sending touch event information to westworld. We will now be transitioning to new atoms that have better coverage and statistical significance. In this intermediate CL, we remove the LatencyStatistics so that we can replace it with something better in the upcoming CLs. Bug: 167947340 Test: m libinput_tests inputflinger_tests Change-Id: I8fcb846321245011c3b6e6f896b99b8d9037a2a4
2021-05-16Change native lights to be consistent with java API.Chris Ye
Change native lights type to match java API light types. Bug: 181743615 Test: atest InputDeviceLightsManagerTest, atest LightsManagerTest, atest android.hardware.input.cts.tests Change-Id: I45fe0489fdc070bb4057f4bea061f0cbeacad0de
2021-05-13Merge SP1A.210510.001Brian Orr
Change-Id: Id17825b5c1611b4a2e80450a412b06082d854ae1
2021-05-13Merge "surface_control.h: Clarify callback documentation" into sc-devRob Carr
2021-05-12surface_control.h: Clarify callback documentationRobert Carr
In response to API council feedback we more clearly document the differences between the OnCommit and the OnComplete callbacks. Fixes: 187846583 Test: Doc changes only Change-Id: Ib0529d7d01de046ccae8f14c8bf8bb9a6110624d
2021-05-10Mark ASurfaceControl.setGeometry as deprecated.chaviw
With the introduction of setCrop, setPosition, setBufferTransform, and setScale, there's no need for setGeometry. The setGeometry API is confusing since it's handled in buffer space where all other APIs are handled in layer space. Test: N/A Bug: 185533162 Change-Id: Ief07dbf77f34e942d97ee5b0293b0a038bc1435b
2021-05-07Merge "Add NO_FOCUS_CHANGE flag to pointer gestures to disallow focus ↵TreeHugger Robot
changes" into sc-dev
2021-05-07Add NO_FOCUS_CHANGE flag to pointer gestures to disallow focus changesPrabir Pradhan
When using a multi-touch trackpad, it is the expected behavior in most operating systems that the user is allowed to perform gestures (like scroll, pinch, etc.) on an unfocused window without bringing it into focus. The previous behavior in Android was that any DOWN event on an unfocused window would bring the unfocused window into focus, including any pointer gesture. This change adds the NO_FOCUS_CHANGE flag to the MotionEvents generated by certain pointer gestures so that it does not change window focus. Gestures such as tap and tap drag are not affected. Bug: 173733166 Test: atest inputflinger_tests Test: manual: in multi-display scenario with freeform windows and a trackpad: open two freeform windows so that they overlap, perform gesture (scroll/pinch) on unfocused window, observe that the window is not focused; perform tap on unfocused window, observe that the window is focused. Change-Id: I74e52f8daa13d4e6c047bc23982ec56942c555f6
2021-05-07Merge "Store connections by token instead of by fd" into sc-devTreeHugger Robot
2021-05-07Store connections by token instead of by fdSiarhei Vishniakou
The connections are currently stored by fd. If a connection is removed via 'removeInputChannel', it is possible to re-create the same connection and have it keyed by the same fd. When this happens, a race condition may occur where a socket hangup on this fd would cause the removal of a newly registered connection. In this refactor, the connections are no longer stored by fd. The looper interface for adding fds has two versions: 1) the old one that we are currently using, which is marked as 'do not use' 2) the new one where a callback object is provided instead. In this CL, we switch to the new version of the callback. There is now also no need to store the inputchannels in a separate structure, because we can use the connections collection that's now keyed by token to find them. In a future refactor, we should switch to using 'unique_ptr' for the inputchannels. Most of the time when we are looking for an input channel, we are actually interested in finding the corresponding connection. If we switch Connection to shared_ptr, we can also look into switching LooperEventCallback to store a weak pointer to a connection instead of storing the connection token. This should speed up the handling of events, by avoiding a map lookup. Test: ./reinitinput.sh. Observe that it doesnt finish after this patch Test: atest inputflinger_tests Bug: 182478748 Change-Id: I601f765eebfadcaeff3661a10a10c4a4f0477389
2021-05-06Merge SP1A.210425.001Scott Lobdell
Change-Id: I219cc0af128876534b77a72c36979fa1fe08ba13
2021-05-06Merge "Add a hidden API to apply a transform the content of an event." into ↵Evan Rosky
sc-dev
2021-05-06Add a hidden API to apply a transform the content of an event.Evan Rosky
Unlike normal transform, this actually transforms each point directly. This is only useful for transforming injected events. Bug: 179274888 Test: atest libinput_tests:MotionEventTest Change-Id: Ifbd90649156d2dd00087bf5a97a372ccaea3d5f3
2021-05-06Merge "AImageDecoder: respond to API feedback" into sc-devLeon Scroggins
2021-05-05Merge "Update setFrameRate documentation" into sc-devTreeHugger Robot
2021-05-05Update setFrameRate documentationMarin Shalamanov
Add a link to how to listen to the change in frame rate. Bug: 186657402 Test: n/a Change-Id: Idb04f966906964a98a744d914e5aca2b1db4ee46
2021-05-03AImageDecoder: respond to API feedbackLeon Scroggins III
Bug: 186656488 Test: I4dc406e85709dda14af8b414e2da3d39bb07643b AImageDecoderFrameInfo_getDuration returns ANDROID_IMAGE_DECODER_BAD_PARAMETER on null info. Clarify that AImageDecoder_getFrameInfo will succeed if AImageDecoder_advanceFrame does, explaining why there are not more error possibilities. Explain more clearly what AImageDecoderFrameInfo_hasAlphaWithinBounds means. Change-Id: Ic02f1798904ad5ccc446fb4cd76cbff451a4e450
2021-04-29Add enough information to compatibility-transform getRaw()Evan Rosky
Many apps are mis-using getRaw (assuming it means screen-coordinates). This means, for now, we have to do a compatibility transform on the API to prevent breaking said apps. Fortunately, since the input window transform includes rotation, the only extra information we need to calculate this compat-raw is the display size. This CL topic pipes the display size around so that it makes into the MotionEvent and can be used to calculate getRaw() Bug: 179274888 Test: atest inputflinger_tests:InputDispatcherTest Change-Id: Iff893643312e8ec9f38eeb96d76a41fdb3a28350
2021-04-27Merge "AImageDecoder: only support animation for F16 and 8888 (header)" into ↵Leon Scroggins
sc-dev
2021-04-27Merge "Update docs for setFrameRate" into sc-devMarin Shalamanov
2021-04-26AImageDecoder: only support animation for F16 and 8888 (header)Leon Scroggins III
Bug: 180594747 Test: I51dedd94aa8ff5d6846cada96861ffca30d509d7 In particular, a client might expect that ANDROID_BITMAP_FORMAT_RGB_565 is supported. (ANDROID_BITMAP_FORMAT_RGBA_4444 is not supported at all, and ANDROID_BITMAP_FORMAT_NONE is an invalid request. ANDROID_BITMAP_FORMAT_A_8 is only supported for PNG and JPEG, and AImageDecoder does not support multiframe images in those formats anyway.) However, 565 requires that the image be opaque. Even if the first frame is opaque, it is possible that a later frame is not. Moreover, the frame data in a later frame may include transparent pixels, even if the resulting frame is opaque after blending with the frame buffer. In that case, libwebp and libgifcodec decode the frame data directly to 565, so the fact that there were transparent pixels has been lost, and there is no way to properly blend with the prior frame. For clarity, specify the formats supported, rather than the ones not supported. Change-Id: I03818703dc79942be4e574db31c6e2927ab571ed
2021-04-26Update docs for setFrameRateMarin Shalamanov
Explicitly state that when fps=0 the other two parameters of setFrameRate are ignored. Bug: 161776961 Test: n/a Change-Id: Ife8c462c3832e583599126708211f4cc79d431ae
2021-04-22Merge SP1A.210412.001Scott Lobdell
Change-Id: Ib26d1fa9123d1a0f1c232039dd9e6b96224b87c0