Loading core/java/android/view/inputmethod/InputMethodManager.java +21 −17 Original line number Diff line number Diff line Loading @@ -992,7 +992,19 @@ public final class InputMethodManager { private void setCurrentRootViewLocked(ViewRootImpl rootView) { final boolean wasEmpty = mCurRootView == null; if (Flags.refactorInsetsController() && !wasEmpty && mCurRootView != rootView) { final int softInputMode = mCurRootView.mWindowAttributes.softInputMode; onImeFocusLost(mCurRootView); } mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; if (wasEmpty && mCurRootView != null) { mImeDispatcher.updateReceivingDispatcher(mCurRootView.getOnBackInvokedDispatcher()); } } } private void onImeFocusLost(@NonNull ViewRootImpl previousRootView) { final int softInputMode = previousRootView.mWindowAttributes.softInputMode; final int state = softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE; if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) { Loading @@ -1003,22 +1015,14 @@ public final class InputMethodManager { SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS, false /* fromUser */); if (DEBUG) { Log.d(TAG, "setCurrentRootViewLocked, hiding IME because " Log.d(TAG, "onImeFocusLost, hiding IME because " + "of STATE_ALWAYS_HIDDEN"); } mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(), previousRootView.getInsetsController().hide(WindowInsets.Type.ime(), false /* fromIme */, statsToken); } } mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; if (wasEmpty && mCurRootView != null) { mImeDispatcher.updateReceivingDispatcher(mCurRootView.getOnBackInvokedDispatcher()); } } } /** @hide */ public DelegateImpl getDelegate() { return mDelegate; Loading Loading
core/java/android/view/inputmethod/InputMethodManager.java +21 −17 Original line number Diff line number Diff line Loading @@ -992,7 +992,19 @@ public final class InputMethodManager { private void setCurrentRootViewLocked(ViewRootImpl rootView) { final boolean wasEmpty = mCurRootView == null; if (Flags.refactorInsetsController() && !wasEmpty && mCurRootView != rootView) { final int softInputMode = mCurRootView.mWindowAttributes.softInputMode; onImeFocusLost(mCurRootView); } mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; if (wasEmpty && mCurRootView != null) { mImeDispatcher.updateReceivingDispatcher(mCurRootView.getOnBackInvokedDispatcher()); } } } private void onImeFocusLost(@NonNull ViewRootImpl previousRootView) { final int softInputMode = previousRootView.mWindowAttributes.softInputMode; final int state = softInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_STATE; if (state == WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) { Loading @@ -1003,22 +1015,14 @@ public final class InputMethodManager { SoftInputShowHideReason.HIDE_WINDOW_LOST_FOCUS, false /* fromUser */); if (DEBUG) { Log.d(TAG, "setCurrentRootViewLocked, hiding IME because " Log.d(TAG, "onImeFocusLost, hiding IME because " + "of STATE_ALWAYS_HIDDEN"); } mCurRootView.getInsetsController().hide(WindowInsets.Type.ime(), previousRootView.getInsetsController().hide(WindowInsets.Type.ime(), false /* fromIme */, statsToken); } } mImeDispatcher.switchRootView(mCurRootView, rootView); mCurRootView = rootView; if (wasEmpty && mCurRootView != null) { mImeDispatcher.updateReceivingDispatcher(mCurRootView.getOnBackInvokedDispatcher()); } } } /** @hide */ public DelegateImpl getDelegate() { return mDelegate; Loading