From 53b9736819fd4590612cc4fc796d31c655f560a5 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Thu, 29 Sep 2022 01:22:14 +0800 Subject: [PATCH] Request hiding IME before starting dismiss biometric UI animation As recents animation will invoke hideSoftInputFromWindow when the Biometric UI lost focus during quick-switch. Since IME hiding animation will be scheduled on the focus app's UI thread, so if Biometric UI has running the animation on UI thread, the IME hiding animation will be delayed until the animation finish. Make sure calling WindowInsetsController#hide(ime()) before starting dismiss biometric UI to fix this issue. Fix: 247705580 Test: manual by issue steps: 1. Unlock the device 2. Go to Settings -> Network and internet -> Hotspot and tethering -> WIFI hotspot 3. Enable use Wi-Fi hotspot 4. Tap on Biometric to show keyboard 5. From password screen go to home screen 6. Expect keyboard will be hidden without being delayed Change-Id: I541f41832753ea1f4f48f6c4745649606b37d207 --- .../com/android/systemui/biometrics/AuthContainerView.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java index 8f5cbb76222fc..00236f1504888 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java @@ -775,6 +775,12 @@ public class AuthContainerView extends LinearLayout } mContainerState = STATE_ANIMATING_OUT; + // Request hiding soft-keyboard before animating away credential UI, in case IME insets + // animation get delayed by dismissing animation. + if (isAttachedToWindow() && getRootWindowInsets().isVisible(WindowInsets.Type.ime())) { + getWindowInsetsController().hide(WindowInsets.Type.ime()); + } + if (sendReason) { mPendingCallbackReason = reason; } else {