summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Liran Binyamin <liranb@google.com> 2024-12-13 12:12:08 -0500
committer Liran Binyamin <liranb@google.com> 2024-12-19 11:05:21 -0500
commitcff526e4ca0c137400ef0ff10f58e4944d2bdd7f (patch)
tree9c7b9744aa209b5eb13d6da1b6fc322bc185930f
parente387330102bfcf168747497f1dcc008b810d132f (diff)
Fix flicker caused by IME hiding twice
Avoid triggering the IME hide animation if the IME is already hidden. Flag: EXEMPT bug fix Bug: 377329425 Bug: 379474417 Test: manual - Create floating bubble and expand it - Show IME - Hide IME - Observe bubble is not flickering Change-Id: I12713e59d36526f6bc7ff373c2c8e178b108ef4e
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java8
1 files changed, 6 insertions, 2 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 9ebb7f5aa270..be9bc9b23f56 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
@@ -419,8 +419,12 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged
// already (e.g., when focussing an editText in activity B, while and editText in
// activity A is focussed), we will not get a call of #insetsControlChanged, and
// therefore have to start the show animation from here
- startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */,
- statsToken);
+ if (visible || mImeShowing) {
+ // only start the animation if we're either already showing or becoming visible.
+ // otherwise starting another hide animation causes flickers.
+ startAnimation(mImeRequestedVisible /* show */, false /* forceRestart */,
+ statsToken);
+ }
// In case of a hide, the statsToken should not been send yet (as the animation
// is still ongoing). It will be sent at the end of the animation