Ensure to inject events outside of the insets region for right margin
The display's x-coordinates for input are in the range:
[0, displayWidth).
Injecting input at the point (displayWidth, 0) is technically outside
of the display. After accounting for insets, the x-coordinate range for
the display is:
[leftInset, displayWidth - rightInset).
An input event injected at x = (displayWidth - rightInset) would be
outside of this range, and would be within the right insets region.
To account for this, use a one pixel buffer when calculating the
right gesture start margin.
A similar one pixel buffer is already used for the bottom margin
calculation.
Test: atest NexusLauncherTests:
com.android.quickstep.TaplTestsQuickstep
Bug: 208849306
Change-Id: I9d5a6429cd55fdfcbf2c849e27e3d3a0a7faaa47
diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
index 631e8f1..ceb9cc8 100644
--- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
+++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java
@@ -1276,7 +1276,7 @@
}
int getRightGestureStartOnScreen() {
- return getRealDisplaySize().x - getWindowInsets().right;
+ return getRealDisplaySize().x - getWindowInsets().right - 1;
}
void clickLauncherObject(UiObject2 object) {