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
This commit is contained in:
Jeff Chang
2023-05-16 15:15:54 +00:00
parent 8f9666c0b5
commit ec974061a3

View File

@@ -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();
}