Loading core/java/android/view/ImeFocusController.java +12 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.NonNull; import android.annotation.UiThread; import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.Flags; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.InputMethodDebug; Loading Loading @@ -150,6 +151,17 @@ public final class ImeFocusController { if (!mHasImeFocus || isInLocalFocusMode(windowAttribute)) { return InputMethodManager.DISPATCH_NOT_HANDLED; } if (Flags.refactorInsetsController() && event instanceof KeyEvent keyEvent && keyEvent.getKeyCode() == KeyEvent.KEYCODE_BACK) { final var insetsController = mViewRootImpl.getInsetsController(); if (insetsController.getAnimationType(WindowInsets.Type.ime()) == InsetsController.ANIMATION_TYPE_HIDE || insetsController.isPredictiveBackImeHideAnimInProgress()) { // if there is an ongoing hide animation, the back event should not be dispatched // to the IME. return InputMethodManager.DISPATCH_NOT_HANDLED; } } final InputMethodManager imm = mViewRootImpl.mContext.getSystemService(InputMethodManager.class); if (imm == null) { Loading core/java/android/view/InsetsController.java +2 −1 Original line number Diff line number Diff line Loading @@ -1910,7 +1910,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mImeSourceConsumer.onWindowFocusLost(); } @VisibleForTesting /** Returns the current {@link AnimationType} of an {@link InsetsType}. */ @VisibleForTesting(visibility = PACKAGE) public @AnimationType int getAnimationType(@InsetsType int type) { for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner; Loading Loading
core/java/android/view/ImeFocusController.java +12 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.NonNull; import android.annotation.UiThread; import android.util.Log; import android.util.proto.ProtoOutputStream; import android.view.inputmethod.Flags; import android.view.inputmethod.InputMethodManager; import com.android.internal.inputmethod.InputMethodDebug; Loading Loading @@ -150,6 +151,17 @@ public final class ImeFocusController { if (!mHasImeFocus || isInLocalFocusMode(windowAttribute)) { return InputMethodManager.DISPATCH_NOT_HANDLED; } if (Flags.refactorInsetsController() && event instanceof KeyEvent keyEvent && keyEvent.getKeyCode() == KeyEvent.KEYCODE_BACK) { final var insetsController = mViewRootImpl.getInsetsController(); if (insetsController.getAnimationType(WindowInsets.Type.ime()) == InsetsController.ANIMATION_TYPE_HIDE || insetsController.isPredictiveBackImeHideAnimInProgress()) { // if there is an ongoing hide animation, the back event should not be dispatched // to the IME. return InputMethodManager.DISPATCH_NOT_HANDLED; } } final InputMethodManager imm = mViewRootImpl.mContext.getSystemService(InputMethodManager.class); if (imm == null) { Loading
core/java/android/view/InsetsController.java +2 −1 Original line number Diff line number Diff line Loading @@ -1910,7 +1910,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mImeSourceConsumer.onWindowFocusLost(); } @VisibleForTesting /** Returns the current {@link AnimationType} of an {@link InsetsType}. */ @VisibleForTesting(visibility = PACKAGE) public @AnimationType int getAnimationType(@InsetsType int type) { for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner; Loading