Improve launcher tracing around unfold animation
This will make it explicit in a trace when we're waiting for one additional frame after onResume to start processing unfold animation related progresses
Bug: 267287854
Test: recorded trace locally after unfolding
Change-Id: I3b13842f018c6f23cbb5bc1c1cfd77e5c38dad98
diff --git a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
index 170c622..fdbb119 100644
--- a/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
+++ b/quickstep/src/com/android/quickstep/util/LauncherUnfoldAnimationController.java
@@ -20,6 +20,7 @@
import static com.android.launcher3.LauncherAnimUtils.WORKSPACE_SCALE_PROPERTY_FACTORY;
import android.annotation.Nullable;
+import android.os.Trace;
import android.util.FloatProperty;
import android.util.MathUtils;
import android.view.WindowManager;
@@ -55,6 +56,9 @@
private final UnfoldMoveFromCenterHotseatAnimator mUnfoldMoveFromCenterHotseatAnimator;
private final UnfoldMoveFromCenterWorkspaceAnimator mUnfoldMoveFromCenterWorkspaceAnimator;
+ private static final String TRACE_WAIT_TO_HANDLE_UNFOLD_TRANSITION =
+ "waitingOneFrameBeforeHandlingUnfoldAnimation";
+
@Nullable
private HorizontalInsettableView mQsbInsettable;
@@ -92,8 +96,18 @@
mQsbInsettable = (HorizontalInsettableView) hotseat.getQsb();
}
+ handleTransitionOnNextFrame();
+ }
+
+ private void handleTransitionOnNextFrame() {
+ Trace.asyncTraceBegin(Trace.TRACE_TAG_APP,
+ TRACE_WAIT_TO_HANDLE_UNFOLD_TRANSITION, /* cookie= */ 0);
OneShotPreDrawListener.add(mLauncher.getWorkspace(),
- () -> mProgressProvider.setReadyToHandleTransition(true));
+ () -> {
+ Trace.asyncTraceEnd(Trace.TRACE_TAG_APP,
+ TRACE_WAIT_TO_HANDLE_UNFOLD_TRANSITION, /* cookie= */ 0);
+ mProgressProvider.setReadyToHandleTransition(true);
+ });
}
/**