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

Commit 32b30fc4 authored by Felix Stern's avatar Felix Stern
Browse files

Cancel startAnimation(show=true) if IME is not requested to be visible

In the case when we have a control with a leash, and we're calling startAnimation(show=true),
the animation should only start, if the IME was previously requested to be visible.

Test: atest WMShellUnitTests:com.android.wm.shell.common.DisplayImeControllerTest
Flag: android.view.inputmethod.refactor_insets_controller
Fix: 355059468
Change-Id: Icba77bbe84cd90150017f29c9b34438c64435468
parent 4c347ab6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -468,6 +468,12 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
                if (mImeSourceControl == null || mImeSourceControl.getLeash() == null) {
                    if (DEBUG) Slog.d(TAG, "No leash available, not starting the animation.");
                    return;
                } else if (!mImeRequestedVisible && show) {
                    // we have a control with leash, but the IME was not requested visible before,
                    // therefore aborting the show animation.
                    Slog.e(TAG, "IME was not requested visible, not starting the show animation.");
                    // TODO(b/353463205) fail statsToken here
                    return;
                }
            }
            final InsetsSource imeSource = mInsetsState.peekSource(InsetsSource.ID_IME);
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public class DisplayImeControllerTest extends ShellTestCase {
    @Test
    public void reappliesVisibilityToChangedLeash() {
        verifyZeroInteractions(mT);
        mPerDisplay.mImeShowing = true;
        mPerDisplay.mImeShowing = false;

        mPerDisplay.insetsControlChanged(insetsStateWithIme(false), insetsSourceControl());