From 0135a4793aa3e177b30216358cb624881e4a09e1 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 20 Oct 2022 09:24:53 -0700 Subject: [PATCH] Inline Imm.DelegateImpl#startInputOnWindowFocusGain() This is mechanical refactoring. There must be no behavior change. Bug: 234882948 Test: presubmit Change-Id: I2253c9e76df6aca352f2ecfc5fbb27cf6eec9126 --- .../view/inputmethod/InputMethodManager.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 201efe81c102d..5c73b8feb7406 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -763,13 +763,11 @@ public final class InputMethodManager { forceFocus = true; } } - startInputOnWindowFocusGain(viewForWindowFocus, - windowAttribute.softInputMode, windowAttribute.flags, forceFocus); - } - private void startInputOnWindowFocusGain(View focusedView, - @SoftInputModeFlags int softInputMode, int windowFlags, boolean forceNewFocus) { - int startInputFlags = getStartInputFlags(focusedView, 0); + final int softInputMode = windowAttribute.softInputMode; + final int windowFlags = windowAttribute.flags; + + int startInputFlags = getStartInputFlags(viewForWindowFocus, 0); startInputFlags |= StartInputFlags.WINDOW_GAINED_FOCUS; ImeTracing.getInstance().triggerClientDump( @@ -784,9 +782,9 @@ public final class InputMethodManager { if (mRestartOnNextWindowFocus) { if (DEBUG) Log.v(TAG, "Restarting due to mRestartOnNextWindowFocus as true"); mRestartOnNextWindowFocus = false; - forceNewFocus = true; + forceFocus = true; } - checkFocusResult = checkFocusInternalLocked(forceNewFocus, mCurRootView); + checkFocusResult = checkFocusInternalLocked(forceFocus, mCurRootView); } if (checkFocusResult) { @@ -795,7 +793,7 @@ public final class InputMethodManager { // about the window gaining focus, to help make the transition // smooth. if (startInputOnWindowFocusGainInternal(StartInputReason.WINDOW_FOCUS_GAIN, - focusedView, startInputFlags, softInputMode, windowFlags)) { + viewForWindowFocus, startInputFlags, softInputMode, windowFlags)) { return; } } @@ -810,7 +808,7 @@ public final class InputMethodManager { // ignore the result mServiceInvoker.startInputOrWindowGainedFocus( StartInputReason.WINDOW_FOCUS_GAIN_REPORT_ONLY, mClient, - focusedView.getWindowToken(), startInputFlags, softInputMode, + viewForWindowFocus.getWindowToken(), startInputFlags, softInputMode, windowFlags, null, null, null,