From 39d15f92ac1fedbcb4bf3479fc152fb25a351567 Mon Sep 17 00:00:00 2001 From: Tiger Huang Date: Mon, 8 Feb 2021 17:38:28 +0800 Subject: [PATCH] Only force layout legacy apps with SOFT_INPUT_ADJUST_RESIZE Forcing layout for other soft input modes seems redundant while IME shows or hides, because the layout doesn't change. It doesn't useful for the system bar cases as well, because the main content of the fullscreen apps is usually stable. Fix: 161781474 Test: Open IME in Telegram Change-Id: Ic64dd86e5804c4b25fa118297eaca3c63c5e0a7d --- core/java/android/view/ViewRootImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 036a703f178c8..a002eb68c70b9 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -1675,7 +1675,8 @@ public final class ViewRootImpl implements ViewParent, requestLayout(); // See comment for View.sForceLayoutWhenInsetsChanged - if (View.sForceLayoutWhenInsetsChanged && mView != null) { + if (View.sForceLayoutWhenInsetsChanged && mView != null + && mWindowAttributes.softInputMode == SOFT_INPUT_ADJUST_RESIZE) { forceLayout(mView); }