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

Commit ca383ffd authored by vadimt's avatar vadimt
Browse files

Postponing CUJ start by 1 frame

for CUJ_APP_LAUNCH_FROM_ICON, CUJ_APP_CLOSE_TO_HOME,
CUJ_APP_LAUNCH_FROM_WIDGET and CUJ_APP_LAUNCH_FROM_RECENTS

Test: Local perfetto run
Bug: 190858586
Change-Id: I7a26d91c44a0a4c767bde3230d39a096a26d7b75
parent 26cd946f
Loading
Loading
Loading
Loading
+37 −18
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import android.util.Size;
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.ViewTreeObserver;
import android.view.animation.Interpolator;
import android.view.animation.PathInterpolator;

@@ -366,7 +367,8 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
                public void onAnimationStart(Animator animation) {
                    mLauncher.addOnResumeCallback(() ->
                            ObjectAnimator.ofFloat(mLauncher.getDepthController(), DEPTH,
                            mLauncher.getStateManager().getState().getDepth(mLauncher)).start());
                                    mLauncher.getStateManager().getState().getDepth(
                                            mLauncher)).start());
                }
            });
        }
@@ -1217,7 +1219,24 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
        anim.addListener(new AnimationSuccessListener() {
            @Override
            public void onAnimationStart(Animator animation) {
                mDragLayer.getViewTreeObserver().addOnDrawListener(
                        new ViewTreeObserver.OnDrawListener() {
                            boolean mHandled = false;

                            @Override
                            public void onDraw() {
                                if (mHandled) {
                                    return;
                                }
                                mHandled = true;

                                InteractionJankMonitorWrapper.begin(mDragLayer, cuj);

                                mDragLayer.post(() ->
                                        mDragLayer.getViewTreeObserver().removeOnDrawListener(
                                                this));
                            }
                        });
                super.onAnimationStart(animation);
            }