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

Commit 49851f02 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Avoid calling syncInputTransactions within wm lock" into main

parents 2e2b8245 bf9de65b
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -9057,6 +9057,7 @@ public class WindowManagerService extends IWindowManager.Stub

        @Override
        public boolean moveFocusToAdjacentEmbeddedActivityIfNeeded() {
            boolean focusMoved = false;
            synchronized (mGlobalLock) {
                final WindowState focusedWindow = getFocusedWindow();
                if (focusedWindow == null) {
@@ -9065,12 +9066,14 @@ public class WindowManagerService extends IWindowManager.Stub

                if (moveFocusToAdjacentEmbeddedWindow(focusedWindow)) {
                    // Sync the input transactions to ensure the input focus updates as well.
                    syncInputTransactions(false);
                    return true;
                    focusMoved = true;
                }
            }

                return false;
            if (focusMoved) {
                syncInputTransactions(false);
            }
            return focusMoved;
        }

        @Override
@@ -9767,7 +9770,7 @@ public class WindowManagerService extends IWindowManager.Stub
     */
    boolean moveFocusToAdjacentEmbeddedWindow(@NonNull WindowState focusedWindow) {
        final ActivityRecord activity = focusedWindow.getActivityRecord();
        if (activity == null) {
        if (activity == null || !activity.isVisible()) {
            return false;
        }

+2 −0
Original line number Diff line number Diff line
@@ -1172,7 +1172,9 @@ public class TaskFragmentTest extends WindowTestsBase {
        final ActivityRecord appLeftBottom = taskFragmentLeft.getBottomMostActivity();
        final ActivityRecord appRightTop = taskFragmentRight.getTopMostActivity();
        appLeftTop.setVisibleRequested(true);
        appLeftTop.setVisible(true);
        appRightTop.setVisibleRequested(true);
        appRightTop.setVisible(true);
        final WindowState winLeftTop = createAppWindow(appLeftTop, "winLeftTop");
        final WindowState winLeftBottom = createAppWindow(appLeftBottom, "winLeftBottom");
        final WindowState winRightTop = createAppWindow(appRightTop, "winRightTop");