Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +5 −1 Original line number Diff line number Diff line Loading @@ -913,7 +913,10 @@ class DesktopTasksController( destinationBounds.height(), displayController, ) toggleResizeDesktopTaskTransitionHandler.startTransition(wct) toggleResizeDesktopTaskTransitionHandler.startTransition( wct, interaction.animationStartBounds, ) } private fun dragToMaximizeDesktopTask( Loading Loading @@ -944,6 +947,7 @@ class DesktopTasksController( direction = ToggleTaskSizeInteraction.Direction.MAXIMIZE, source = ToggleTaskSizeInteraction.Source.HEADER_DRAG_TO_TOP, inputMethod = DesktopModeEventLogger.getInputMethodFromMotionEvent(motionEvent), animationStartBounds = currentDragBounds, ), ) } Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/common/ToggleTaskSizeUtils.kt +5 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.wm.shell.desktopmode.common import android.graphics.Rect import com.android.internal.jank.Cuj import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.InputMethod import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ResizeTrigger Loading @@ -23,10 +24,13 @@ import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction.Ambiguo import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction.Source /** Represents a user interaction to toggle a desktop task's size from to maximize or vice versa. */ data class ToggleTaskSizeInteraction( data class ToggleTaskSizeInteraction @JvmOverloads constructor( val direction: Direction, val source: Source, val inputMethod: InputMethod, val animationStartBounds: Rect? = null, ) { constructor( isMaximized: Boolean, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +3 −2 Original line number Diff line number Diff line Loading @@ -3062,20 +3062,21 @@ class DesktopTasksControllerTest : ShellTestCase() { .thenReturn(DesktopModeVisualIndicator.IndicatorType.TO_FULLSCREEN_INDICATOR) // Drag move the task to the top edge val currentDragBounds = Rect(100, 50, 500, 1000) spyController.onDragPositioningMove(task, mockSurface, 200f, Rect(100, 200, 500, 1000)) spyController.onDragPositioningEnd( task, mockSurface, Point(100, 50), /* position */ PointF(200f, 300f), /* inputCoordinate */ Rect(100, 50, 500, 1000), /* currentDragBounds */ currentDragBounds, Rect(0, 50, 2000, 2000) /* validDragArea */, Rect() /* dragStartBounds */, motionEvent, desktopWindowDecoration) // Assert bounds set to stable bounds val wct = getLatestToggleResizeDesktopTaskWct() val wct = getLatestToggleResizeDesktopTaskWct(currentDragBounds) assertThat(findBoundsChange(wct, task)).isEqualTo(STABLE_BOUNDS) // Assert event is properly logged verify(desktopModeEventLogger, times(1)).logTaskResizingStarted( Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +5 −1 Original line number Diff line number Diff line Loading @@ -913,7 +913,10 @@ class DesktopTasksController( destinationBounds.height(), displayController, ) toggleResizeDesktopTaskTransitionHandler.startTransition(wct) toggleResizeDesktopTaskTransitionHandler.startTransition( wct, interaction.animationStartBounds, ) } private fun dragToMaximizeDesktopTask( Loading Loading @@ -944,6 +947,7 @@ class DesktopTasksController( direction = ToggleTaskSizeInteraction.Direction.MAXIMIZE, source = ToggleTaskSizeInteraction.Source.HEADER_DRAG_TO_TOP, inputMethod = DesktopModeEventLogger.getInputMethodFromMotionEvent(motionEvent), animationStartBounds = currentDragBounds, ), ) } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/common/ToggleTaskSizeUtils.kt +5 −1 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.wm.shell.desktopmode.common import android.graphics.Rect import com.android.internal.jank.Cuj import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.InputMethod import com.android.wm.shell.desktopmode.DesktopModeEventLogger.Companion.ResizeTrigger Loading @@ -23,10 +24,13 @@ import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction.Ambiguo import com.android.wm.shell.desktopmode.common.ToggleTaskSizeInteraction.Source /** Represents a user interaction to toggle a desktop task's size from to maximize or vice versa. */ data class ToggleTaskSizeInteraction( data class ToggleTaskSizeInteraction @JvmOverloads constructor( val direction: Direction, val source: Source, val inputMethod: InputMethod, val animationStartBounds: Rect? = null, ) { constructor( isMaximized: Boolean, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +3 −2 Original line number Diff line number Diff line Loading @@ -3062,20 +3062,21 @@ class DesktopTasksControllerTest : ShellTestCase() { .thenReturn(DesktopModeVisualIndicator.IndicatorType.TO_FULLSCREEN_INDICATOR) // Drag move the task to the top edge val currentDragBounds = Rect(100, 50, 500, 1000) spyController.onDragPositioningMove(task, mockSurface, 200f, Rect(100, 200, 500, 1000)) spyController.onDragPositioningEnd( task, mockSurface, Point(100, 50), /* position */ PointF(200f, 300f), /* inputCoordinate */ Rect(100, 50, 500, 1000), /* currentDragBounds */ currentDragBounds, Rect(0, 50, 2000, 2000) /* validDragArea */, Rect() /* dragStartBounds */, motionEvent, desktopWindowDecoration) // Assert bounds set to stable bounds val wct = getLatestToggleResizeDesktopTaskWct() val wct = getLatestToggleResizeDesktopTaskWct(currentDragBounds) assertThat(findBoundsChange(wct, task)).isEqualTo(STABLE_BOUNDS) // Assert event is properly logged verify(desktopModeEventLogger, times(1)).logTaskResizingStarted( Loading