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

Commit ac5e95e7 authored by Hongwei Wang's avatar Hongwei Wang Committed by Android (Google) Code Review
Browse files

Merge "[1/N] Check destination against src aspect ratio" into main

parents f57a3b61 9f608cfa
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -221,8 +221,11 @@ public class PipBoundsAlgorithm {
                            + " than destination(%s)", sourceRectHint, destinationBounds);
            return false;
        }
        if (!PictureInPictureParams.isSameAspectRatio(sourceRectHint,
                new Rational(destinationBounds.width(), destinationBounds.height()))) {
        // We use the aspect ratio of source rect hint to check against destination bounds
        // here to avoid upscaling error.
        final Rational srcAspectRatio = new Rational(
                sourceRectHint.width(), sourceRectHint.height());
        if (!PictureInPictureParams.isSameAspectRatio(destinationBounds, srcAspectRatio)) {
            ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                    "isSourceRectHintValidForEnterPip=false, hint(%s) does not match"
                            + " destination(%s) aspect ratio", sourceRectHint, destinationBounds);