From 0dbd6c4bd627b4fc7a1a0c313b5dc5a026fa3820 Mon Sep 17 00:00:00 2001 From: Taran Singh Date: Wed, 6 May 2020 19:29:17 +0000 Subject: [PATCH] Revert "Keeps the served view of the window when focus to the ne..." Revert "Refine FocusHandlingTest" Revert submission 11182377-fix_b_152373385 Reason for revert: Fix b/155781821 Reverted Changes: If20cdb43e:Keeps the served view of the window when focus to ... I50402165b:Refine FocusHandlingTest Bug: 152373385 Bug: 155781821 Change-Id: I44469caf5a5ceaf247c4e6b0694da9da1f3c0eb1 --- core/java/android/view/inputmethod/InputMethodManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 3cf61098f11cf..71dd6653f6a65 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -645,6 +645,11 @@ 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; } }