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

Commit ae6a27ee authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Sync only if display focus changed" into main

parents 901996d0 55ea9537
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -3360,16 +3360,20 @@ public class WindowManagerService extends IWindowManager.Stub

    @Override
    public void moveDisplayToTopIfAllowed(int displayId) {
        moveDisplayToTopInternal(displayId);
        final boolean moved = moveDisplayToTopInternal(displayId);
        if (moved) {
            syncInputTransactions(true /* waitForAnimations */);
        }
    }

    /**
     * Moves the given display to the top. If it cannot be moved to the top this method does
     * nothing (e.g. if the display has the flag FLAG_STEAL_TOP_FOCUS_DISABLED set).
     * @param displayId The display to move to the top.
     *
     * @return whether the move actually occurred.
     */
    void moveDisplayToTopInternal(int displayId) {
    boolean moveDisplayToTopInternal(int displayId) {
        synchronized (mGlobalLock) {
            final DisplayContent displayContent = mRoot.getDisplayContent(displayId);
            if (displayContent != null && mRoot.getTopChild() != displayContent) {
@@ -3379,7 +3383,7 @@ public class WindowManagerService extends IWindowManager.Stub
                            "Not moving display (displayId=%d) to top. Top focused displayId=%d. "
                                    + "Reason: FLAG_STEAL_TOP_FOCUS_DISABLED",
                            displayId, mRoot.getTopFocusedDisplayContent().getDisplayId());
                    return;
                    return false;
                }

                Transition transition = null;
@@ -3405,6 +3409,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    transition.setReady(displayContent, true /* ready */);
                }
            }
            return true;
        }
    }