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

Commit efd82554 authored by Ben Lin's avatar Ben Lin
Browse files

Apply PiP Params if there was a deferred info.

If there was a deferred info, that means PiP params was saved but not
applied earlier. Force apply it.

Bug: 232104080
Test: Double tap on YouTube after exiting earlier Map PiP, aspect ratio
is correct

Change-Id: I52e9f38d4a923fdfee06e7ff37eb61a599caba04
parent db6650eb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1096,11 +1096,13 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
     * Handles all changes to the PictureInPictureParams.
     */
    protected void applyNewPictureInPictureParams(@NonNull PictureInPictureParams params) {
        if (PipUtils.aspectRatioChanged(params.getAspectRatioFloat(),
        if (mDeferredTaskInfo != null || PipUtils.aspectRatioChanged(params.getAspectRatioFloat(),
                mPictureInPictureParams.getAspectRatioFloat())) {
            mPipParamsChangedForwarder.notifyAspectRatioChanged(params.getAspectRatioFloat());
        }
        if (PipUtils.remoteActionsChanged(params.getActions(), mPictureInPictureParams.getActions())
        if (mDeferredTaskInfo != null
                || PipUtils.remoteActionsChanged(params.getActions(),
                mPictureInPictureParams.getActions())
                || !PipUtils.remoteActionsMatch(params.getCloseAction(),
                mPictureInPictureParams.getCloseAction())) {
            mPipParamsChangedForwarder.notifyActionsChanged(params.getActions(),
+12 −0
Original line number Diff line number Diff line
@@ -123,6 +123,18 @@ class ExpandPipOnDoubleClickTest(testSpec: FlickerTestParameter) : PipTransition
        }
    }

    @Presubmit
    @Test
    fun pipSameAspectRatio() {
        val layerName = pipApp.component.toLayerName()
        testSpec.assertLayers {
            val pipLayerList = this.layers { it.name.contains(layerName) && it.isVisible }
            pipLayerList.zipWithNext { previous, current ->
                current.visibleRegion.isSameAspectRatio(previous.visibleRegion)
            }
        }
    }

    /**
     * Checks [pipApp] window remains pinned throughout the animation
     */