From bf309e63d4deaca7b0946913ea18438f3bfee6d8 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Mon, 19 Apr 2021 16:01:23 -0400 Subject: [PATCH] Turn on rounded corners on PIP with a flag Bug: 163076219 Test: manual Use the flag "debug.sf.enable_hole_punch_pip" (also used by I56e2a6debce6ede4bebfcbd32bffa01c20461542 to activate using a hole punch to render the rounded corners) to turn on rounded corners even if config_pipEnableRoundCorner is set to false. This will allow testing the feature until we can turn it on. Change-Id: I2719f8ac151895874ab22e4cd7e64c9e1dc9eac8 --- .../com/android/wm/shell/pip/PipSurfaceTransactionHelper.java | 4 +++- .../Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java index 582ff2180c833..3dd97f565179e 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipSurfaceTransactionHelper.java @@ -21,6 +21,7 @@ import android.content.res.Resources; import android.graphics.Matrix; import android.graphics.Rect; import android.graphics.RectF; +import android.os.SystemProperties; import android.view.SurfaceControl; import com.android.wm.shell.R; @@ -42,7 +43,8 @@ public class PipSurfaceTransactionHelper { public PipSurfaceTransactionHelper(Context context) { final Resources res = context.getResources(); - mEnableCornerRadius = res.getBoolean(R.bool.config_pipEnableRoundCorner); + mEnableCornerRadius = res.getBoolean(R.bool.config_pipEnableRoundCorner) + || SystemProperties.getBoolean("debug.sf.enable_hole_punch_pip", false); } /** diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java index 3c25a13e94ebf..a57e8cdd09286 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMenuView.java @@ -44,6 +44,7 @@ import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.os.SystemProperties; import android.os.UserHandle; import android.util.Log; import android.util.Pair; @@ -131,7 +132,8 @@ public class PipMenuView extends FrameLayout { inflate(context, R.layout.pip_menu, this); final boolean enableCornerRadius = mContext.getResources() - .getBoolean(R.bool.config_pipEnableRoundCorner); + .getBoolean(R.bool.config_pipEnableRoundCorner) + || SystemProperties.getBoolean("debug.sf.enable_hole_punch_pip", false); mBackgroundDrawable = enableCornerRadius ? mContext.getDrawable(R.drawable.pip_menu_background) : new ColorDrawable(Color.BLACK);