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

Commit 4359d2b2 authored by Vania Desmonda's avatar Vania Desmonda
Browse files

Make PiP window always in front while dragging across displays.

Fixes: 414602812
Test: atest PipSurfaceTransactionHelperTest
Flag: com.android.window.flags.enable_dragging_pip_across_displays
Change-Id: I2cf434c6e40ff98418c5d86bcad5483a375d3627
parent d50fcd72
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -242,6 +242,7 @@ public class PipSurfaceTransactionHelper {

        round(outTransaction, leash, baseBounds, toBounds);
        outTransaction.setMatrix(leash, mTmpTransform, mTmpFloat9);
        outTransaction.setLayer(leash, Integer.MAX_VALUE);
        return this;
    }

+11 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import static org.mockito.Mockito.when;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Rect;
import android.gui.BorderSettings;
import android.gui.BoxShadowSettings;
import android.platform.test.annotations.EnableFlags;
@@ -62,6 +63,7 @@ public class PipSurfaceTransactionHelperTest {
    private static final int CORNER_RADIUS = 10;
    private static final int SHADOW_RADIUS = 20;
    private static final float MIRROR_OPACITY = 0.5f;
    private static final Rect PIP_BOUNDS = new Rect(0, 0, 500, 500);

    private final BoxShadowSettings mLightBoxShadowSettings = new BoxShadowSettings();
    private final BorderSettings mLightBorderSettings = new BorderSettings();
@@ -223,4 +225,13 @@ public class PipSurfaceTransactionHelperTest {
        verify(mMockTransaction).setLayer(eq(mTestLeash), eq(Integer.MAX_VALUE));
        verify(mMockTransaction).show(eq(mTestLeash));
    }

    @Test
    public void setPipTransformations_setsMatrixAndLayer() {
        mPipSurfaceTransactionHelper.setPipTransformations(mTestLeash, mMockTransaction, PIP_BOUNDS,
                PIP_BOUNDS, 0);

        verify(mMockTransaction).setMatrix(eq(mTestLeash), any(), any());
        verify(mMockTransaction).setLayer(eq(mTestLeash), eq(Integer.MAX_VALUE));
    }
}