From 0f3a99d837048ae82855c2306cd454426393c19f Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 21 May 2015 00:15:05 -0700 Subject: [PATCH] Do not clear IMM#mCurRootView in IMM#finishInputLocked(). This is a follow up CL for I219394178e4172bc47864297f1418e677dba. As explained in the commit message of I219394178e4172bc47864297f, IMM#mCurRootView needs to be synchronized with the actual window focus more precisely to fix Bug 20820914. Hence we should not clear IMM#mCurRootView in IMM#finishInputLocked() anymore. Ideally this CL should have been included in the previous CL. Manually tested following scenarios. - Repro steps in Bug 6413553. Made sure that IMM#mCurRootView is cleared after switching back from the current application to the previous application with back key. - Test application that calls WebView#showFindDialog(). Made sure that LatinIME works fine when switching text fields. This is non-trivial because android.webkit.FindActionModeCallback is changed in the previous CL I219394178e4172bc47864297f1418e677db. - Repro steps in Bug 21144633. Made sure that we can enter recipient's name in the messaging app. This CL depends on I219394178e4172bc47864297f1418e677dba25e5. Bug: 20820914 Change-Id: Id6afc8fc64512225578c62557b96c7dc2e969adf --- core/java/android/view/inputmethod/InputMethodManager.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 824b4342d3d48..f61e372c26b06 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -801,25 +801,21 @@ public final class InputMethodManager { mServedInputConnectionWrapper = null; } } - + /** * Disconnect any existing input connection, clearing the served view. */ void finishInputLocked() { - mCurRootView = null; mNextServedView = null; if (mServedView != null) { if (DEBUG) Log.v(TAG, "FINISH INPUT: " + mServedView); - if (mCurrentTextBoxAttribute != null) { try { mService.finishInput(mClient); } catch (RemoteException e) { } } - notifyInputConnectionFinished(); - mServedView = null; mCompletions = null; mServedConnecting = false;