Loading core/java/com/android/internal/jank/Cuj.java +2 −14 Original line number Diff line number Diff line Loading @@ -313,17 +313,8 @@ public class Cuj { */ public static final int CUJ_DEFAULT_TASK_TO_TASK_ANIMATION = 128; /** * Track moving a window to another display in Desktop Windowing mode. * * <p>Tracking starts when the DesktopModeMoveToDisplayTransitionHandler starts animating the * task to move it to another display. This is triggered when the user presses a keyboard * shortcut or clicks the menu in the overview. Tracking ends when the animation completes.</p> */ public static final int CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY = 129; // When adding a CUJ, update this and make sure to also update CUJ_TO_STATSD_INTERACTION_TYPE. @VisibleForTesting static final int LAST_CUJ = CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY; @VisibleForTesting static final int LAST_CUJ = CUJ_DEFAULT_TASK_TO_TASK_ANIMATION; /** @hide */ @IntDef({ Loading Loading @@ -443,8 +434,7 @@ public class Cuj { CUJ_DESKTOP_MODE_KEYBOARD_QUICK_SWITCH_APP_LAUNCH, CUJ_LAUNCHER_WORK_UTILITY_VIEW_EXPAND, CUJ_LAUNCHER_WORK_UTILITY_VIEW_SHRINK, CUJ_DEFAULT_TASK_TO_TASK_ANIMATION, CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY CUJ_DEFAULT_TASK_TO_TASK_ANIMATION }) @Retention(RetentionPolicy.SOURCE) public @interface CujType {} Loading Loading @@ -827,8 +817,6 @@ public class Cuj { return "LAUNCHER_WORK_UTILITY_VIEW_SHRINK"; case CUJ_DEFAULT_TASK_TO_TASK_ANIMATION: return "DEFAULT_TASK_TO_TASK_ANIMATION"; case CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY: return "DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY"; } return "UNKNOWN"; } Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +2 −9 Original line number Diff line number Diff line Loading @@ -969,15 +969,8 @@ public abstract class WMShellModule { @WMSingleton @Provides static DesktopModeMoveToDisplayTransitionHandler provideMoveToDisplayTransitionHandler( InteractionJankMonitor interactionJankMonitor, @ShellMainThread Handler shellMainHandler, DisplayController displayController) { return new DesktopModeMoveToDisplayTransitionHandler( new SurfaceControl.Transaction(), interactionJankMonitor, shellMainHandler, displayController); static DesktopModeMoveToDisplayTransitionHandler provideMoveToDisplayTransitionHandler() { return new DesktopModeMoveToDisplayTransitionHandler(new SurfaceControl.Transaction()); } @WMSingleton Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeMoveToDisplayTransitionHandler.kt +2 −22 Original line number Diff line number Diff line Loading @@ -19,26 +19,19 @@ package com.android.wm.shell.desktopmode import android.animation.Animator import android.animation.AnimatorSet import android.animation.ValueAnimator import android.os.Handler import android.os.IBinder import android.view.Choreographer import android.view.SurfaceControl import android.window.TransitionInfo import android.window.TransitionRequestInfo import android.window.WindowContainerTransaction import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY import com.android.internal.jank.InteractionJankMonitor import com.android.wm.shell.common.DisplayController import com.android.wm.shell.shared.animation.Interpolators import com.android.wm.shell.transition.Transitions import kotlin.time.Duration.Companion.milliseconds /** Transition handler for moving a window to a different display. */ class DesktopModeMoveToDisplayTransitionHandler( private val animationTransaction: SurfaceControl.Transaction, private val interactionJankMonitor: InteractionJankMonitor, private val shellMainHandler: Handler, private val displayController: DisplayController, private val animationTransaction: SurfaceControl.Transaction ) : Transitions.TransitionHandler { override fun handleRequest( Loading Loading @@ -81,31 +74,18 @@ class DesktopModeMoveToDisplayTransitionHandler( } } ) animator.addListener( object : Animator.AnimatorListener { override fun onAnimationStart(animation: Animator) { val displayContext = displayController.getDisplayContext(changes[0].endDisplayId) if (displayContext == null) return interactionJankMonitor.begin( changes[0].leash, displayContext, shellMainHandler, CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY, ) } override fun onAnimationStart(animation: Animator) = Unit override fun onAnimationEnd(animation: Animator) { finishTransaction.apply() finishCallback.onTransitionFinished(null) interactionJankMonitor.end(CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY) } override fun onAnimationCancel(animation: Animator) { finishTransaction.apply() finishCallback.onTransitionFinished(null) interactionJankMonitor.cancel(CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY) } override fun onAnimationRepeat(animation: Animator) = Unit Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeMoveToDisplayTransitionHandlerTest.kt +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ class DesktopModeMoveToDisplayTransitionHandlerTest : ShellTestCase() { @Before fun setUp() { handler = DesktopModeMoveToDisplayTransitionHandler(StubTransaction(), mock(), mock(), mock()) handler = DesktopModeMoveToDisplayTransitionHandler(StubTransaction()) } @Test Loading Loading
core/java/com/android/internal/jank/Cuj.java +2 −14 Original line number Diff line number Diff line Loading @@ -313,17 +313,8 @@ public class Cuj { */ public static final int CUJ_DEFAULT_TASK_TO_TASK_ANIMATION = 128; /** * Track moving a window to another display in Desktop Windowing mode. * * <p>Tracking starts when the DesktopModeMoveToDisplayTransitionHandler starts animating the * task to move it to another display. This is triggered when the user presses a keyboard * shortcut or clicks the menu in the overview. Tracking ends when the animation completes.</p> */ public static final int CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY = 129; // When adding a CUJ, update this and make sure to also update CUJ_TO_STATSD_INTERACTION_TYPE. @VisibleForTesting static final int LAST_CUJ = CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY; @VisibleForTesting static final int LAST_CUJ = CUJ_DEFAULT_TASK_TO_TASK_ANIMATION; /** @hide */ @IntDef({ Loading Loading @@ -443,8 +434,7 @@ public class Cuj { CUJ_DESKTOP_MODE_KEYBOARD_QUICK_SWITCH_APP_LAUNCH, CUJ_LAUNCHER_WORK_UTILITY_VIEW_EXPAND, CUJ_LAUNCHER_WORK_UTILITY_VIEW_SHRINK, CUJ_DEFAULT_TASK_TO_TASK_ANIMATION, CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY CUJ_DEFAULT_TASK_TO_TASK_ANIMATION }) @Retention(RetentionPolicy.SOURCE) public @interface CujType {} Loading Loading @@ -827,8 +817,6 @@ public class Cuj { return "LAUNCHER_WORK_UTILITY_VIEW_SHRINK"; case CUJ_DEFAULT_TASK_TO_TASK_ANIMATION: return "DEFAULT_TASK_TO_TASK_ANIMATION"; case CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY: return "DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY"; } return "UNKNOWN"; } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +2 −9 Original line number Diff line number Diff line Loading @@ -969,15 +969,8 @@ public abstract class WMShellModule { @WMSingleton @Provides static DesktopModeMoveToDisplayTransitionHandler provideMoveToDisplayTransitionHandler( InteractionJankMonitor interactionJankMonitor, @ShellMainThread Handler shellMainHandler, DisplayController displayController) { return new DesktopModeMoveToDisplayTransitionHandler( new SurfaceControl.Transaction(), interactionJankMonitor, shellMainHandler, displayController); static DesktopModeMoveToDisplayTransitionHandler provideMoveToDisplayTransitionHandler() { return new DesktopModeMoveToDisplayTransitionHandler(new SurfaceControl.Transaction()); } @WMSingleton Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeMoveToDisplayTransitionHandler.kt +2 −22 Original line number Diff line number Diff line Loading @@ -19,26 +19,19 @@ package com.android.wm.shell.desktopmode import android.animation.Animator import android.animation.AnimatorSet import android.animation.ValueAnimator import android.os.Handler import android.os.IBinder import android.view.Choreographer import android.view.SurfaceControl import android.window.TransitionInfo import android.window.TransitionRequestInfo import android.window.WindowContainerTransaction import com.android.internal.jank.Cuj.CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY import com.android.internal.jank.InteractionJankMonitor import com.android.wm.shell.common.DisplayController import com.android.wm.shell.shared.animation.Interpolators import com.android.wm.shell.transition.Transitions import kotlin.time.Duration.Companion.milliseconds /** Transition handler for moving a window to a different display. */ class DesktopModeMoveToDisplayTransitionHandler( private val animationTransaction: SurfaceControl.Transaction, private val interactionJankMonitor: InteractionJankMonitor, private val shellMainHandler: Handler, private val displayController: DisplayController, private val animationTransaction: SurfaceControl.Transaction ) : Transitions.TransitionHandler { override fun handleRequest( Loading Loading @@ -81,31 +74,18 @@ class DesktopModeMoveToDisplayTransitionHandler( } } ) animator.addListener( object : Animator.AnimatorListener { override fun onAnimationStart(animation: Animator) { val displayContext = displayController.getDisplayContext(changes[0].endDisplayId) if (displayContext == null) return interactionJankMonitor.begin( changes[0].leash, displayContext, shellMainHandler, CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY, ) } override fun onAnimationStart(animation: Animator) = Unit override fun onAnimationEnd(animation: Animator) { finishTransaction.apply() finishCallback.onTransitionFinished(null) interactionJankMonitor.end(CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY) } override fun onAnimationCancel(animation: Animator) { finishTransaction.apply() finishCallback.onTransitionFinished(null) interactionJankMonitor.cancel(CUJ_DESKTOP_MODE_MOVE_WINDOW_TO_DISPLAY) } override fun onAnimationRepeat(animation: Animator) = Unit Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopModeMoveToDisplayTransitionHandlerTest.kt +1 −2 Original line number Diff line number Diff line Loading @@ -43,8 +43,7 @@ class DesktopModeMoveToDisplayTransitionHandlerTest : ShellTestCase() { @Before fun setUp() { handler = DesktopModeMoveToDisplayTransitionHandler(StubTransaction(), mock(), mock(), mock()) handler = DesktopModeMoveToDisplayTransitionHandler(StubTransaction()) } @Test Loading