diff options
author | 2024-08-05 09:07:21 +0000 | |
---|---|---|
committer | 2024-08-05 09:07:21 +0000 | |
commit | 2d258767b7e9ffe050cb2ad40fb6160145e7bff6 (patch) | |
tree | e186e3508e8a71c1409b39701d3f422eb2e65945 | |
parent | f3c2f400383daca0abebeffcc7a6bc429d0e6750 (diff) | |
parent | 32b30fc445cb0c4f4dec9dbd8510d7e8ece03c82 (diff) |
Merge "Cancel startAnimation(show=true) if IME is not requested to be visible" into main
2 files changed, 7 insertions, 1 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java index d7d19f7b8bbd..3fa51a909aaa 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java @@ -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); diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java index 764d5a97e3e1..654d7a8ecf91 100644 --- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java +++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java @@ -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()); |