summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Winson Chung <winsonc@google.com> 2020-09-24 16:45:18 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-09-24 16:45:18 +0000
commita03cd95a1204e53e31729197ccd00b736d2d01d0 (patch)
tree71ea24b8c3cb2d8764077c69c9c5b404e69aa1c8
parent35f3713bc0bfad251977d4ed215c07be67960f5e (diff)
parent7c7d7d4e25c377c065bd1ec6fbd6c9ec6fec0508 (diff)
Merge "Account for cutouts in system insets (as done previously)" into rvc-qpr-dev
-rw-r--r--core/java/com/android/internal/policy/DecorView.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java
index b12c5e9ba5b0..fbbf7916b31e 100644
--- a/core/java/com/android/internal/policy/DecorView.java
+++ b/core/java/com/android/internal/policy/DecorView.java
@@ -1094,13 +1094,15 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
mLastWindowFlags = attrs.flags;
if (insets != null) {
- final Insets systemBarInsets = insets.getInsets(WindowInsets.Type.systemBars());
final Insets stableBarInsets = insets.getInsetsIgnoringVisibility(
WindowInsets.Type.systemBars());
- mLastTopInset = systemBarInsets.top;
- mLastBottomInset = systemBarInsets.bottom;
- mLastRightInset = systemBarInsets.right;
- mLastLeftInset = systemBarInsets.left;
+ final Insets systemInsets = 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
// indicates that the window was either just added and received them for the