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

Commit 5aea8675 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with no rounded corners on PIP

- Existing code dependend on SysUI config listeners making an extra
  density change callback when registering a config listener, but
  we should explicitly update the resources when creating the
  helper class as well

Bug: 239689748
Test: Enter pip, see it has rounded corners
Change-Id: I673e561567de91da40d02a87a4571b56794efbfe
parent 27eb1be0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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
+4 −0
Original line number Diff line number Diff line
@@ -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
     *
+4 −4
Original line number Diff line number Diff line
@@ -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