From 91d99268048b657e1dfabed4f1dd3d484d606592 Mon Sep 17 00:00:00 2001 From: Luca Zuccarini Date: Wed, 23 Nov 2022 16:09:46 +0000 Subject: [PATCH] Add CUJs for closing All Apps. CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME is meant to be the CUJ for closing All Apps through the home gesture/home button, which has different animations from closing apps in the same way. By contrast, CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE is the finger-tracking transition that dismisses All Apps by swiping down. Bug: 260218332 Test: recorded prefetto trace while closing All Apps, see bug Change-Id: Ie0403471d61eea9dd251fe214ce7bd8f78f3bfdc --- .../internal/jank/InteractionJankMonitor.java | 14 +++++++++++++- .../system/InteractionJankMonitorWrapper.java | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/java/com/android/internal/jank/InteractionJankMonitor.java b/core/java/com/android/internal/jank/InteractionJankMonitor.java index 39b9e217fce70..d8afe50d3af3f 100644 --- a/core/java/com/android/internal/jank/InteractionJankMonitor.java +++ b/core/java/com/android/internal/jank/InteractionJankMonitor.java @@ -28,6 +28,8 @@ import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_IN import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_LAUNCH_FROM_RECENTS; import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_LAUNCH_FROM_WIDGET; import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_SWIPE_TO_RECENTS; +import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_SWIPE; +import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_TO_HOME; import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_OPEN_ALL_APPS; import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_QUICK_SWITCH; import static com.android.internal.util.FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_UNLOCK_ENTRANCE_ANIMATION; @@ -227,6 +229,8 @@ public class InteractionJankMonitor { public static final int CUJ_LOCKSCREEN_OCCLUSION = 64; public static final int CUJ_RECENTS_SCROLLING = 65; public static final int CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS = 66; + public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE = 67; + public static final int CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME = 68; private static final int NO_STATSD_LOGGING = -1; @@ -302,6 +306,8 @@ public class InteractionJankMonitor { UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LOCKSCREEN_OCCLUSION, UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__RECENTS_SCROLLING, UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_APP_SWIPE_TO_RECENTS, + UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_SWIPE, + UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_CLOSE_ALL_APPS_TO_HOME, }; private static volatile InteractionJankMonitor sInstance; @@ -388,7 +394,9 @@ public class InteractionJankMonitor { CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION, CUJ_LOCKSCREEN_OCCLUSION, CUJ_RECENTS_SCROLLING, - CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS + CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS, + CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE, + CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME }) @Retention(RetentionPolicy.SOURCE) public @interface CujType { @@ -905,6 +913,10 @@ public class InteractionJankMonitor { return "RECENTS_SCROLLING"; case CUJ_LAUNCHER_APP_SWIPE_TO_RECENTS: return "LAUNCHER_APP_SWIPE_TO_RECENTS"; + case CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE: + return "LAUNCHER_CLOSE_ALL_APPS_SWIPE"; + case CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME: + return "LAUNCHER_CLOSE_ALL_APPS_TO_HOME"; } return "UNKNOWN"; } diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java index 82d70116bbffb..e08a604338d2c 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/InteractionJankMonitorWrapper.java @@ -43,6 +43,10 @@ public final class InteractionJankMonitorWrapper { InteractionJankMonitor.CUJ_LAUNCHER_QUICK_SWITCH; public static final int CUJ_OPEN_ALL_APPS = InteractionJankMonitor.CUJ_LAUNCHER_OPEN_ALL_APPS; + public static final int CUJ_CLOSE_ALL_APPS_SWIPE = + InteractionJankMonitor.CUJ_LAUNCHER_CLOSE_ALL_APPS_SWIPE; + public static final int CUJ_CLOSE_ALL_APPS_TO_HOME = + InteractionJankMonitor.CUJ_LAUNCHER_CLOSE_ALL_APPS_TO_HOME; public static final int CUJ_ALL_APPS_SCROLL = InteractionJankMonitor.CUJ_LAUNCHER_ALL_APPS_SCROLL; public static final int CUJ_APP_LAUNCH_FROM_WIDGET = @@ -65,7 +69,10 @@ public final class InteractionJankMonitorWrapper { CUJ_APP_LAUNCH_FROM_WIDGET, CUJ_LAUNCHER_UNLOCK_ENTRANCE_ANIMATION, CUJ_RECENTS_SCROLLING, - CUJ_APP_SWIPE_TO_RECENTS + CUJ_APP_SWIPE_TO_RECENTS, + CUJ_OPEN_ALL_APPS, + CUJ_CLOSE_ALL_APPS_SWIPE, + CUJ_CLOSE_ALL_APPS_TO_HOME }) @Retention(RetentionPolicy.SOURCE) public @interface CujType {