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

Commit ec20cf81 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove unnecessary animation for an instant change

Otherwise a simple jump-cut position change still takes 336ms.
Except the duration keeps unnecessary animating state for no-op,
it may be easy to overlap with other operations.

It was migrated from I968280ae2915eb571b33a73a1f182228bc8fec74
But since shell transition only restores animation leash after
all animation of the transition are finished. So it no longer
needs an animation to preserve the visibility and layer.

Bug: 393364419
Flag: EXEMPT bugfix
Test: Drag freeform task several times in a short period.
      The previous position should not replace new position.
Change-Id: I9513937dab96aa8e1f20d0ae47fc44ee5926773d
parent 7479cb10
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@ import android.os.UserHandle;
import android.util.ArrayMap;
import android.view.SurfaceControl;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.window.TransitionInfo;
import android.window.TransitionMetrics;
@@ -858,9 +857,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                a = mTransitionAnimation.loadVoiceActivityExitAnimation(enter, userId);
            }
        } else if (changeMode == TRANSIT_CHANGE) {
            // In the absence of a specific adapter, we just want to keep everything stationary.
            a = new AlphaAnimation(1.f, 1.f);
            a.setDuration(TransitionAnimation.DEFAULT_APP_TRANSITION_DURATION);
            // Apply end state directly by default.
            return null;
        } else if (type == TRANSIT_RELAUNCH) {
            a = mTransitionAnimation.createRelaunchAnimation(endBounds, mInsets, endBounds);
        } else if (overrideType == ANIM_CUSTOM