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

Commit de7e93fa authored by Gaurav Bhola's avatar Gaurav Bhola
Browse files

Allow IME to attach to the app even with different bounds

- This change was originally added for display areas that are visually
  multi-window but in fullscreen windowing mode and IME need to be
  localized on them.
- Automotive has moved away from using display areas for their windowing
  layout and hence this change is not needed anymore
- Moreoever this change also caused a flicker on some phones when IME is
  showing during orientation change.

Flag: EXEMPT (bugfix)
Fix: 413921056
Test: atest DisplayContentTests
Change-Id: I6c427987df48f391e98c4f202a92306bca0607c7
parent 02e3e78e
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4283,7 +4283,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
                && mImeLayeringTarget != null
                && mImeLayeringTarget.mActivityRecord != null
                && mImeLayeringTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
                && mImeLayeringTarget.getBounds().equals(mImeWindowsContainer.getBounds())
                // IME is attached to app windows that fill display area. This excludes
                // letterboxed windows.
                && mImeLayeringTarget.matchesDisplayAreaBounds();
+0 −19
Original line number Diff line number Diff line
@@ -1397,25 +1397,6 @@ public class DisplayContentTests extends WindowTestsBase {
        assertEquals(mAppWindow, mDisplayContent.computeImeControlTarget());
    }

    @SetupWindows(addWindows = W_ACTIVITY)
    @Test
    public void testShouldImeAttachedToApp_targetBoundsDifferentFromImeContainer_returnsFalse() {
        Rect imeContainerBounds = new Rect(0, 0, 100, 100);
        Rect imeTargetBounds = new Rect(0, 0, 100, 200);
        spyOn(mAppWindow);
        spyOn(mAppWindow.mActivityRecord);
        doReturn(imeTargetBounds).when(mAppWindow).getBounds();
        doReturn(true).when(mAppWindow.mActivityRecord).matchParentBounds();
        mDisplayContent.setRemoteInsetsController(createDisplayWindowInsetsController());
        mDisplayContent.setImeInputTarget(mAppWindow);
        mDisplayContent.setImeLayeringTarget(mAppWindow);
        final DisplayArea.Tokens imeContainer = mDisplayContent.getImeContainer();
        spyOn(imeContainer);
        doReturn(imeContainerBounds).when(imeContainer).getBounds();

        assertFalse(mDisplayContent.shouldImeAttachedToApp());
    }

    @Test
    public void testUpdateSystemGestureExclusion() {
        final DisplayContent dc = createNewDisplay();