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

Commit 66b1a264 authored by Jacky Kao's avatar Jacky Kao Committed by Android (Google) Code Review
Browse files

Merge "Fix no correct window observer of an embedded display"

parents 970fbf37 df7c2e4d
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -132,18 +132,21 @@ final class AccessibilityController {
                return false;
            }

            if (mWindowsForAccessibilityObserver.get(displayId) != null) {
            final Display display = dc.getDisplay();
            if (display.getType() == Display.TYPE_VIRTUAL && dc.getParentWindow() != null) {
                    // The window observer of this embedded display had been set from
                    // window manager after setting its parent window.
                // If this display is an embedded one, its window observer should have been set from
                // window manager after setting its parent window. But if its window observer is
                // empty, that means this mapping didn't be set, and needs to do this again.
                // This happened when accessibility window observer is disabled and enabled again.
                if (mWindowsForAccessibilityObserver.get(displayId) == null) {
                    handleWindowObserverOfEmbeddedDisplayLocked(displayId, dc.getParentWindow());
                }
                return false;
                } else {
            } else if (mWindowsForAccessibilityObserver.get(displayId) != null) {
                throw new IllegalStateException(
                        "Windows for accessibility callback of display "
                                + displayId + " already set!");
            }
            }
            mWindowsForAccessibilityObserver.put(displayId,
                    new WindowsForAccessibilityObserver(mService, displayId, callback));
        } else {