From a762b02418695f5a1ff2f96586660de8c3610280 Mon Sep 17 00:00:00 2001 From: vadimt Date: Fri, 2 Oct 2020 13:56:28 -0700 Subject: [PATCH] Annotating Quick Switch CUJ for non-3-button modes Bug: 169221288 Change-Id: I7145a9e28a2f0a789d19d2a0e3d15630c6e50f6a --- .../src/com/android/quickstep/AbsSwipeUpHandler.java | 10 ++++++++-- .../android/quickstep/RecentsAnimationController.java | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) 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); }