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

Commit d73e94b5 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with jumping PIP when IME shows.

- Removing extraneous content frame adjustment for the visible IME in
  WindowState, which conflicts with new IME adjustment logic in the
  PinnedStackController.

Bug: 36820637
Test: Launch YT PIP, bring up IME
Test: go/wm-smoke
Change-Id: I6d5e647aa0cd75ff48c1efff50cc42093dcb1129
parent 4e73123c
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package com.android.server.wm;

import static android.app.ActivityManager.ENABLE_TASK_SNAPSHOTS;
import static android.app.ActivityManager.StackId;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.INVALID_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.app.ActivityManager.isLowRamDeviceStatic;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
@@ -761,14 +763,17 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            final WindowState imeWin = mService.mInputMethodWindow;
            // IME is up and obscuring this window. Adjust the window position so it is visible.
            if (imeWin != null && imeWin.isVisibleNow() && mService.mInputMethodTarget == this) {
                    if (windowsAreFloating && mContainingFrame.bottom > contentFrame.bottom) {
                final int stackId = getStackId();
                if (stackId == FREEFORM_WORKSPACE_STACK_ID
                        && mContainingFrame.bottom > contentFrame.bottom) {
                    // In freeform we want to move the top up directly.
                    // TODO: Investigate why this is contentFrame not parentFrame.
                    mContainingFrame.top -= mContainingFrame.bottom - contentFrame.bottom;
                    } else if (mContainingFrame.bottom > parentFrame.bottom) {
                        // But in docked we want to behave like fullscreen
                        // and behave as if the task were given smaller bounds
                        // for the purposes of layout.
                } else if (stackId != PINNED_STACK_ID
                        && mContainingFrame.bottom > parentFrame.bottom) {
                    // But in docked we want to behave like fullscreen and behave as if the task
                    // were given smaller bounds for the purposes of layout. Skip adjustments for
                    // the pinned stack, they are handled separately in the PinnedStackController.
                    mContainingFrame.bottom = parentFrame.bottom;
                }
            }