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

Commit 894e1cee authored by Taran Singh's avatar Taran Singh Committed by Xin Li
Browse files

Fix NavigationBarColorTest

Manually partially revert I4910c2a06cc67b0470477b245fc1de54b75f10f9 so
that we don't use a window that's animating away as control target.

Fix: 161659326
Bug: 153145997
Test: atest NavigationBarColorTest#testSetNavigationBarColor

Bug: 167499521
Fixed: 167499521
Exempt-From-Owner-Approval:‌ ‌Cherry-pick of downstream change
Merged-In: I68db516c91da69e0f4dcbdfab6d6a757c4cdc75b
Change-Id: I68db516c91da69e0f4dcbdfab6d6a757c4cdc75b
(cherry picked from commit 588fa46c)
parent b1f16b63
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -3606,18 +3606,6 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
                                == mRemoteInsetsControlTarget)) {
            return mRemoteInsetsControlTarget;
        } else {
            // Now, a special case -- if the last target's window is in the process of exiting, but
            // not removed, keep on the last target to avoid IME flicker.
            final WindowState cur = InsetsControlTarget.asWindowOrNull(mInputMethodControlTarget);
            if (cur != null && !cur.mRemoved && cur.isDisplayedLw() && cur.isClosing()
                    && !cur.isActivityTypeHome()) {
                if (DEBUG_INPUT_METHOD) {
                    Slog.v(TAG_WM, "Not changing control while current window"
                            + " is closing and not removed");
                }
                return cur;
            }
            // Otherwise, we just use the ime target as received from IME.
            return mInputMethodInputTarget;
        }
    }
+0 −3
Original line number Diff line number Diff line
@@ -2173,9 +2173,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (dc.mInputMethodInputTarget == this) {
            dc.setInputMethodInputTarget(null);
        }
        if (dc.mInputMethodControlTarget == this) {
            dc.updateImeControlTarget();
        }

        final int type = mAttrs.type;
        if (WindowManagerService.excludeWindowTypeFromTapOutTask(type)) {
+0 −20
Original line number Diff line number Diff line
@@ -913,26 +913,6 @@ public class DisplayContentTests extends WindowTestsBase {
        assertEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
    }

    @Test
    public void testComputeImeControlTarget_exitingApp() throws Exception {
        final DisplayContent dc = createNewDisplay();

        WindowState exitingWin = createWindow(null, TYPE_BASE_APPLICATION, "exiting app");
        makeWindowVisible(exitingWin);
        exitingWin.mWinAnimator.mDrawState = WindowStateAnimator.HAS_DRAWN;
        exitingWin.mAnimatingExit = true;

        dc.mInputMethodControlTarget = exitingWin;
        dc.mInputMethodTarget = dc.mInputMethodInputTarget =
                createWindow(null, TYPE_BASE_APPLICATION, "starting app");

        assertEquals(exitingWin, dc.computeImeControlTarget());

        exitingWin.removeImmediately();

        assertEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
    }

    @Test
    public void testComputeImeControlTarget_splitscreen() throws Exception {
        final DisplayContent dc = createNewDisplay();