From 227c665910377b3346760b2cb502d5c3f722f76b Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Thu, 19 Mar 2020 22:28:43 +0800 Subject: Make canBeImeTarget be compatible with legacy behavior And let IME always extend into the status bar area so that the position of IME can never affected by status bar. This can prevent flicker during IME animation. This CL also makes PerDisplay can restart the animation while the insets source control is changed during animation. Fix: 151759336 Test: atest WindowStateTests Change-Id: Ic2a308e6b7ec39b4b8645751e31addd26ddf3735 --- core/java/android/inputmethodservice/InputMethodService.java | 1 + 1 file changed, 1 insertion(+) (limited to 'core/java/android/inputmethodservice/InputMethodService.java') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index c2ee21d5115d..6af4f93788f1 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -1249,6 +1249,7 @@ public class InputMethodService extends AbstractInputMethodService { WindowManager.LayoutParams.TYPE_INPUT_METHOD, Gravity.BOTTOM, false); mWindow.getWindow().getAttributes().setFitInsetsTypes(statusBars() | navigationBars()); mWindow.getWindow().getAttributes().setFitInsetsSides(Side.all() & ~Side.BOTTOM); + mWindow.getWindow().getAttributes().setFitInsetsIgnoringVisibility(true); // IME layout should always be inset by navigation bar, no matter its current visibility, // unless automotive requests it, since automotive may hide the navigation bar. -- cgit v1.2.3