From c41b32baac6a9a2c8e4a6153232e0069a7d914b6 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 12 Apr 2018 10:13:48 +0200 Subject: [PATCH] ScreenDecorations: Only draw cutout if requested Change-Id: I149e9f7d8b1ec7164e717f713731c618cf2772c0 Fixes: 77798197 Test: set config_fillMainBuiltInDisplayCutout=false, verify no soft cutout gets drawn. --- .../src/com/android/systemui/ScreenDecorations.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java index a0fa69e61f203..287819bf95bd1 100644 --- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java +++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java @@ -207,7 +207,11 @@ public class ScreenDecorations extends SystemUI implements Tunable { } private boolean shouldDrawCutout() { - return mContext.getResources().getBoolean( + return shouldDrawCutout(mContext); + } + + static boolean shouldDrawCutout(Context context) { + return context.getResources().getBoolean( com.android.internal.R.bool.config_fillMainBuiltInDisplayCutout); } @@ -385,7 +389,7 @@ public class ScreenDecorations extends SystemUI implements Tunable { mBoundingRect.setEmpty(); mBoundingPath.reset(); int newVisible; - if (hasCutout()) { + if (shouldDrawCutout(getContext()) && hasCutout()) { mBounds.set(mInfo.displayCutout.getBounds()); localBounds(mBoundingRect); mInfo.displayCutout.getBounds().getBoundaryPath(mBoundingPath);