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

Commit dc6aaed8 authored by Lucy Chang's avatar Lucy Chang Committed by Android (Google) Code Review
Browse files

Merge "Using windowId from A11yWindowInfo instead"

parents 829b71b0 12e1ea6a
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -941,10 +941,19 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            if (resolvedUserId != mCurrentUserId) {
                return null;
            }
            if (mA11yWindowManager.findA11yWindowInfoByIdLocked(windowId) == null) {
            final AccessibilityWindowInfo accessibilityWindowInfo = mA11yWindowManager
                    .findA11yWindowInfoByIdLocked(windowId);
            if (accessibilityWindowInfo == null) {
                return null;
            }
            return mA11yWindowManager.getWindowTokenForUserAndWindowIdLocked(userId, windowId);
            // We use AccessibilityWindowInfo#getId instead of windowId. When the windowId comes
            // from an embedded hierarchy, the system can't find correct window token because
            // embedded hierarchy doesn't have windowInfo. Calling
            // AccessibilityWindowManager#findA11yWindowInfoByIdLocked can look for its parent's
            // windowInfo, so it is safer to use AccessibilityWindowInfo#getId
            // to get window token to find real window.
            return mA11yWindowManager.getWindowTokenForUserAndWindowIdLocked(userId,
                    accessibilityWindowInfo.getId());
        }
    }