From 5bd7cc22113f05eed39dc9dbf1431f1c08f6553c Mon Sep 17 00:00:00 2001 From: Mateusz Cicheński Date: Tue, 6 Jun 2023 04:04:09 +0000 Subject: 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 --- .../Shell/src/com/android/wm/shell/common/DisplayLayout.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libs') 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); } } -- cgit v1.2.3-59-g8ed1b