From ec974061a32ec90be3a5ee5f435fd8cb08381788 Mon Sep 17 00:00:00 2001 From: Jeff Chang Date: Tue, 16 May 2023 15:15:54 +0000 Subject: [PATCH] Correct position of divider bar when get display insets The visibility of the navigation bar is invisible when the keyguard is unlocked. The insets are not correct when invoked the getDisplayInsets() to calculate the position of the divider bar. This CL uses the getInsetsIgnoringVisibility() to get insets no matter the visibility of the system bar. Bug: 278521469 Test: Pre-condition : 1. Turn on auto rotate 2. 3-button navigation 1. Create the split. 2. Turn off screen 3. Rotate to landscape 4. Turn screen on 5. Unlock the keyguard Change-Id: Iecb06d4dd652dac4f44fe0ec90e196974114aacb --- .../src/com/android/wm/shell/common/split/SplitLayout.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java index 9a2ec15238a76..ab8e7e63ef7fa 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java @@ -709,7 +709,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange return context.getSystemService(WindowManager.class) .getMaximumWindowMetrics() .getWindowInsets() - .getInsets(WindowInsets.Type.systemBars() | WindowInsets.Type.displayCutout()) + .getInsetsIgnoringVisibility(WindowInsets.Type.systemBars() + | WindowInsets.Type.displayCutout()) .toRect(); }