Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19ed7fa5 authored by Ats Jenk's avatar Ats Jenk
Browse files

Allow dragging split tasks on foldables

Allow dragging from app handle on foldables where desktop is not
available, but app handle is available due to bubble feature.
Converting the task to different windowing modes will be supported by
future cls.

Bug: 388851898
Test: manual, set up apps in split screen, try to drag from handles
Flag: com.android.wm.shell.enable_bubble_to_fullscreen
Change-Id: Ied3512a2f84e6b5b5d1ae2cc7ff6338f50b19319
parent 0f6a9165
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -251,7 +251,8 @@ sealed class DragToDesktopTransitionHandler(
                (cancelState == CancelState.CANCEL_BUBBLE_LEFT ||
                    cancelState == CancelState.CANCEL_BUBBLE_RIGHT)
        ) {
            if (!bubbleController.isPresent) {
            if (bubbleController.isEmpty || state !is TransitionState.FromFullscreen) {
                // TODO(b/388853233): add support for dragging split task to bubble
                startCancelAnimation()
            } else {
                // Animation is handled by BubbleController
@@ -497,6 +498,11 @@ sealed class DragToDesktopTransitionHandler(
            state.cancelState == CancelState.CANCEL_BUBBLE_LEFT ||
                state.cancelState == CancelState.CANCEL_BUBBLE_RIGHT
        ) {
            if (bubbleController.isEmpty || state !is TransitionState.FromFullscreen) {
                // TODO(b/388853233): add support for dragging split task to bubble
                startCancelDragToDesktopTransition()
                return true
            }
            val taskInfo =
                state.draggedTaskChange?.taskInfo ?: error("Expected non-null task info.")
            val wct = WindowContainerTransaction()
+2 −5
Original line number Diff line number Diff line
@@ -1444,16 +1444,13 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                        relevantDecor.mTaskInfo.configuration.windowConfiguration.getBounds());
                boolean dragFromStatusBarAllowed = false;
                final int windowingMode = relevantDecor.mTaskInfo.getWindowingMode();
                if (DesktopModeStatus.canEnterDesktopMode(mContext)) {
                if (DesktopModeStatus.canEnterDesktopMode(mContext)
                        || BubbleAnythingFlagHelper.enableBubbleToFullscreen()) {
                    // In proto2 any full screen or multi-window task can be dragged to
                    // freeform.
                    dragFromStatusBarAllowed = windowingMode == WINDOWING_MODE_FULLSCREEN
                            || windowingMode == WINDOWING_MODE_MULTI_WINDOW;
                }
                if (BubbleAnythingFlagHelper.enableBubbleToFullscreen()) {
                    // TODO(b/388851898): add support for split screen (multi-window wm mode)
                    dragFromStatusBarAllowed = windowingMode == WINDOWING_MODE_FULLSCREEN;
                }
                final boolean shouldStartTransitionDrag =
                        relevantDecor.checkTouchEventInFocusedCaptionHandle(ev)
                                || DesktopModeFlags.ENABLE_HANDLE_INPUT_FIX.isTrue();