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

Commit a4851c83 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Clean up doNotSkipImeByTargetVisibility flag" into main

parents f0a3166c 220d1bda
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -18,16 +18,6 @@ flag {
    }
}

flag {
    name: "do_not_skip_ime_by_target_visibility"
    namespace: "windowing_frontend"
    description: "Avoid window traversal missing IME"
    bug: "339375944"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "apply_lifecycle_on_pip_change"
    namespace: "windowing_frontend"
+0 −11
Original line number Diff line number Diff line
@@ -4666,17 +4666,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
        if (!isImeLayeringTarget()) {
            return false;
        }
        if (!com.android.window.flags.Flags.doNotSkipImeByTargetVisibility()) {
            // Note that we don't process IME window if the IME input target is not on the screen.
            // In case some unexpected IME visibility cases happen like starting the remote
            // animation on the keyguard but seeing the IME window that originally on the app
            // which behinds the keyguard.
            final WindowState imeInputTarget = getImeInputTarget();
            if (imeInputTarget != null
                    && !(imeInputTarget.isDrawn() || imeInputTarget.isVisibleRequested())) {
                return false;
            }
        }
        return mDisplayContent.forAllImeWindows(callback, traverseTopToBottom);
    }

+0 −46
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.when;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;

import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.fail;

import static org.junit.Assert.assertEquals;
@@ -728,51 +727,6 @@ public class RemoteAnimationControllerTest extends WindowTestsBase {
        }
    }

    @android.platform.test.annotations.RequiresFlagsDisabled(
            com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY)
    @SetupWindows(addWindows = W_INPUT_METHOD)
    @Test
    public void testLaunchRemoteAnimationWithoutImeBehind() {
        final WindowState win1 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin1");
        final WindowState win2 = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin2");

        // Simulating win1 has shown IME and being IME layering/input target
        mDisplayContent.setImeLayeringTarget(win1);
        mDisplayContent.setImeInputTarget(win1);
        mImeWindow.mWinAnimator.hide(mDisplayContent.getPendingTransaction(), "test");
        spyOn(mDisplayContent);
        mImeWindow.mWinAnimator.mSurfaceControl = mock(SurfaceControl.class);
        makeWindowVisibleAndDrawn(mImeWindow);
        assertTrue(mImeWindow.isOnScreen());
        assertFalse(mImeWindow.isParentWindowHidden());

        try {
            // Simulating now win1 is being covered by the lockscreen which has no surface,
            // and then launching an activity win2 with the remote animation
            win1.mHasSurface = false;
            win1.mActivityRecord.setVisibility(false);
            mDisplayContent.mOpeningApps.add(win2.mActivityRecord);
            final AnimationAdapter adapter = mController.createRemoteAnimationRecord(
                    win2.mActivityRecord, new Point(50, 100), null,
                    new Rect(50, 100, 150, 150), null, false).mAdapter;
            adapter.startAnimation(mMockLeash, mMockTransaction, ANIMATION_TYPE_APP_TRANSITION,
                    mFinishedCallback);

            mDisplayContent.applySurfaceChangesTransaction();
            mController.goodToGo(TRANSIT_OLD_TASK_OPEN);
            mWm.mAnimator.executeAfterPrepareSurfacesRunnables();

            verify(mMockRunner).onAnimationStart(eq(TRANSIT_OLD_TASK_OPEN),
                    any(), any(), any(), any());
            // Verify the IME window won't apply surface change transaction with forAllImeWindows
            verify(mDisplayContent, never()).forAllImeWindows(any(), eq(true));
        } catch (Exception e) {
            // no-op
        } finally {
            mDisplayContent.mOpeningApps.clear();
        }
    }

    private AnimationAdapter setupForNonAppTargetNavBar(int transit, boolean shouldAttachNavBar) {
        final WindowState win = createWindow(null /* parent */, TYPE_BASE_APPLICATION, "testWin");
        mDisplayContent.mOpeningApps.add(win.mActivityRecord);
+0 −2
Original line number Diff line number Diff line
@@ -62,8 +62,6 @@ public class WindowContainerTraversalTests extends WindowTestsBase {
        verify(c).accept(eq(mImeWindow));
    }

    @android.platform.test.annotations.RequiresFlagsEnabled(
            com.android.window.flags.Flags.FLAG_DO_NOT_SKIP_IME_BY_TARGET_VISIBILITY)
    @SetupWindows(addWindows = { W_ACTIVITY, W_INPUT_METHOD })
    @Test
    public void testTraverseImeRegardlessOfImeTarget() {