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

Commit 3b19ff1e authored by Adrian Roos's avatar Adrian Roos
Browse files

WindowInsetsAnimation: Fix app driven closing of IME

When using controlWindowInsetsAnimation to close the IME,
delay reporting this to the IME until the animation is actually
finished. Otherwise, the IME will self-hide and start a transition
that breaks the just-begun app-driven transition.

(Regression from I7f6098a61a5942795ffd33a60329e4dd5fb5d6cb which
changed InputMethodService to hide itself in reponse to notifyHidden)

Bug: 151980214
Test: make WindowInsetsTests, ensure that dragging the IME closed doesnt get cancelled
Change-Id: If4e64cc78742a4e1e8c98137bd97d65dd567f674
parent 30c2f30f
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.view;

import static android.view.InsetsController.ANIMATION_TYPE_USER;
import static android.view.InsetsController.AnimationType;
import static android.view.InsetsState.ITYPE_IME;

@@ -104,13 +103,9 @@ public final class ImeInsetsSourceConsumer extends InsetsSourceConsumer {
    void hide(boolean animationFinished, @AnimationType int animationType) {
        super.hide();

        if (!animationFinished) {
            if (animationType == ANIMATION_TYPE_USER) {
                // if controlWindowInsetsAnimation is hiding keyboard.
                notifyHidden();
            }
        } else {
        if (animationFinished) {
            // remove IME surface as IME has finished hide animation.
            notifyHidden();
            removeSurface();
        }
    }