summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2020-09-02 00:02:17 +0800
committer Tiger Huang <tigerhuang@google.com> 2020-09-02 06:48:08 +0000
commite80e94182cbde56dc0ff796edc2e248d85babeed (patch)
treeb3fe8530acd40945156f1aa58a38a1dfd474eb93
parent0ac2f4e4f7bd289274276f1222d9e81aa386e82f (diff)
Compare with oldSoftInputMode after restoring softInputMode
... of mWindowAttributes. Apps might update LayoutParams with softInputMode unspecified on applying insets, and this can cause infinite loop in the previous logic, because we would auto-compute softInputMode for the unspecified one, which makes app's softInputMode never be the same as the one in ViewRootImpl.mWindowAttributes. Fix: 163009478 Test: Print stack trace before calling requestFitSystemWindows() and follow the steps in the bug. Test: Open Messages, go to attachments, reopen IME Change-Id: I2341121b69209688c2f6fb033f51611b21422a04
-rw-r--r--core/java/android/view/ViewRootImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index bcf3b49c6644..5c42408dab05 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1456,7 +1456,7 @@ public final class ViewRootImpl implements ViewParent,
| (oldSoftInputMode & WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST);
}
- if ((changes & LayoutParams.SOFT_INPUT_MODE_CHANGED) != 0) {
+ if (mWindowAttributes.softInputMode != oldSoftInputMode) {
requestFitSystemWindows();
}