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

Commit e6cd51c9 authored by Ikram Gabiyev's avatar Ikram Gabiyev
Browse files

Increase epsilon for aspect ratio check

- Increase the epsilon check for aspect ratio change checks
on the Shell side to prevent constant non-config-at-end transitions
potentially conflicting with pinch-resizes (a better way of handling
config + non-config-at-end transitions would need to be laid out
long-term)

- Reset the mWaitingForAspectRatioChange flag upon pip transition state
changes if needed.

- Also change the interpolator for the resize animator

Bug: 377530560
Flag: com.android.wm.shell.enable_pip2
Test: enter YT PiP and pinch-resize repeatedly
Change-Id: I145a8a244c95dcb64da020ec3c6d2e00c71579cb
parent 70a45498
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ object PipUtils {
    private const val TAG = "PipUtils"

    // Minimum difference between two floats (e.g. aspect ratios) to consider them not equal.
    private const val EPSILON = 1e-7
    // TODO b/377530560: Restore epsilon once a long term fix is merged for non-config-at-end issue.
    private const val EPSILON = 0.05f

    /**
     * @return the ComponentName and user id of the top non-SystemUI activity in the pinned stack.
+2 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import androidx.annotation.Nullable;

import com.android.internal.annotations.VisibleForTesting;
import com.android.wm.shell.pip2.PipSurfaceTransactionHelper;
import com.android.wm.shell.shared.animation.Interpolators;

/**
 * Animator that handles any resize related animation for PIP.
@@ -128,6 +129,7 @@ public class PipResizeAnimator extends ValueAnimator {
        mRectEvaluator = new RectEvaluator(mAnimatedRect);

        setObjectValues(startBounds, endBounds);
        setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
        addListener(mAnimatorListener);
        addUpdateListener(mAnimatorUpdateListener);
        setEvaluator(mRectEvaluator);
+1 −0
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ public class PipTaskListener implements ShellTaskOrganizer.TaskListener,
                        "Leash is null for bounds transition.");

                if (mWaitingForAspectRatioChange) {
                    mWaitingForAspectRatioChange = false;
                    PipResizeAnimator animator = new PipResizeAnimator(mContext,
                            mPipTransitionState.mPinnedTaskLeash, startTx, finishTx,
                            destinationBounds,