Account for cutouts in system insets (as done previously)
Bug: 167389393 Test: atest DecorViewTest Change-Id: I75554224171e1e6a32892db53e0243c38a7b5169
This commit is contained in:
@@ -1095,15 +1095,18 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
|
|||||||
mLastWindowFlags = attrs.flags;
|
mLastWindowFlags = attrs.flags;
|
||||||
|
|
||||||
if (insets != null) {
|
if (insets != null) {
|
||||||
final Insets systemBarInsets = insets.getInsets(WindowInsets.Type.systemBars());
|
|
||||||
final Insets stableBarInsets = insets.getInsetsIgnoringVisibility(
|
|
||||||
WindowInsets.Type.systemBars());
|
|
||||||
final boolean clearCompatInsets = clearCompatInsets(attrs.type, attrs.flags,
|
final boolean clearCompatInsets = clearCompatInsets(attrs.type, attrs.flags,
|
||||||
getResources().getConfiguration().windowConfiguration.getWindowingMode());
|
getResources().getConfiguration().windowConfiguration.getWindowingMode());
|
||||||
mLastTopInset = clearCompatInsets ? 0 : systemBarInsets.top;
|
final Insets stableBarInsets = insets.getInsetsIgnoringVisibility(
|
||||||
mLastBottomInset = clearCompatInsets ? 0 : systemBarInsets.bottom;
|
WindowInsets.Type.systemBars());
|
||||||
mLastRightInset = clearCompatInsets ? 0 : systemBarInsets.right;
|
final Insets systemInsets = clearCompatInsets
|
||||||
mLastLeftInset = clearCompatInsets ? 0 : systemBarInsets.left;
|
? Insets.NONE
|
||||||
|
: Insets.min(insets.getInsets(WindowInsets.Type.systemBars()
|
||||||
|
| WindowInsets.Type.displayCutout()), stableBarInsets);
|
||||||
|
mLastTopInset = systemInsets.top;
|
||||||
|
mLastBottomInset = systemInsets.bottom;
|
||||||
|
mLastRightInset = systemInsets.right;
|
||||||
|
mLastLeftInset = systemInsets.left;
|
||||||
|
|
||||||
// Don't animate if the presence of stable insets has changed, because that
|
// Don't animate if the presence of stable insets has changed, because that
|
||||||
// indicates that the window was either just added and received them for the
|
// indicates that the window was either just added and received them for the
|
||||||
|
|||||||
Reference in New Issue
Block a user