From a2d2ba7e6192a44bbd6449d98df3c46b66d75252 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Mon, 25 May 2020 17:44:55 +0200 Subject: [PATCH] InsetsController: Maintain type user animation when restarting input When the IME restarts input, it re-requests to show itself. If the app is already animating, we should maintain that animation instead of cancelling it. Fixes: 155962435 Test: atest WindowInsetsAnimationControllerTests Change-Id: I57618e43b2cddc55e5dfc32111abbbd82cc6ed48 --- core/java/android/view/InsetsController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java index 758062f41428b..9296618daac5c 100644 --- a/core/java/android/view/InsetsController.java +++ b/core/java/android/view/InsetsController.java @@ -713,6 +713,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation // applied before starting animation). continue; } + if (fromIme && animationType == ANIMATION_TYPE_USER) { + // App is already controlling the IME, don't cancel it. + continue; + } typesReady |= InsetsState.toPublicType(consumer.getType()); } applyAnimation(typesReady, true /* show */, fromIme);