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

Commit 925e822d authored by RyanlwLin's avatar RyanlwLin Committed by Ryan Lin
Browse files

Update Window List when the windowToken is moved

When a window is moved from display A to display B. We don't have any callbacks
to update window list of A and B. We update window list when the displaycont of
windowtoken is changed.

Bug: 140277818
Test: AccessibilityEndToEndTest
Change-Id: I3f9cc34ec3f24178df33bcc632e6af33b6dc3e7c
parent b3bd7b19
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -255,15 +255,21 @@ final class AccessibilityController {
        }
    }

    public void onSomeWindowResizedOrMovedLocked(int displayId) {
    /**
     * Called when the location or the size of the window is changed. Moving the window to
     * another display is also taken into consideration.
     * @param displayIds the display ids of displays when the situation happens.
     */
    public void onSomeWindowResizedOrMovedLocked(int... displayIds) {
        // Not relevant for the display magnifier.

        for (int i = 0; i < displayIds.length; i++) {
            final WindowsForAccessibilityObserver windowsForA11yObserver =
                mWindowsForAccessibilityObserver.get(displayId);
                    mWindowsForAccessibilityObserver.get(displayIds[i]);
            if (windowsForA11yObserver != null) {
                windowsForA11yObserver.scheduleComputeChangedWindowsLocked();
            }
        }
    }

    /** NOTE: This has to be called within a surface transaction. */
    public void drawMagnifiedRegionBorderIfNeededLocked(int displayId) {
+6 −0
Original line number Diff line number Diff line
@@ -1062,6 +1062,12 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        }

        addWindowToken(token.token, token);

        if (mWmService.mAccessibilityController != null) {
            final int prevDisplayId = prevDc != null ? prevDc.getDisplayId() : INVALID_DISPLAY;
            mWmService.mAccessibilityController.onSomeWindowResizedOrMovedLocked(prevDisplayId,
                    getDisplayId());
        }
    }

    void removeAppToken(IBinder binder) {