Merge "Fix issue with no rounded corners on PIP" into tm-qpr-dev am: bb9d61264d

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19415864

Change-Id: Ibd09cd340ec23a80bf63de3151795f6e861c4e0f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Winson Chung
2022-07-27 06:34:22 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 6 deletions

View File

@@ -411,8 +411,8 @@ public abstract class WMShellBaseModule {
@WMSingleton
@Provides
static PipSurfaceTransactionHelper providePipSurfaceTransactionHelper() {
return new PipSurfaceTransactionHelper();
static PipSurfaceTransactionHelper providePipSurfaceTransactionHelper(Context context) {
return new PipSurfaceTransactionHelper(context);
}
@WMSingleton

View File

@@ -39,6 +39,10 @@ public class PipSurfaceTransactionHelper {
private int mCornerRadius;
private int mShadowRadius;
public PipSurfaceTransactionHelper(Context context) {
onDensityOrFontScaleChanged(context);
}
/**
* Called when display size or font size of settings changed
*

View File

@@ -37,6 +37,7 @@ import android.testing.TestableLooper;
import android.view.SurfaceControl;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import com.android.wm.shell.MockSurfaceControlHelper;
import com.android.wm.shell.ShellTestCase;
@@ -62,19 +63,18 @@ public class PipAnimationControllerTest extends ShellTestCase {
@Mock
private TaskInfo mTaskInfo;
@Mock
private PipAnimationController.PipAnimationCallback mPipAnimationCallback;
@Before
public void setUp() throws Exception {
mPipAnimationController = new PipAnimationController(
new PipSurfaceTransactionHelper());
MockitoAnnotations.initMocks(this);
mPipAnimationController = new PipAnimationController(new PipSurfaceTransactionHelper(
InstrumentationRegistry.getInstrumentation().getTargetContext()));
mLeash = new SurfaceControl.Builder()
.setContainerLayer()
.setName("FakeLeash")
.build();
MockitoAnnotations.initMocks(this);
}
@Test