diff options
| author | Tiger Huang <tigerhuang@google.com> | 2020-03-02 16:16:01 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2020-03-02 20:19:18 +0800 |
| commit | 5fb9ab7ddf27330d099581bd78753a5f17a20ac3 (patch) | |
| tree | 24153a6f6214808f0f0daea29df70c99e7140120 /core/java/android/view/ViewRootImpl.java | |
| parent | 6a9cd11871bfb39c1950e4549b5c93d6a21392dd (diff) | |
Refine adjustLayoutParamsForCompatibility about fitting insets
By the compatible logic in DisplayPolicy.layoutWidnowLw(), if a regular
window (non-TYPE_STATUS_BAR_PANEL, non-TYPE_TOAST, and
non-TYPE_SYSTEM_ALERT) doesn't extend into any of system bars, it should
fit IME.
The logic was implemented by pf.set(displayFrames.mContent) in the
legacy insets mode, where mContent would be adjusted after processing
IME.
Fix: 149838078
Test: Steps in the target issue
Test: atest ViewRootImplTest
Change-Id: I6eb685fa1e3ad9789621e5647fc490300054db8b
Diffstat (limited to 'core/java/android/view/ViewRootImpl.java')
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 9733448b890b..36257d9f5fd9 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -52,8 +52,6 @@ import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_APPEARANCE_CO import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_BEHAVIOR_CONTROLLED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FIT_INSETS_CONTROLLED; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY; -import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE; -import static android.view.WindowManager.LayoutParams.SOFT_INPUT_MASK_ADJUST; import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD; import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL; import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_ALERT; @@ -2009,7 +2007,6 @@ public final class ViewRootImpl implements ViewParent, final int sysUiVis = inOutParams.systemUiVisibility | inOutParams.subtreeSystemUiVisibility; final int flags = inOutParams.flags; final int type = inOutParams.type; - final int adjust = inOutParams.softInputMode & SOFT_INPUT_MASK_ADJUST; if ((inOutParams.privateFlags & PRIVATE_FLAG_APPEARANCE_CONTROLLED) == 0) { inOutParams.insetsFlags.appearance = 0; @@ -2054,8 +2051,7 @@ public final class ViewRootImpl implements ViewParent, } if (type == TYPE_TOAST || type == TYPE_SYSTEM_ALERT) { ignoreVis = true; - } else if ((types & Type.systemBars()) == Type.systemBars() - && adjust == SOFT_INPUT_ADJUST_RESIZE) { + } else if ((types & Type.systemBars()) == Type.systemBars()) { types |= Type.ime(); } inOutParams.setFitInsetsTypes(types); @@ -2261,7 +2257,8 @@ public final class ViewRootImpl implements ViewParent, mAttachInfo.mVisibleInsets.set(visibleInsets); } - InsetsController getInsetsController() { + @VisibleForTesting + public InsetsController getInsetsController() { return mInsetsController; } |
