Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −3 Original line number Original line Diff line number Diff line Loading @@ -2506,7 +2506,6 @@ class DesktopTasksController( * * * @param taskInfo the task being dragged. * @param taskInfo the task being dragged. * @param taskSurface the leash of the task being dragged. * @param taskSurface the leash of the task being dragged. * @param position position of surface when drag ends. * @param inputCoordinate the coordinates of the motion event * @param inputCoordinate the coordinates of the motion event * @param currentDragBounds the current bounds of where the visible task is (might be actual * @param currentDragBounds the current bounds of where the visible task is (might be actual * task bounds or just task leash) * task bounds or just task leash) Loading @@ -2516,7 +2515,6 @@ class DesktopTasksController( fun onDragPositioningEnd( fun onDragPositioningEnd( taskInfo: RunningTaskInfo, taskInfo: RunningTaskInfo, taskSurface: SurfaceControl, taskSurface: SurfaceControl, position: Point, inputCoordinate: PointF, inputCoordinate: PointF, currentDragBounds: Rect, currentDragBounds: Rect, validDragArea: Rect, validDragArea: Rect, Loading Loading @@ -2544,7 +2542,7 @@ class DesktopTasksController( ) ) moveToFullscreenWithAnimation( moveToFullscreenWithAnimation( taskInfo, taskInfo, position, Point(currentDragBounds.left, currentDragBounds.top), DesktopModeTransitionSource.TASK_DRAG, DesktopModeTransitionSource.TASK_DRAG, ) ) } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +1 −7 Original line number Original line Diff line number Diff line Loading @@ -1225,12 +1225,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mDragPointerId = e.getPointerId(0); mDragPointerId = e.getPointerId(0); } } final int dragPointerIdx = e.findPointerIndex(mDragPointerId); final int dragPointerIdx = e.findPointerIndex(mDragPointerId); // Position of the task is calculated by subtracting the raw location of the // motion event (the location of the motion relative to the display) by the // location of the motion event relative to the task's bounds final Point position = new Point( (int) (e.getRawX(dragPointerIdx) - e.getX(dragPointerIdx)), (int) (e.getRawY(dragPointerIdx) - e.getY(dragPointerIdx))); final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( e.getDisplayId(), e.getDisplayId(), e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); Loading @@ -1238,7 +1232,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // DesktopTasksController to allow secondary transformations (i.e. snap resizing // DesktopTasksController to allow secondary transformations (i.e. snap resizing // or transforming to fullscreen) before setting new task bounds. // or transforming to fullscreen) before setting new task bounds. mDesktopTasksController.onDragPositioningEnd( mDesktopTasksController.onDragPositioningEnd( taskInfo, decoration.mTaskSurface, position, taskInfo, decoration.mTaskSurface, new PointF(e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)), new PointF(e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)), newTaskBounds, decoration.calculateValidDragArea(), newTaskBounds, decoration.calculateValidDragArea(), new Rect(mOnDragStartInitialBounds), e, new Rect(mOnDragStartInitialBounds), e, Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +0 −6 Original line number Original line Diff line number Diff line Loading @@ -3707,7 +3707,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, -100), inputCoordinate = PointF(200f, -200f), inputCoordinate = PointF(200f, -200f), currentDragBounds = Rect(100, -100, 500, 1000), currentDragBounds = Rect(100, -100, 500, 1000), validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3746,7 +3745,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 200), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = currentDragBounds, currentDragBounds = currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3787,7 +3785,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 200), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds, currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3829,7 +3826,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = Rect(100, 50, 500, 1000), currentDragBounds = Rect(100, 50, 500, 1000), validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3868,7 +3864,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds, currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3925,7 +3920,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = currentDragBounds, currentDragBounds = currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +1 −3 Original line number Original line Diff line number Diff line Loading @@ -2506,7 +2506,6 @@ class DesktopTasksController( * * * @param taskInfo the task being dragged. * @param taskInfo the task being dragged. * @param taskSurface the leash of the task being dragged. * @param taskSurface the leash of the task being dragged. * @param position position of surface when drag ends. * @param inputCoordinate the coordinates of the motion event * @param inputCoordinate the coordinates of the motion event * @param currentDragBounds the current bounds of where the visible task is (might be actual * @param currentDragBounds the current bounds of where the visible task is (might be actual * task bounds or just task leash) * task bounds or just task leash) Loading @@ -2516,7 +2515,6 @@ class DesktopTasksController( fun onDragPositioningEnd( fun onDragPositioningEnd( taskInfo: RunningTaskInfo, taskInfo: RunningTaskInfo, taskSurface: SurfaceControl, taskSurface: SurfaceControl, position: Point, inputCoordinate: PointF, inputCoordinate: PointF, currentDragBounds: Rect, currentDragBounds: Rect, validDragArea: Rect, validDragArea: Rect, Loading Loading @@ -2544,7 +2542,7 @@ class DesktopTasksController( ) ) moveToFullscreenWithAnimation( moveToFullscreenWithAnimation( taskInfo, taskInfo, position, Point(currentDragBounds.left, currentDragBounds.top), DesktopModeTransitionSource.TASK_DRAG, DesktopModeTransitionSource.TASK_DRAG, ) ) } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +1 −7 Original line number Original line Diff line number Diff line Loading @@ -1225,12 +1225,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, mDragPointerId = e.getPointerId(0); mDragPointerId = e.getPointerId(0); } } final int dragPointerIdx = e.findPointerIndex(mDragPointerId); final int dragPointerIdx = e.findPointerIndex(mDragPointerId); // Position of the task is calculated by subtracting the raw location of the // motion event (the location of the motion relative to the display) by the // location of the motion event relative to the task's bounds final Point position = new Point( (int) (e.getRawX(dragPointerIdx) - e.getX(dragPointerIdx)), (int) (e.getRawY(dragPointerIdx) - e.getY(dragPointerIdx))); final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( final Rect newTaskBounds = mDragPositioningCallback.onDragPositioningEnd( e.getDisplayId(), e.getDisplayId(), e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)); Loading @@ -1238,7 +1232,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // DesktopTasksController to allow secondary transformations (i.e. snap resizing // DesktopTasksController to allow secondary transformations (i.e. snap resizing // or transforming to fullscreen) before setting new task bounds. // or transforming to fullscreen) before setting new task bounds. mDesktopTasksController.onDragPositioningEnd( mDesktopTasksController.onDragPositioningEnd( taskInfo, decoration.mTaskSurface, position, taskInfo, decoration.mTaskSurface, new PointF(e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)), new PointF(e.getRawX(dragPointerIdx), e.getRawY(dragPointerIdx)), newTaskBounds, decoration.calculateValidDragArea(), newTaskBounds, decoration.calculateValidDragArea(), new Rect(mOnDragStartInitialBounds), e, new Rect(mOnDragStartInitialBounds), e, Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt +0 −6 Original line number Original line Diff line number Diff line Loading @@ -3707,7 +3707,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, -100), inputCoordinate = PointF(200f, -200f), inputCoordinate = PointF(200f, -200f), currentDragBounds = Rect(100, -100, 500, 1000), currentDragBounds = Rect(100, -100, 500, 1000), validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3746,7 +3745,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 200), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = currentDragBounds, currentDragBounds = currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3787,7 +3785,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 200), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds, currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3829,7 +3826,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = Rect(100, 50, 500, 1000), currentDragBounds = Rect(100, 50, 500, 1000), validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3868,7 +3864,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds, currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading Loading @@ -3925,7 +3920,6 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase() spyController.onDragPositioningEnd( spyController.onDragPositioningEnd( task, task, mockSurface, mockSurface, position = Point(100, 50), inputCoordinate = PointF(200f, 300f), inputCoordinate = PointF(200f, 300f), currentDragBounds = currentDragBounds, currentDragBounds = currentDragBounds, validDragArea = Rect(0, 50, 2000, 2000), validDragArea = Rect(0, 50, 2000, 2000), Loading