Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 46211fbf authored by Prabir Pradhan's avatar Prabir Pradhan
Browse files

TouchInputMapper: Use ui::Transform to calulate MotionRanges

The MotionRange API can be queried by apps from the InputDevice class.
The API is unaware of the window context from which the app is calling
it, which means we cannot return values in the window's coordinate
space. Therefore we use the rotated display space (a.k.a. logical
display space) for the MotionRange API.

After this CL, the MotionRanges are now in the same coordinate space as
MotionEvent#getRawX and MotionEvent#getRawY, which should make them more
useful to apps. Previously, they were always in the display space,
which meant they were not updated when the display rotated.

In this CL, the x and y axis range is calcualted from the input device's
raw range. This means the range is finally accurate to what the device
can actually produce, rather than the range being completly determined
from the display size.

Bug: 257118693
Test: atest inputflinger_tests
Change-Id: Ib336707c6401a366c759548ed7784fc430176c6a
parent 33e3baa3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment