Loading core/java/android/view/inputmethod/InputMethodManager.java +37 −38 Original line number Diff line number Diff line Loading @@ -776,20 +776,20 @@ public final class InputMethodManager { "InputMethodManager.DelegateImpl#startInputAsyncOnWindowFocusGain", InputMethodManager.this, null /* icProto */); final ViewRootImpl viewRootImpl; boolean checkFocusResult; synchronized (mH) { if (mCurRootView == null) { return; } viewRootImpl = mCurRootView; if (mRestartOnNextWindowFocus) { if (DEBUG) Log.v(TAG, "Restarting due to mRestartOnNextWindowFocus as true"); mRestartOnNextWindowFocus = false; forceNewFocus = true; } checkFocusResult = checkFocusInternalLocked(forceNewFocus, mCurRootView); } if (checkFocusInternal(forceNewFocus, viewRootImpl)) { if (checkFocusResult) { // We need to restart input on the current focus view. This // should be done in conjunction with telling the system service // about the window gaining focus, to help make the transition Loading Loading @@ -825,10 +825,12 @@ public final class InputMethodManager { } @Override public void onScheduledCheckFocus(@NonNull ViewRootImpl viewRootImpl) { if (!checkFocusInternal(false, viewRootImpl)) { public void onScheduledCheckFocus(ViewRootImpl viewRootImpl) { synchronized (mH) { if (!checkFocusInternalLocked(false, viewRootImpl)) { return; } } startInputOnWindowFocusGainInternal(StartInputReason.SCHEDULED_CHECK_FOCUS, null /* focusedView */, 0 /* startInputFlags */, 0 /* softInputMode */, 0 /* windowFlags */); Loading Loading @@ -1123,7 +1125,7 @@ public final class InputMethodManager { if (mCurRootView == null) { return; } if (!checkFocusInternal(mRestartOnNextWindowFocus, mCurRootView)) { if (!checkFocusInternalLocked(mRestartOnNextWindowFocus, mCurRootView)) { return; } final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS Loading Loading @@ -2657,16 +2659,14 @@ public final class InputMethodManager { */ @UnsupportedAppUsage public void checkFocus() { final ViewRootImpl viewRootImpl; synchronized (mH) { if (mCurRootView == null) { return; } viewRootImpl = mCurRootView; } if (!checkFocusInternal(false /* forceNewFocus */, viewRootImpl)) { if (!checkFocusInternalLocked(false /* forceNewFocus */, mCurRootView)) { return; } } startInputOnWindowFocusGainInternal(StartInputReason.CHECK_FOCUS, null /* focusedView */, 0 /* startInputFlags */, 0 /* softInputMode */, 0 /* windowFlags */); Loading @@ -2675,8 +2675,8 @@ public final class InputMethodManager { /** * Check the next served view if needs to start input. */ private boolean checkFocusInternal(boolean forceNewFocus, ViewRootImpl viewRootImpl) { synchronized (mH) { @GuardedBy("mH") private boolean checkFocusInternalLocked(boolean forceNewFocus, ViewRootImpl viewRootImpl) { if (mCurRootView != viewRootImpl) { return false; } Loading @@ -2701,7 +2701,6 @@ public final class InputMethodManager { if (mServedInputConnection != null) { mServedInputConnection.finishComposingTextFromImm(); } } return true; } Loading Loading
core/java/android/view/inputmethod/InputMethodManager.java +37 −38 Original line number Diff line number Diff line Loading @@ -776,20 +776,20 @@ public final class InputMethodManager { "InputMethodManager.DelegateImpl#startInputAsyncOnWindowFocusGain", InputMethodManager.this, null /* icProto */); final ViewRootImpl viewRootImpl; boolean checkFocusResult; synchronized (mH) { if (mCurRootView == null) { return; } viewRootImpl = mCurRootView; if (mRestartOnNextWindowFocus) { if (DEBUG) Log.v(TAG, "Restarting due to mRestartOnNextWindowFocus as true"); mRestartOnNextWindowFocus = false; forceNewFocus = true; } checkFocusResult = checkFocusInternalLocked(forceNewFocus, mCurRootView); } if (checkFocusInternal(forceNewFocus, viewRootImpl)) { if (checkFocusResult) { // We need to restart input on the current focus view. This // should be done in conjunction with telling the system service // about the window gaining focus, to help make the transition Loading Loading @@ -825,10 +825,12 @@ public final class InputMethodManager { } @Override public void onScheduledCheckFocus(@NonNull ViewRootImpl viewRootImpl) { if (!checkFocusInternal(false, viewRootImpl)) { public void onScheduledCheckFocus(ViewRootImpl viewRootImpl) { synchronized (mH) { if (!checkFocusInternalLocked(false, viewRootImpl)) { return; } } startInputOnWindowFocusGainInternal(StartInputReason.SCHEDULED_CHECK_FOCUS, null /* focusedView */, 0 /* startInputFlags */, 0 /* softInputMode */, 0 /* windowFlags */); Loading Loading @@ -1123,7 +1125,7 @@ public final class InputMethodManager { if (mCurRootView == null) { return; } if (!checkFocusInternal(mRestartOnNextWindowFocus, mCurRootView)) { if (!checkFocusInternalLocked(mRestartOnNextWindowFocus, mCurRootView)) { return; } final int reason = active ? StartInputReason.ACTIVATED_BY_IMMS Loading Loading @@ -2657,16 +2659,14 @@ public final class InputMethodManager { */ @UnsupportedAppUsage public void checkFocus() { final ViewRootImpl viewRootImpl; synchronized (mH) { if (mCurRootView == null) { return; } viewRootImpl = mCurRootView; } if (!checkFocusInternal(false /* forceNewFocus */, viewRootImpl)) { if (!checkFocusInternalLocked(false /* forceNewFocus */, mCurRootView)) { return; } } startInputOnWindowFocusGainInternal(StartInputReason.CHECK_FOCUS, null /* focusedView */, 0 /* startInputFlags */, 0 /* softInputMode */, 0 /* windowFlags */); Loading @@ -2675,8 +2675,8 @@ public final class InputMethodManager { /** * Check the next served view if needs to start input. */ private boolean checkFocusInternal(boolean forceNewFocus, ViewRootImpl viewRootImpl) { synchronized (mH) { @GuardedBy("mH") private boolean checkFocusInternalLocked(boolean forceNewFocus, ViewRootImpl viewRootImpl) { if (mCurRootView != viewRootImpl) { return false; } Loading @@ -2701,7 +2701,6 @@ public final class InputMethodManager { if (mServedInputConnection != null) { mServedInputConnection.finishComposingTextFromImm(); } } return true; } Loading