Loading core/java/android/view/ImeFocusController.java +0 −15 Original line number Diff line number Diff line Loading @@ -131,19 +131,6 @@ public final class ImeFocusController { mHasImeFocus = false; } /** * Calling IMS#onStartInput when the device screen-on again). */ @UiThread public void onInteractive() { final InputMethodManagerDelegate immDelegate = getImmDelegate(); if (!immDelegate.isCurrentRootView(mViewRootImpl)) { return; } final View focusedView = mViewRootImpl.mView.findFocus(); onViewFocusChanged(focusedView, focusedView != null); } /** * @param windowAttribute {@link WindowManager.LayoutParams} to be checked. * @return Whether the window is in local focus mode or not. Loading Loading @@ -179,8 +166,6 @@ public final class ImeFocusController { boolean checkFocus(boolean forceNewFocus, boolean startInput, ViewRootImpl viewRootImpl); void onViewDetachedFromWindow(View view, ViewRootImpl viewRootImpl); void onWindowDismissed(ViewRootImpl viewRootImpl); boolean isCurrentRootView(ViewRootImpl rootView); } /** Loading core/java/android/view/inputmethod/InputMethodManager.java +13 −18 Original line number Diff line number Diff line Loading @@ -903,18 +903,6 @@ public final class InputMethodManager { mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; } /** * Used for {@link ImeFocusController} to return if the root view from the * controller is this {@link InputMethodManager} currently focused. * TODO: Address event-order problem when get current root view in multi-threads. */ @Override public boolean isCurrentRootView(ViewRootImpl rootView) { synchronized (mH) { return mCurRootView == rootView; } } } /** @hide */ Loading Loading @@ -1182,17 +1170,24 @@ public final class InputMethodManager { synchronized (mH) { mActive = interactive; mFullscreenMode = fullscreen; if (interactive) { // Report active state to ImeFocusController to handle IME input // connection lifecycle callback when it allowed. final ImeFocusController controller = getFocusController(); final View rootView = mCurRootView != null ? mCurRootView.getView() : null; if (controller == null || rootView == null) { if (rootView == null) { return; } rootView.post(controller::onInteractive); // Find the next view focus to start the input connection when the // device was interactive. final ViewRootImpl currentViewRootImpl = mCurRootView; rootView.post(() -> { synchronized (mH) { if (mCurRootView != currentViewRootImpl) { return; } } final View focusedView = currentViewRootImpl.getView().findFocus(); onViewFocusChangedInternal(focusedView, focusedView != null); }); } else { finishInputLocked(); if (isImeSessionAvailableLocked()) { Loading Loading
core/java/android/view/ImeFocusController.java +0 −15 Original line number Diff line number Diff line Loading @@ -131,19 +131,6 @@ public final class ImeFocusController { mHasImeFocus = false; } /** * Calling IMS#onStartInput when the device screen-on again). */ @UiThread public void onInteractive() { final InputMethodManagerDelegate immDelegate = getImmDelegate(); if (!immDelegate.isCurrentRootView(mViewRootImpl)) { return; } final View focusedView = mViewRootImpl.mView.findFocus(); onViewFocusChanged(focusedView, focusedView != null); } /** * @param windowAttribute {@link WindowManager.LayoutParams} to be checked. * @return Whether the window is in local focus mode or not. Loading Loading @@ -179,8 +166,6 @@ public final class ImeFocusController { boolean checkFocus(boolean forceNewFocus, boolean startInput, ViewRootImpl viewRootImpl); void onViewDetachedFromWindow(View view, ViewRootImpl viewRootImpl); void onWindowDismissed(ViewRootImpl viewRootImpl); boolean isCurrentRootView(ViewRootImpl rootView); } /** Loading
core/java/android/view/inputmethod/InputMethodManager.java +13 −18 Original line number Diff line number Diff line Loading @@ -903,18 +903,6 @@ public final class InputMethodManager { mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; } /** * Used for {@link ImeFocusController} to return if the root view from the * controller is this {@link InputMethodManager} currently focused. * TODO: Address event-order problem when get current root view in multi-threads. */ @Override public boolean isCurrentRootView(ViewRootImpl rootView) { synchronized (mH) { return mCurRootView == rootView; } } } /** @hide */ Loading Loading @@ -1182,17 +1170,24 @@ public final class InputMethodManager { synchronized (mH) { mActive = interactive; mFullscreenMode = fullscreen; if (interactive) { // Report active state to ImeFocusController to handle IME input // connection lifecycle callback when it allowed. final ImeFocusController controller = getFocusController(); final View rootView = mCurRootView != null ? mCurRootView.getView() : null; if (controller == null || rootView == null) { if (rootView == null) { return; } rootView.post(controller::onInteractive); // Find the next view focus to start the input connection when the // device was interactive. final ViewRootImpl currentViewRootImpl = mCurRootView; rootView.post(() -> { synchronized (mH) { if (mCurRootView != currentViewRootImpl) { return; } } final View focusedView = currentViewRootImpl.getView().findFocus(); onViewFocusChangedInternal(focusedView, focusedView != null); }); } else { finishInputLocked(); if (isImeSessionAvailableLocked()) { Loading