OSDN Git Service

ScreenDecorations: Only draw cutout if requested
authorAdrian Roos <roosa@google.com>
Thu, 12 Apr 2018 08:13:48 +0000 (10:13 +0200)
committerAdrian Roos <roosa@google.com>
Thu, 12 Apr 2018 08:13:48 +0000 (10:13 +0200)
Change-Id: I149e9f7d8b1ec7164e717f713731c618cf2772c0
Fixes: 77798197
Test: set config_fillMainBuiltInDisplayCutout=false, verify no soft cutout gets drawn.

packages/SystemUI/src/com/android/systemui/ScreenDecorations.java

index a0fa69e..287819b 100644 (file)
@@ -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);