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

Commit a90f6e05 authored by Sergey Nikolaienkov's avatar Sergey Nikolaienkov Committed by Android (Google) Code Review
Browse files

Merge "Fix checking if PiP aspect ratio has changed"

parents 4b0d128b 600fe829
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.util.Log;
import android.util.Rational;
import android.util.Size;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
@@ -684,13 +685,16 @@ public class PipTaskOrganizer extends TaskOrganizer implements ShellTaskOrganize
     * {@link PictureInPictureParams} would affect the bounds.
     */
    private boolean applyPictureInPictureParams(@NonNull PictureInPictureParams params) {
        final boolean changed = (mPictureInPictureParams == null) || !Objects.equals(
                mPictureInPictureParams.getAspectRatioRational(), params.getAspectRatioRational());
        if (changed) {
        final Rational currentAspectRatio =
                mPictureInPictureParams != null ? mPictureInPictureParams.getAspectRatioRational()
                        : null;
        final boolean aspectRatioChanged = !Objects.equals(currentAspectRatio,
                params.getAspectRatioRational());
        mPictureInPictureParams = params;
        if (aspectRatioChanged) {
            mPipBoundsHandler.onAspectRatioChanged(params.getAspectRatio());
        }
        return changed;
        return aspectRatioChanged;
    }

    /**