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

Commit 462c5b8d authored by Daniel Norman's avatar Daniel Norman
Browse files

Long click: use the node's window's bounds instead of asking WMS.

The WindowManagerService#getWindowFrame method returns an empty rect
when the requested window has no window state. As evident by the
checks in wm/AccessibilityWindowsPopulator not all windows have a
WindowState known by WMS.

This change grabs the node's window's bounds by getting the node's
A11yWindowInfo then checking bounds in screen. This always returns a
non-empty rect because it uses bounds data from SurfaceFlinger's
onWindowInfosChanged callback.

Bug: 317166487
Test: atest TouchInteractionControllerTest
Test: Launch an app in aspect ratio compat mode. Use TalkBack swipe
      gestures to focus on the aspect ratio button. Double-tap and hold
      anywhere on the screen. Observe that the button is long-clicked.
Change-Id: I09ea7bfc002c9878304d273bfc7f87d3e6de0d0a
parent 4487bc7f
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -90,6 +90,16 @@ flag {
    bug: "300002193"
    bug: "300002193"
}
}


flag {
    name: "focus_click_point_window_bounds_from_a11y_window_info"
    namespace: "accessibility"
    description: "Uses A11yWindowInfo bounds for focus click point bounds checking"
    bug: "317166487"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
flag {
    name: "fullscreen_fling_gesture"
    name: "fullscreen_fling_gesture"
    namespace: "accessibility"
    namespace: "accessibility"
+8 −1
Original line number Original line Diff line number Diff line
@@ -5234,7 +5234,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub


                //Clip to the window bounds.
                //Clip to the window bounds.
                Rect windowBounds = mTempRect1;
                Rect windowBounds = mTempRect1;
                if (Flags.focusClickPointWindowBoundsFromA11yWindowInfo()) {
                    AccessibilityWindowInfo window = focus.getWindow();
                    if (window != null) {
                        window.getBoundsInScreen(windowBounds);
                    }
                } else {
                    getWindowBounds(focus.getWindowId(), windowBounds);
                    getWindowBounds(focus.getWindowId(), windowBounds);
                }
                if (!boundsInScreenBeforeMagnification.intersect(windowBounds)) {
                if (!boundsInScreenBeforeMagnification.intersect(windowBounds)) {
                    return false;
                    return false;
                }
                }