Loading libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +12 −0 Original line number Diff line number Diff line Loading @@ -2036,6 +2036,18 @@ class DesktopTasksController( ?.onTaskbarCornerRoundingUpdate(doesAnyTaskRequireTaskbarRounding(taskInfo.displayId)) } /** * Cancel the drag-to-desktop transition. * * @param taskInfo the task being dragged. */ fun onDragPositioningCancelThroughStatusBar( taskInfo: RunningTaskInfo, ) { interactionJankMonitor.cancel(CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_HOLD) cancelDragToDesktop(taskInfo) } /** * Perform checks required when drag ends under status bar area. * Loading libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +34 −29 Original line number Diff line number Diff line Loading @@ -1277,6 +1277,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { if (mTransitionDragActive) { final DesktopModeVisualIndicator.DragStartState dragStartState = Loading @@ -1291,32 +1292,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // Though this isn't a hover event, we need to update handle's hover state // as it likely will change. relevantDecor.updateHoverAndPressStatus(ev); DesktopModeVisualIndicator.IndicatorType resultType = mDesktopTasksController.onDragPositioningEndThroughStatusBar( new PointF(ev.getRawX(), ev.getRawY()), relevantDecor.mTaskInfo, relevantDecor.mTaskSurface); // If we are entering split select, handle will no longer be visible and // should not be receiving any input. if (resultType == TO_SPLIT_LEFT_INDICATOR || resultType == TO_SPLIT_RIGHT_INDICATOR) { relevantDecor.disposeStatusBarInputLayer(); // We should also dispose the other split task's input layer if // applicable. final int splitPosition = mSplitScreenController .getSplitPosition(relevantDecor.mTaskInfo.taskId); if (splitPosition != SPLIT_POSITION_UNDEFINED) { final int oppositePosition = splitPosition == SPLIT_POSITION_TOP_OR_LEFT ? SPLIT_POSITION_BOTTOM_OR_RIGHT : SPLIT_POSITION_TOP_OR_LEFT; final RunningTaskInfo oppositeTaskInfo = mSplitScreenController.getTaskInfo(oppositePosition); if (oppositeTaskInfo != null) { mWindowDecorByTaskId.get(oppositeTaskInfo.taskId) .disposeStatusBarInputLayer(); } } if (ev.getActionMasked() == ACTION_CANCEL) { mDesktopTasksController.onDragPositioningCancelThroughStatusBar( relevantDecor.mTaskInfo); } else { endDragToDesktop(ev, relevantDecor); } mMoveToDesktopAnimator = null; return; Loading Loading @@ -1365,10 +1345,35 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } break; } } } case MotionEvent.ACTION_CANCEL: { mTransitionDragActive = false; mMoveToDesktopAnimator = null; private void endDragToDesktop(MotionEvent ev, DesktopModeWindowDecoration relevantDecor) { DesktopModeVisualIndicator.IndicatorType resultType = mDesktopTasksController.onDragPositioningEndThroughStatusBar( new PointF(ev.getRawX(), ev.getRawY()), relevantDecor.mTaskInfo, relevantDecor.mTaskSurface); // If we are entering split select, handle will no longer be visible and // should not be receiving any input. if (resultType == TO_SPLIT_LEFT_INDICATOR || resultType == TO_SPLIT_RIGHT_INDICATOR) { relevantDecor.disposeStatusBarInputLayer(); // We should also dispose the other split task's input layer if // applicable. final int splitPosition = mSplitScreenController .getSplitPosition(relevantDecor.mTaskInfo.taskId); if (splitPosition != SPLIT_POSITION_UNDEFINED) { final int oppositePosition = splitPosition == SPLIT_POSITION_TOP_OR_LEFT ? SPLIT_POSITION_BOTTOM_OR_RIGHT : SPLIT_POSITION_TOP_OR_LEFT; final RunningTaskInfo oppositeTaskInfo = mSplitScreenController.getTaskInfo(oppositePosition); if (oppositeTaskInfo != null) { mWindowDecorByTaskId.get(oppositeTaskInfo.taskId) .disposeStatusBarInputLayer(); } } } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt +12 −0 Original line number Diff line number Diff line Loading @@ -2036,6 +2036,18 @@ class DesktopTasksController( ?.onTaskbarCornerRoundingUpdate(doesAnyTaskRequireTaskbarRounding(taskInfo.displayId)) } /** * Cancel the drag-to-desktop transition. * * @param taskInfo the task being dragged. */ fun onDragPositioningCancelThroughStatusBar( taskInfo: RunningTaskInfo, ) { interactionJankMonitor.cancel(CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_HOLD) cancelDragToDesktop(taskInfo) } /** * Perform checks required when drag ends under status bar area. * Loading
libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java +34 −29 Original line number Diff line number Diff line Loading @@ -1277,6 +1277,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: { if (mTransitionDragActive) { final DesktopModeVisualIndicator.DragStartState dragStartState = Loading @@ -1291,32 +1292,11 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, // Though this isn't a hover event, we need to update handle's hover state // as it likely will change. relevantDecor.updateHoverAndPressStatus(ev); DesktopModeVisualIndicator.IndicatorType resultType = mDesktopTasksController.onDragPositioningEndThroughStatusBar( new PointF(ev.getRawX(), ev.getRawY()), relevantDecor.mTaskInfo, relevantDecor.mTaskSurface); // If we are entering split select, handle will no longer be visible and // should not be receiving any input. if (resultType == TO_SPLIT_LEFT_INDICATOR || resultType == TO_SPLIT_RIGHT_INDICATOR) { relevantDecor.disposeStatusBarInputLayer(); // We should also dispose the other split task's input layer if // applicable. final int splitPosition = mSplitScreenController .getSplitPosition(relevantDecor.mTaskInfo.taskId); if (splitPosition != SPLIT_POSITION_UNDEFINED) { final int oppositePosition = splitPosition == SPLIT_POSITION_TOP_OR_LEFT ? SPLIT_POSITION_BOTTOM_OR_RIGHT : SPLIT_POSITION_TOP_OR_LEFT; final RunningTaskInfo oppositeTaskInfo = mSplitScreenController.getTaskInfo(oppositePosition); if (oppositeTaskInfo != null) { mWindowDecorByTaskId.get(oppositeTaskInfo.taskId) .disposeStatusBarInputLayer(); } } if (ev.getActionMasked() == ACTION_CANCEL) { mDesktopTasksController.onDragPositioningCancelThroughStatusBar( relevantDecor.mTaskInfo); } else { endDragToDesktop(ev, relevantDecor); } mMoveToDesktopAnimator = null; return; Loading Loading @@ -1365,10 +1345,35 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel, } break; } } } case MotionEvent.ACTION_CANCEL: { mTransitionDragActive = false; mMoveToDesktopAnimator = null; private void endDragToDesktop(MotionEvent ev, DesktopModeWindowDecoration relevantDecor) { DesktopModeVisualIndicator.IndicatorType resultType = mDesktopTasksController.onDragPositioningEndThroughStatusBar( new PointF(ev.getRawX(), ev.getRawY()), relevantDecor.mTaskInfo, relevantDecor.mTaskSurface); // If we are entering split select, handle will no longer be visible and // should not be receiving any input. if (resultType == TO_SPLIT_LEFT_INDICATOR || resultType == TO_SPLIT_RIGHT_INDICATOR) { relevantDecor.disposeStatusBarInputLayer(); // We should also dispose the other split task's input layer if // applicable. final int splitPosition = mSplitScreenController .getSplitPosition(relevantDecor.mTaskInfo.taskId); if (splitPosition != SPLIT_POSITION_UNDEFINED) { final int oppositePosition = splitPosition == SPLIT_POSITION_TOP_OR_LEFT ? SPLIT_POSITION_BOTTOM_OR_RIGHT : SPLIT_POSITION_TOP_OR_LEFT; final RunningTaskInfo oppositeTaskInfo = mSplitScreenController.getTaskInfo(oppositePosition); if (oppositeTaskInfo != null) { mWindowDecorByTaskId.get(oppositeTaskInfo.taskId) .disposeStatusBarInputLayer(); } } } } Loading