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

Commit 614c4b61 authored by Sally Yuen's avatar Sally Yuen Committed by Android (Google) Code Review
Browse files

Merge "Check proxy status when determining whether to track windows"

parents 72625a5a 941c4e2f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2527,7 +2527,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
            final Display display = displays.get(i);
            if (display != null) {
                if (observingWindows) {
                    mA11yWindowManager.startTrackingWindows(display.getDisplayId());
                    mA11yWindowManager.startTrackingWindows(display.getDisplayId(),
                            mProxyManager.isProxyed(display.getDisplayId()));
                } else {
                    mA11yWindowManager.stopTrackingWindows(display.getDisplayId());
                }
+4 −15
Original line number Diff line number Diff line
@@ -988,12 +988,15 @@ public class AccessibilityWindowManager {
     *
     * @param displayId The logical display id.
     */
    public void startTrackingWindows(int displayId) {
    public void startTrackingWindows(int displayId, boolean proxyed) {
        synchronized (mLock) {
            DisplayWindowsObserver observer = mDisplayWindowsObservers.get(displayId);
            if (observer == null) {
                observer = new DisplayWindowsObserver(displayId);
            }
            if (proxyed && !observer.mIsProxy) {
                observer.mIsProxy = true;
            }
            if (observer.isTrackingWindowsLocked()) {
                return;
            }
@@ -1018,20 +1021,6 @@ public class AccessibilityWindowManager {
        }
    }

    /**
     * Starts tracking a display as belonging to a proxy. Creates the window observer if necessary.
     * @param displayId
     */
    public void startTrackingDisplayProxy(int displayId) {
        startTrackingWindows(displayId);
        synchronized (mLock) {
            DisplayWindowsObserver observer = mDisplayWindowsObservers.get(displayId);
            if (observer != null) {
                observer.mIsProxy = true;
            }
        }
    }

    /**
     * Stops tracking a display as belonging to a proxy.
     * @param displayId
+0 −1
Original line number Diff line number Diff line
@@ -103,7 +103,6 @@ public class ProxyManager {
                };
        client.asBinder().linkToDeath(deathRecipient, 0);

        mA11yWindowManager.startTrackingDisplayProxy(displayId);
        // Notify apps that the service state has changed.
        // A11yManager#A11yServicesStateChangeListener
        synchronized (mLock) {
+1 −1
Original line number Diff line number Diff line
@@ -1019,7 +1019,7 @@ public class AccessibilityWindowManagerTest {
            windowInfosForDisplay.get(DEFAULT_FOCUSED_INDEX).focused = true;
        }
        // Turns on windows tracking, and update window info.
        mA11yWindowManager.startTrackingWindows(displayId);
        mA11yWindowManager.startTrackingWindows(displayId, false);
        // Puts window lists into array.
        mWindowInfos.put(displayId, windowInfosForDisplay);
        // Sets the default display is the top focused display and