Merge "Apply PiP Params if there was a deferred info." into tm-dev am: 26b096d288

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

Change-Id: I5976db1686079339cdaafd1ceb384c834f37890a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Ben Lin
2022-05-18 22:42:40 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 2 deletions

View File

@@ -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(),

View File

@@ -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
*/