diff options
| author | Winson Chung <winsonc@google.com> | 2020-09-23 19:30:13 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-09-23 19:30:13 +0000 |
| commit | 005bfa11868c95d5a8837583f794a950e7ebe349 (patch) | |
| tree | 2eabe35931736f9ac0eab0ebb02ee80df1430865 /core/java | |
| parent | ee82d4a0d0b01ff3a651607d91a8f04cfe30bef4 (diff) | |
| parent | f95fad0461841cc2e0d14b4e8adaac8eadc87f00 (diff) | |
Merge "Account for cutouts in system insets (as done previously)"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/policy/DecorView.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/core/java/com/android/internal/policy/DecorView.java b/core/java/com/android/internal/policy/DecorView.java index 1f8a829aaacd..4512fbac38c1 100644 --- a/core/java/com/android/internal/policy/DecorView.java +++ b/core/java/com/android/internal/policy/DecorView.java @@ -1105,15 +1105,18 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind : controller.getSystemBarsAppearance(); 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, getResources().getConfiguration().windowConfiguration.getWindowingMode()); - mLastTopInset = clearCompatInsets ? 0 : systemBarInsets.top; - mLastBottomInset = clearCompatInsets ? 0 : systemBarInsets.bottom; - mLastRightInset = clearCompatInsets ? 0 : systemBarInsets.right; - mLastLeftInset = clearCompatInsets ? 0 : systemBarInsets.left; + final Insets stableBarInsets = insets.getInsetsIgnoringVisibility( + WindowInsets.Type.systemBars()); + final Insets systemInsets = clearCompatInsets + ? 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 // indicates that the window was either just added and received them for the |
