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

Commit c6814256 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Don't adjust task bounds for IME during unminimizing docked stack

In split-screen mode, when home is resizable and IME is showing for it,
and launcher doesn't hide IME before launching next task, the current
stack bounds (minimized bounds) may be used as adjusted bounds for task.

Moreover, if the adjusting of bounds for IME and the moving divider for
unminimizing act at the same time, the animation may look flickering.
So this CL add a condition to not adjust task bounds for IME until the
docked stack is unminimized visually.

Fix: 132451731
Test: 1. Launch an app to primary split screen.
      2. Press the search bar of launcher.
      3. Type a word on IME then click the search result.
      4. Check the primary split screen doesn't have black area.
         (wm.Task shouldn't keep the adjusted override bounds)

Change-Id: Ife087b2aa50f1d689803acd5dc54b153b0e8b24b
parent c3c30eef
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2632,17 +2632,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.