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

Commit 0a176fa1 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Do not hide IME when waiting for drawn by toggling screen" into udc-qpr-dev am: 65a98f76

parents c1c05ff7 65a98f76
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -6524,14 +6524,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
        return (mDisplayInfo.flags & Display.FLAG_ROTATES_WITH_CONTENT) == 0;
    }

    /**
     * @return whether AOD is showing on this display
     */
    boolean isAodShowing() {
        return mRootWindowContainer.mTaskSupervisor
                .getKeyguardController().isAodShowing(mDisplayId);
    }

    /**
     * @return whether this display maintains its own focus and touch mode.
     */
+0 −12
Original line number Diff line number Diff line
@@ -1677,18 +1677,6 @@ public class DisplayPolicy {
    }

    private boolean shouldBeHiddenByKeyguard(WindowState win, WindowState imeTarget) {
        // If AOD is showing, the IME should be hidden. However, sometimes the AOD is considered
        // hidden because it's in the process of hiding, but it's still being shown on screen.
        // In that case, we want to continue hiding the IME until the windows have completed
        // drawing. This way, we know that the IME can be safely shown since the other windows are
        // now shown.
        final boolean hideIme = win.mIsImWindow
                && (mDisplayContent.isAodShowing()
                        || (mDisplayContent.isDefaultDisplay && !mWindowManagerDrawComplete));
        if (hideIme) {
            return true;
        }

        if (!mDisplayContent.isDefaultDisplay || !isKeyguardShowing()) {
            return false;
        }
+8 −6
Original line number Diff line number Diff line
@@ -242,26 +242,27 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
        displayInfo.copyFrom(mDisplayInfo);
        displayInfo.type = Display.TYPE_VIRTUAL;
        DisplayContent virtualDisplay = createNewDisplay(displayInfo);
        final KeyguardController keyguardController = mSupervisor.getKeyguardController();

        // Make sure we're starting out with 2 unlocked displays
        assertEquals(2, mRootWindowContainer.getChildCount());
        mRootWindowContainer.forAllDisplays(displayContent -> {
            assertFalse(displayContent.isKeyguardLocked());
            assertFalse(displayContent.isAodShowing());
            assertFalse(keyguardController.isAodShowing(displayContent.mDisplayId));
        });

        // Check that setLockScreenShown locks both displays
        mAtm.setLockScreenShown(true, true);
        mRootWindowContainer.forAllDisplays(displayContent -> {
            assertTrue(displayContent.isKeyguardLocked());
            assertTrue(displayContent.isAodShowing());
            assertTrue(keyguardController.isAodShowing(displayContent.mDisplayId));
        });

        // Check setLockScreenShown unlocking both displays
        mAtm.setLockScreenShown(false, false);
        mRootWindowContainer.forAllDisplays(displayContent -> {
            assertFalse(displayContent.isKeyguardLocked());
            assertFalse(displayContent.isAodShowing());
            assertFalse(keyguardController.isAodShowing(displayContent.mDisplayId));
        });
    }

@@ -275,25 +276,26 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
        displayInfo.displayGroupId = Display.DEFAULT_DISPLAY_GROUP + 1;
        displayInfo.flags = Display.FLAG_OWN_DISPLAY_GROUP | Display.FLAG_ALWAYS_UNLOCKED;
        DisplayContent newDisplay = createNewDisplay(displayInfo);
        final KeyguardController keyguardController = mSupervisor.getKeyguardController();

        // Make sure we're starting out with 2 unlocked displays
        assertEquals(2, mRootWindowContainer.getChildCount());
        mRootWindowContainer.forAllDisplays(displayContent -> {
            assertFalse(displayContent.isKeyguardLocked());
            assertFalse(displayContent.isAodShowing());
            assertFalse(keyguardController.isAodShowing(displayContent.mDisplayId));
        });

        // setLockScreenShown should only lock the default display, not the virtual one
        mAtm.setLockScreenShown(true, true);

        assertTrue(mDefaultDisplay.isKeyguardLocked());
        assertTrue(mDefaultDisplay.isAodShowing());
        assertTrue(keyguardController.isAodShowing(mDefaultDisplay.mDisplayId));

        DisplayContent virtualDisplay = mRootWindowContainer.getDisplayContent(
                newDisplay.getDisplayId());
        assertNotEquals(Display.DEFAULT_DISPLAY, virtualDisplay.getDisplayId());
        assertFalse(virtualDisplay.isKeyguardLocked());
        assertFalse(virtualDisplay.isAodShowing());
        assertFalse(keyguardController.isAodShowing(virtualDisplay.mDisplayId));
    }

    /*