diff options
| -rw-r--r-- | core/java/com/android/internal/jank/Cuj.java | 13 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java | 8 |
2 files changed, 19 insertions, 2 deletions
diff --git a/core/java/com/android/internal/jank/Cuj.java b/core/java/com/android/internal/jank/Cuj.java index a52d33ab7c42..618f622cb9ce 100644 --- a/core/java/com/android/internal/jank/Cuj.java +++ b/core/java/com/android/internal/jank/Cuj.java @@ -155,8 +155,13 @@ public class Cuj { */ public static final int CUJ_FOLD_ANIM = 105; + /** + * Track window re-sizing interaction in desktop mode. + */ + public static final int CUJ_DESKTOP_MODE_RESIZE_WINDOW = 106; + // When adding a CUJ, update this and make sure to also update CUJ_TO_STATSD_INTERACTION_TYPE. - @VisibleForTesting static final int LAST_CUJ = CUJ_FOLD_ANIM; + @VisibleForTesting static final int LAST_CUJ = CUJ_DESKTOP_MODE_RESIZE_WINDOW; /** @hide */ @IntDef({ @@ -253,7 +258,8 @@ public class Cuj { CUJ_LAUNCHER_PRIVATE_SPACE_LOCK, CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK, CUJ_DESKTOP_MODE_MAXIMIZE_WINDOW, - CUJ_FOLD_ANIM + CUJ_FOLD_ANIM, + CUJ_DESKTOP_MODE_RESIZE_WINDOW }) @Retention(RetentionPolicy.SOURCE) public @interface CujType {} @@ -361,6 +367,7 @@ public class Cuj { CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_LAUNCHER_PRIVATE_SPACE_UNLOCK] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__LAUNCHER_PRIVATE_SPACE_UNLOCK; CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_DESKTOP_MODE_MAXIMIZE_WINDOW] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__DESKTOP_MODE_MAXIMIZE_WINDOW; CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_FOLD_ANIM] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__FOLD_ANIM; + CUJ_TO_STATSD_INTERACTION_TYPE[CUJ_DESKTOP_MODE_RESIZE_WINDOW] = FrameworkStatsLog.UIINTERACTION_FRAME_INFO_REPORTED__INTERACTION_TYPE__DESKTOP_MODE_RESIZE_WINDOW; } private Cuj() { @@ -567,6 +574,8 @@ public class Cuj { return "DESKTOP_MODE_MAXIMIZE_WINDOW"; case CUJ_FOLD_ANIM: return "FOLD_ANIM"; + case CUJ_DESKTOP_MODE_RESIZE_WINDOW: + return "DESKTOP_MODE_RESIZE_WINDOW"; } return "UNKNOWN"; } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java index 5fce5d228d71..956d04c548f7 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/VeiledResizeTaskPositioner.java @@ -18,6 +18,8 @@ package com.android.wm.shell.windowdecor; import static android.view.WindowManager.TRANSIT_CHANGE; +import static com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_RESIZE_WINDOW; + import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; @@ -33,6 +35,7 @@ import androidx.annotation.Nullable; import com.android.wm.shell.ShellTaskOrganizer; import com.android.wm.shell.common.DisplayController; +import com.android.wm.shell.common.InteractionJankMonitorUtils; import com.android.wm.shell.transition.Transitions; import java.util.function.Supplier; @@ -89,6 +92,10 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, mDesktopWindowDecoration.mTaskInfo.configuration.windowConfiguration.getBounds()); mRepositionStartPoint.set(x, y); if (isResizing()) { + // Capture CUJ for re-sizing window in DW mode. + InteractionJankMonitorUtils.beginTracing(CUJ_DESKTOP_MODE_RESIZE_WINDOW, + mDesktopWindowDecoration.mContext, mDesktopWindowDecoration.mTaskSurface, + /* tag= */ null); if (!mDesktopWindowDecoration.mTaskInfo.isFocused) { WindowContainerTransaction wct = new WindowContainerTransaction(); wct.reorder(mDesktopWindowDecoration.mTaskInfo.token, true); @@ -146,6 +153,7 @@ public class VeiledResizeTaskPositioner implements DragPositioningCallback, // won't be called. resetVeilIfVisible(); } + InteractionJankMonitorUtils.endTracing(CUJ_DESKTOP_MODE_RESIZE_WINDOW); } else { final WindowContainerTransaction wct = new WindowContainerTransaction(); DragPositioningCallbackUtility.updateTaskBounds(mRepositionTaskBounds, |