InputDispatcher: Perform hit test in logical display space
Window Manager works in the logical display coordinate space.
When it specifies bounds for a window as (l, t, r, b), the range
of x in [l, r) and y in [t, b) are considered to be inside the
window. Points on the right and bottom edges should not be inside
the window, so we need to be careful about performing a hit test
when the display is rotated, since the "right" and "bottom"
of the window will be different in the display (un-rotated) space
compared to in the logical display in which WM determined the bounds.
To ensure we consider points on the edges correctly, perform hit tests
in dispatcher in the logical display space.
Bug: 257118693
Test: atest inputflinger_tests
Test: manual with tablet and stylus
Change-Id: Ic879c4c2cf81d317030690dff20b21ea7255425b
diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h
index 53ce5e8..2246d47 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.h
+++ b/services/inputflinger/dispatcher/InputDispatcher.h
@@ -374,6 +374,7 @@
int32_t displayId) const REQUIRES(mLock);
sp<android::gui::WindowInfoHandle> getWindowHandleLocked(
const sp<IBinder>& windowHandleToken) const REQUIRES(mLock);
+ ui::Transform getTransformLocked(int32_t displayId) const REQUIRES(mLock);
// Same function as above, but faster. Since displayId is provided, this avoids the need
// to loop through all displays.