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

Commit 41698197 authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "Prevent pip launch during drag to desktop." into main

parents 681245f1 92eb4fa3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ class DesktopTasksController(
        interactionJankMonitor.begin(taskSurface, context, handler,
            CUJ_DESKTOP_MODE_ENTER_APP_HANDLE_DRAG_HOLD)
        dragToDesktopTransitionHandler.startDragToDesktopTransition(
            taskInfo.taskId,
            taskInfo,
            dragToDesktopValueAnimator
        )
    }
+9 −6
Original line number Diff line number Diff line
@@ -109,8 +109,8 @@ sealed class DragToDesktopTransitionHandler(
     * after one of the "end" or "cancel" transitions is merged into this transition.
     */
    fun startDragToDesktopTransition(
        taskId: Int,
        dragToDesktopAnimator: MoveToDesktopAnimator,
        taskInfo: RunningTaskInfo,
        dragToDesktopAnimator: MoveToDesktopAnimator
    ) {
        if (inProgress) {
            ProtoLog.v(
@@ -137,23 +137,26 @@ sealed class DragToDesktopTransitionHandler(
            )
        val wct = WindowContainerTransaction()
        wct.sendPendingIntent(pendingIntent, launchHomeIntent, Bundle())
        // The home launch done above will result in an attempt to move the task to pip if
        // applicable, resulting in a broken state. Prevent that here.
        wct.setDoNotPip(taskInfo.token)
        val startTransitionToken =
            transitions.startTransition(TRANSIT_DESKTOP_MODE_START_DRAG_TO_DESKTOP, wct, this)

        transitionState =
            if (isSplitTask(taskId)) {
            if (isSplitTask(taskInfo.taskId)) {
                val otherTask =
                    getOtherSplitTask(taskId)
                    getOtherSplitTask(taskInfo.taskId)
                        ?: throw IllegalStateException("Expected split task to have a counterpart.")
                TransitionState.FromSplit(
                    draggedTaskId = taskId,
                    draggedTaskId = taskInfo.taskId,
                    dragAnimator = dragToDesktopAnimator,
                    startTransitionToken = startTransitionToken,
                    otherSplitTask = otherTask
                )
            } else {
                TransitionState.FromFullscreen(
                    draggedTaskId = taskId,
                    draggedTaskId = taskInfo.taskId,
                    dragAnimator = dragToDesktopAnimator,
                    startTransitionToken = startTransitionToken
                )
+1 −1
Original line number Diff line number Diff line
@@ -581,7 +581,7 @@ class DragToDesktopTransitionHandlerTest : ShellTestCase() {
                )
            )
            .thenReturn(token)
        handler.startDragToDesktopTransition(task.taskId, dragAnimator)
        handler.startDragToDesktopTransition(task, dragAnimator)
        return token
    }