summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mateusz Cicheński <mateuszc@google.com> 2023-06-06 04:04:09 +0000
committer Mateusz Cicheński <mateuszc@google.com> 2023-06-06 04:04:09 +0000
commit5bd7cc22113f05eed39dc9dbf1431f1c08f6553c (patch)
tree3773f1ed3db0d25ddf5efb6326f498ea69064e5a
parent94e4aeef4659315562fad7bc7d4879575211d398 (diff)
Only compare the relevant insets for navbar position
This reverts a regression introduced in http://ag/21397084, where the insets were all rewritten to outInsets, even though the insetsState for them when rotating screen is still in previous orientation. Bug: 281769053 Bug: 234093736 Test: http://recall/-/ekEuGtt9d9HWqkUtAzpHx8/eNX1aOBLtPs7PUR5LUuYfi Change-Id: I508123660c33e63696af39c2735a1dc92fdaf74f
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
index d6e1a82a68ff..467e9c7a116b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java
@@ -375,16 +375,15 @@ public class DisplayLayout {
insetsState.getDisplayFrame(),
WindowInsets.Type.navigationBars(),
false /* ignoreVisibility */);
- outInsets.set(insets.left, insets.top, insets.right, insets.bottom);
int position = navigationBarPosition(res, displayWidth, displayHeight, displayRotation);
int navBarSize =
getNavigationBarSize(res, position, displayWidth > displayHeight, uiMode);
if (position == NAV_BAR_BOTTOM) {
- outInsets.bottom = Math.max(outInsets.bottom , navBarSize);
+ outInsets.bottom = Math.max(insets.bottom , navBarSize);
} else if (position == NAV_BAR_RIGHT) {
- outInsets.right = Math.max(outInsets.right , navBarSize);
+ outInsets.right = Math.max(insets.right , navBarSize);
} else if (position == NAV_BAR_LEFT) {
- outInsets.left = Math.max(outInsets.left , navBarSize);
+ outInsets.left = Math.max(insets.left , navBarSize);
}
}