diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 5e05a7dbe1..1439d4e97c 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -715,6 +715,8 @@ public abstract class AbsSwipeUpHandler, Q extends @UiThread public void onGestureStarted(boolean isLikelyToStartNewTask) { + InteractionJankMonitorWrapper.begin( + InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH, 2000 /* ms timeout */); notifyGestureStartedAsync(); setIsLikelyToStartNewTask(isLikelyToStartNewTask, false /* animate */); mStateCallback.setStateOnUiThread(STATE_GESTURE_STARTED); @@ -790,7 +792,8 @@ public abstract class AbsSwipeUpHandler, Q extends } private void onSettledOnEndTarget() { - switch (mGestureState.getEndTarget()) { + final GestureEndTarget endTarget = mGestureState.getEndTarget(); + switch (endTarget) { case HOME: mStateCallback.setState(STATE_SCALED_CONTROLLER_HOME | STATE_CAPTURE_SCREENSHOT); // Notify swipe-to-home (recents animation) is finished @@ -807,7 +810,10 @@ public abstract class AbsSwipeUpHandler, Q extends mStateCallback.setState(STATE_RESUME_LAST_TASK); break; } - ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + mGestureState.getEndTarget()); + ActiveGestureLog.INSTANCE.addLog("onSettledOnEndTarget " + endTarget); + if (endTarget != NEW_TASK) { + InteractionJankMonitorWrapper.cancel(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); + } } /** @return Whether this was the task we were waiting to appear, and thus handled it. */ diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationController.java b/quickstep/src/com/android/quickstep/RecentsAnimationController.java index 51f5e5d785..798c12bcdc 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationController.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationController.java @@ -23,6 +23,7 @@ import androidx.annotation.UiThread; import com.android.launcher3.util.Preconditions; import com.android.systemui.shared.recents.model.ThumbnailData; +import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.RecentsAnimationControllerCompat; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; @@ -149,6 +150,7 @@ public class RecentsAnimationController { mOnFinishedListener.accept(this); UI_HELPER_EXECUTOR.execute(() -> { mController.finish(toRecents, sendUserLeaveHint); + InteractionJankMonitorWrapper.end(InteractionJankMonitorWrapper.CUJ_QUICK_SWITCH); if (callback != null) { MAIN_EXECUTOR.execute(callback); }