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
Loading
Please register or sign in to comment