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

Commit 04ff2e76 authored by Mateusz Cicheński's avatar Mateusz Cicheński Committed by Automerger Merge Worker
Browse files

Merge "Validate aspect ratio on PiP params change." into tm-qpr-dev am:...

Merge "Validate aspect ratio on PiP params change." into tm-qpr-dev am: 8975d9a0 am: 3f5d786f am: 27663eb7

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



Change-Id: Ic8fb3cab74abefde2bbf3a433d7a507c10bc5806
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3d1d55aa 27663eb7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ public class PipBoundsAlgorithm {
    /**
     * @return whether the given {@param aspectRatio} is valid.
     */
    private boolean isValidPictureInPictureAspectRatio(float aspectRatio) {
    public boolean isValidPictureInPictureAspectRatio(float aspectRatio) {
        return Float.compare(mMinAspectRatio, aspectRatio) <= 0
                && Float.compare(aspectRatio, mMaxAspectRatio) <= 0;
    }
+10 −1
Original line number Diff line number Diff line
@@ -1259,7 +1259,16 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
    protected void applyNewPictureInPictureParams(@NonNull PictureInPictureParams params) {
        if (mDeferredTaskInfo != null || PipUtils.aspectRatioChanged(params.getAspectRatioFloat(),
                mPictureInPictureParams.getAspectRatioFloat())) {
            if (mPipBoundsAlgorithm.isValidPictureInPictureAspectRatio(
                    params.getAspectRatioFloat())) {
                mPipParamsChangedForwarder.notifyAspectRatioChanged(params.getAspectRatioFloat());
            } else {
                ProtoLog.d(ShellProtoLogGroup.WM_SHELL_PICTURE_IN_PICTURE,
                        "%s: New aspect ratio is not valid."
                                + " hasAspectRatio=%b"
                                + " aspectRatio=%f",
                        TAG, params.hasSetAspectRatio(), params.getAspectRatioFloat());
            }
        }
        if (mDeferredTaskInfo != null
                || PipUtils.remoteActionsChanged(params.getActions(),