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

Commit 1a3298cb authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Put PiP layer behind input consumer when resize

Put PiP layer behind input consumer in z-order when resize happens,
the input events would go into the app otherwise.

Flag: com.android.wm.shell.enable_pip2
Bug: 415904533
Test: Manually, tap with one finger and quickly try to move with the 2nd
Test: atest com.android.wm.shell.pip2.PipSurfaceTransactionHelperTest
Change-Id: I0a0925c2d817954677491ab289134c67dd8280a1
parent 8d4ac3cd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -242,7 +242,9 @@ public class PipSurfaceTransactionHelper {

        round(outTransaction, leash, baseBounds, toBounds);
        outTransaction.setMatrix(leash, mTmpTransform, mTmpFloat9);
        outTransaction.setLayer(leash, Integer.MAX_VALUE);
        // Note: Put this at layer=MAX_VALUE-2 since the input consumer for PIP is placed at
        //       MAX_VALUE-1
        outTransaction.setLayer(leash, Integer.MAX_VALUE - 2);
        return this;
    }

+3 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static org.mockito.AdditionalMatchers.aryEq;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyFloat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.intThat;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -232,6 +233,7 @@ public class PipSurfaceTransactionHelperTest {
                PIP_BOUNDS, 0);

        verify(mMockTransaction).setMatrix(eq(mTestLeash), any(), any());
        verify(mMockTransaction).setLayer(eq(mTestLeash), eq(Integer.MAX_VALUE));
        verify(mMockTransaction).setLayer(eq(mTestLeash),
                intThat((layer) -> layer < Integer.MAX_VALUE));
    }
}