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

Commit 910a229e authored by Riddle Hsu's avatar Riddle Hsu Committed by android-build-merger
Browse files

Merge "Don't adjust task bounds for IME during unminimizing docked stack" into...

Merge "Don't adjust task bounds for IME during unminimizing docked stack" into qt-dev am: 93009b77 am: 279f9865
am: 3683a62b

Change-Id: I1df7823bfd82fa05f0ca0e705330f2607a001a5e
parents cb7d6cfc 3683a62b
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2636,17 +2636,25 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        final WindowState imeWin = mInputMethodWindow;
        final boolean imeVisible = imeWin != null && imeWin.isVisibleLw() && imeWin.isDisplayedLw()
                && !mDividerControllerLocked.isImeHideRequested();
        final boolean dockVisible = isStackVisible(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
        final TaskStack dockedStack = getSplitScreenPrimaryStack();
        final boolean dockVisible = dockedStack != null;
        final Task topDockedTask = dockVisible ? dockedStack.getTopChild() : null;
        final TaskStack imeTargetStack = mWmService.getImeFocusStackLocked();
        final int imeDockSide = (dockVisible && imeTargetStack != null) ?
                imeTargetStack.getDockSide() : DOCKED_INVALID;
        final boolean imeOnTop = (imeDockSide == DOCKED_TOP);
        final boolean imeOnBottom = (imeDockSide == DOCKED_BOTTOM);
        final boolean dockMinimized = mDividerControllerLocked.isMinimizedDock();
        final int imeHeight = mDisplayFrames.getInputMethodWindowVisibleHeight();
        final boolean imeHeightChanged = imeVisible &&
                imeHeight != mDividerControllerLocked.getImeHeightAdjustedFor();

        // This includes a case where the docked stack is unminimizing and IME is visible for the
        // bottom side stack. The condition prevents adjusting the override task bounds for IME to
        // the minimized docked stack bounds.
        final boolean dockMinimized = mDividerControllerLocked.isMinimizedDock()
                || (topDockedTask != null && imeOnBottom && !dockedStack.isAdjustedForIme()
                        && dockedStack.getBounds().height() < topDockedTask.getBounds().height());

        // The divider could be adjusted for IME position, or be thinner than usual,
        // or both. There are three possible cases:
        // - If IME is visible, and focus is on top, divider is not moved for IME but thinner.