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

Commit 9f6c5de8 authored by Ryan Lin's avatar Ryan Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix double-tap with non-accessibility focus behavior"

parents 768e1086 075dd343
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1322,7 +1322,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
     */
    public boolean accessibilityFocusOnlyInActiveWindow() {
        synchronized (mLock) {
            return mA11yWindowManager.isTrackingWindowsLocked();
            return mA11yWindowManager.accessibilityFocusOnlyInActiveWindowLocked();
        }
    }

+10 −12
Original line number Diff line number Diff line
@@ -1383,20 +1383,9 @@ public class AccessibilityWindowManager {
            // the touched window are delivered is fine.
            final int oldActiveWindow = mActiveWindowId;
            setActiveWindowLocked(mTopFocusedWindowId);

            // If there is no service that can operate with interactive windows
            // then we keep the old behavior where a window loses accessibility
            // focus if it is no longer active. This still changes the behavior
            // for services that do not operate with interactive windows and run
            // at the same time as the one(s) which does. In practice however,
            // there is only one service that uses accessibility focus and it
            // is typically the one that operates with interactive windows, So,
            // this is fine. Note that to allow a service to work across windows
            // we have to allow accessibility focus stay in any of them. Sigh...
            final boolean accessibilityFocusOnlyInActiveWindow = !isTrackingWindowsLocked();
            if (oldActiveWindow != mActiveWindowId
                    && mAccessibilityFocusedWindowId == oldActiveWindow
                    && accessibilityFocusOnlyInActiveWindow) {
                    && accessibilityFocusOnlyInActiveWindowLocked()) {
                clearAccessibilityFocusLocked(oldActiveWindow);
            }
        }
@@ -1617,6 +1606,15 @@ public class AccessibilityWindowManager {
        return displayList;
    }

    // If there is no service that can operate with interactive windows
    // then a window loses accessibility focus if it is no longer active.
    // This inspection happens when the user interaction is ended.
    // Note that to allow a service to work across windows,
    // we have to allow accessibility focus stay in any of them.
    boolean accessibilityFocusOnlyInActiveWindowLocked() {
        return !isTrackingWindowsLocked();
    }

    /**
     * Gets current input focused window token from window manager, and returns its windowId.
     *
+0 −1
Original line number Diff line number Diff line
@@ -98,7 +98,6 @@ public class TouchState {
            mLastReceivedEvent.recycle();
            mLastReceivedEvent = null;
        }
        mLastTouchedWindowId = -1;
        mReceivedPointerTracker.clear();
        mInjectedPointersDown = 0;
    }