From 6743813471e2f3e67f982a13057f769659216335 Mon Sep 17 00:00:00 2001 From: Ming-Shin Lu Date: Wed, 22 Apr 2020 00:49:32 +0800 Subject: [PATCH] Keeps the served view of the window when focus to the next window CL[1] intends to reset served view and restart input state when focus to the next window, which the main idea is try to make the lifecycle of the input connection can more aligned with the window focus change. However, this behavior change unexpectedly breaks Gboard TranslatesUIExtention that will closeExtensionView when onFinishInputView -> onDeactivate called, while launching language selection dialog. Remove the reset logic as the lifecycle of input connection still needs to break down. [1]: I8d4fff94ba9313b773bc27fcbd019cc88580d3e9 Fix: 152373385 Test: To make sure not break Bug 148489857 and Bug 148788569, following auto / manual test to verify: - Auto: atest FocusHandlingTest#testKeyboardStateAfterImeFocusableFlagChanged - Manual: 1) Build / install EditTextVariations 2) Select menu -> Direct-Reply, make sure Notification comes up. 3) Tap EditText on Notification, verify soft-keyboard is visible. Change-Id: If20cdb43ecd013c330c5e16c73e9af972bd89f33 --- core/java/android/view/inputmethod/InputMethodManager.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 71dd6653f6a65..3cf61098f11cf 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -645,11 +645,6 @@ public final class InputMethodManager { @Override public void setCurrentRootView(ViewRootImpl rootView) { synchronized (mH) { - if (mCurRootView != null) { - // Reset the last served view and restart window focus state of the root view. - mCurRootView.getImeFocusController().setServedView(null); - mRestartOnNextWindowFocus = true; - } mCurRootView = rootView; } }