From 1f5f0d0039a9efd6924ad2fcc8eb310a50adb75b Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Sat, 15 Jan 2022 01:35:54 +0800 Subject: [PATCH] ShellTranstion: Apply recents input consumer when the window in transion Like legacy recents animation will check if the focused window is animating with recents animation, if so, requests the input focus on recents input consumer, if not, means the window is not controlled by recents animation and we should give it focus. (e.g. Tapping on StatusBar) Otherwise the input focus will be consumed by recents input consumer and then tapping the editor on direct-reply notification will not able to show IME. Bug: 210390667 Test: manual as steps 1) adb shell setprop persist.debug.shell_transit 1) 2) install EditTextVariations.apk 3) launch EditTextVariations, choose "Direct Reply" to popup directly-reply notification 4) launch Android Message with focusing the editor to show IME 5) swipe up to enter the overview screen 6) swipe down the notification shade with pressing "Direct Reply Text" on "Message from UserHandle()" notification. 7) Expect IME should show up Change-Id: I8830f2deaa623985b05a5fc85d2a196c5cfbf81d --- services/core/java/com/android/server/wm/InputMonitor.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/InputMonitor.java b/services/core/java/com/android/server/wm/InputMonitor.java index 4225f214eebd0..44818a8c9ee45 100644 --- a/services/core/java/com/android/server/wm/InputMonitor.java +++ b/services/core/java/com/android/server/wm/InputMonitor.java @@ -399,10 +399,11 @@ final class InputMonitor { if (recentsAnimationInputConsumer != null && focus != null) { final RecentsAnimationController recentsAnimationController = mService.getRecentsAnimationController(); + // Apply recents input consumer when the focusing window is in recents animation. final boolean shouldApplyRecentsInputConsumer = (recentsAnimationController != null && recentsAnimationController.shouldApplyInputConsumer(focus.mActivityRecord)) // Shell transitions doesn't use RecentsAnimationController - || getWeak(mActiveRecentsActivity) != null; + || getWeak(mActiveRecentsActivity) != null && focus.inTransition(); if (shouldApplyRecentsInputConsumer) { requestFocus(recentsAnimationInputConsumer.mWindowHandle.token, recentsAnimationInputConsumer.mName);