Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf309e63 authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

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
parent c6df2ba0
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);
    }

    /**
+3 −1
Original line number Diff line number Diff line
@@ -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);