Avoid handling the back key event, when IME is currently hiding

When there was an ongoing hide animation (without predictive back enabled), and another swipe back happened, the second event went to the InputMethodService, where it was consumed.
This was caused by the fact, that the IME is only notified that it will be hidden at the end of the hide animation.
However, the second back event should go to the app.

This CL fixes this behaviour and doesn't dispatch the back key event to the IME, if there is an ongoing hide animation or predictive back animation in progress.

Bug: 375986921
Test: Manual, i.e. verifying that quick double back swipes are handled correctly (including after an interrupted IME hide animation)
Flag: android.view.inputmethod.refactor_insets_controller
Change-Id: Ic22f76b4708c4e5f090824d1d46833a97b19b49f
2 files changed