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

Commit 7165f50d authored by Daniel Norman's avatar Daniel Norman Committed by Automerger Merge Worker
Browse files

Merge "Fix window token leak on multi-display targets" into main am: a08c10a5

parents a9d60deb a08c10a5
Loading
Loading
Loading
Loading
+14 −2
Original line number Original line Diff line number Diff line
@@ -1616,7 +1616,13 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ
     * lock because this calls out to WindowManagerService.
     * lock because this calls out to WindowManagerService.
     */
     */
    void addWindowTokensForAllDisplays() {
    void addWindowTokensForAllDisplays() {
        final Display[] displays = mDisplayManager.getDisplays();
        Display[] displays = {};
        final long identity = Binder.clearCallingIdentity();
        try {
            displays = mDisplayManager.getDisplays();
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        for (int i = 0; i < displays.length; i++) {
        for (int i = 0; i < displays.length; i++) {
            final int displayId = displays[i].getDisplayId();
            final int displayId = displays[i].getDisplayId();
            addWindowTokenForDisplay(displayId);
            addWindowTokenForDisplay(displayId);
@@ -1652,7 +1658,13 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ
    }
    }


    public void onRemoved() {
    public void onRemoved() {
        final Display[] displays = mDisplayManager.getDisplays();
        Display[] displays = {};
        final long identity = Binder.clearCallingIdentity();
        try {
            displays = mDisplayManager.getDisplays();
        } finally {
            Binder.restoreCallingIdentity(identity);
        }
        for (int i = 0; i < displays.length; i++) {
        for (int i = 0; i < displays.length; i++) {
            final int displayId = displays[i].getDisplayId();
            final int displayId = displays[i].getDisplayId();
            onDisplayRemoved(displayId);
            onDisplayRemoved(displayId);