Merge "Fix cts test failure of EnsureBarContrastTest"

This commit is contained in:
Shawn Lin
2021-12-22 04:42:46 +00:00
committed by Gerrit Code Review

View File

@@ -1498,11 +1498,15 @@ public class DisplayPolicy {
statusBarBottom); statusBarBottom);
} }
sTmpRect.set(windowFrames.mFrame); final InsetsState state = displayFrames.mInsetsState;
sTmpRect.intersect(displayFrames.mDisplayCutoutSafe); sTmpRect.set(displayFrames.mDisplayCutoutSafe);
sTmpRect.top = windowFrames.mFrame.top; // Ignore top display cutout inset // The status bar content can extend into regular display cutout insets but not
sTmpRect.bottom = statusBarBottom; // Use collapsed status bar size // waterfall insets.
contentFrame.set(sTmpRect); sTmpRect.top = Math.max(state.getDisplayCutout().getWaterfallInsets().top, 0);
contentFrame.set(windowFrames.mFrame);
contentFrame.intersect(sTmpRect);
contentFrame.bottom = statusBarBottom; // Use collapsed status bar size
} }
private int layoutNavigationBar(DisplayFrames displayFrames, Rect contentFrame) { private int layoutNavigationBar(DisplayFrames displayFrames, Rect contentFrame) {