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

Commit 3cc11b3f authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix unexpected starting window removal timeout when in fixed-rotation"...

Merge "Fix unexpected starting window removal timeout when in fixed-rotation" into udc-dev am: 228c3d30 am: 25dcac5e

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23087237



Change-Id: I7c9201c790cf5f6d566c07dece2ad0c68b5ad9f5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7a784b74 25dcac5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1884,7 +1884,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp

    /** Returns {@code true} if the IME is possible to show on the launching activity. */
    boolean mayImeShowOnLaunchingActivity(@NonNull ActivityRecord r) {
        final WindowState win = r.findMainWindow();
        final WindowState win = r.findMainWindow(false /* exclude starting window */);
        if (win == null) {
            return false;
        }
+22 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION;
import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_UNRESTRICTED_GESTURE_EXCLUSION;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
@@ -2827,6 +2829,26 @@ public class DisplayContentTests extends WindowTestsBase {
                mDisplayContent.getKeepClearAreas());
    }

    @Test
    public void testMayImeShowOnLaunchingActivity_negativeWhenSoftInputModeHidden() {
        final ActivityRecord app = createActivityRecord(mDisplayContent);
        final WindowState appWin = createWindow(null, TYPE_BASE_APPLICATION, app, "appWin");
        createWindow(null, TYPE_APPLICATION_STARTING, app, "startingWin");
        app.mStartingData = mock(SnapshotStartingData.class);
        // Assume the app has shown IME before and warm launching with a snapshot window.
        doReturn(true).when(app.mStartingData).hasImeSurface();

        // Expect true when this IME focusable activity will show IME during launching.
        assertTrue(WindowManager.LayoutParams.mayUseInputMethod(appWin.mAttrs.flags));
        assertTrue(mDisplayContent.mayImeShowOnLaunchingActivity(app));

        // Not expect IME will be shown during launching if the app's softInputMode is hidden.
        appWin.mAttrs.softInputMode = SOFT_INPUT_STATE_ALWAYS_HIDDEN;
        assertFalse(mDisplayContent.mayImeShowOnLaunchingActivity(app));
        appWin.mAttrs.softInputMode = SOFT_INPUT_STATE_HIDDEN;
        assertFalse(mDisplayContent.mayImeShowOnLaunchingActivity(app));
    }

    private void removeRootTaskTests(Runnable runnable) {
        final TaskDisplayArea taskDisplayArea = mRootWindowContainer.getDefaultTaskDisplayArea();
        final Task rootTask1 = taskDisplayArea.createRootTask(WINDOWING_MODE_FULLSCREEN,