From 77bfe0a7c41ac09f6a00f3d93635b1e7b5307ffe Mon Sep 17 00:00:00 2001 From: Beverly Date: Fri, 20 Mar 2020 08:58:00 -0400 Subject: [PATCH] Set default rotation in StatusBarWindowView to -1 So the view will update its orientation and padding when the orientation is first reported as 0 (ROTATION_NONE) Also handle case where an app may be letterboxing, so we should always add padding to the StatusBarWindowViews based on the safe inset Test: manual Fixes: 151735145 Change-Id: Ic40f305ff8eb83fe16691842b8b3897bdaad157c --- .../systemui/statusbar/phone/PhoneStatusBarView.java | 2 +- .../systemui/statusbar/phone/StatusBarWindowView.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index e25c14c86fd5b..6941eb8dc3693 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -64,7 +64,7 @@ public class PhoneStatusBarView extends PanelBar { } }; private DarkReceiver mBattery; - private int mRotationOrientation; + private int mRotationOrientation = -1; @Nullable private View mCenterIconSpace; @Nullable diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java index 760a6d6a71c34..c6f79831e022d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java @@ -99,11 +99,12 @@ public class StatusBarWindowView extends FrameLayout { } // padding needed for corner cutout. - int leftCornerCutoutPadding = 0; - int rightCornerCutoutPadding = 0; + int leftCornerCutoutPadding = cutout.getSafeInsetLeft(); + int rightCornerCutoutPadding = cutout.getSafeInsetRight(); if (cornerCutoutPadding != null) { - leftCornerCutoutPadding = cornerCutoutPadding.first; - rightCornerCutoutPadding = cornerCutoutPadding.second; + leftCornerCutoutPadding = Math.max(leftCornerCutoutPadding, cornerCutoutPadding.first); + rightCornerCutoutPadding = Math.max(rightCornerCutoutPadding, + cornerCutoutPadding.second); } return new Pair<>(