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

Commit 2f6dccab authored by mattsziklay's avatar mattsziklay
Browse files

Set windowing mode after animation on cancel transition.

Moves the windowing mode change to fullscreen after the
TRANSIT_CANCEL_ENTERING_DESKTOP_MODE animation finishes. This prevents
the home background from appearing at the start of the animation.

Bug: 280826960
Test: Manual, drag tasks from fullscreen, then move it back to status
bar in the same drag.

Change-Id: I3281fff75d812988952784c81ddc5ba1f3350ed4
parent bce8f132
Loading
Loading
Loading
Loading
+15 −6
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.IBinder
import android.os.SystemProperties
import android.util.DisplayMetrics.DENSITY_DEFAULT
import android.view.SurfaceControl
import android.view.SurfaceControl.Transaction
import android.view.WindowManager.TRANSIT_CHANGE
import android.view.WindowManager.TRANSIT_NONE
import android.view.WindowManager.TRANSIT_OPEN
@@ -272,11 +273,19 @@ class DesktopTasksController(
            task.taskId
        )
        val wct = WindowContainerTransaction()
        addMoveToFullscreenChanges(wct, task)
        wct.setBounds(task.token, null)

        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            enterDesktopTaskTransitionHandler.startCancelMoveToDesktopMode(wct, position,
                    mOnAnimationFinishedCallback)
            enterDesktopTaskTransitionHandler.startCancelMoveToDesktopMode(
                wct, position) { t ->
                val callbackWCT = WindowContainerTransaction()
                visualIndicator?.releaseVisualIndicator(t)
                visualIndicator = null
                addMoveToFullscreenChanges(callbackWCT, task)
                shellTaskOrganizer.applyTransaction(callbackWCT)
            }
        } else {
            addMoveToFullscreenChanges(wct, task)
            shellTaskOrganizer.applyTransaction(wct)
            releaseVisualIndicator()
        }
+1 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.wm.shell.desktopmode;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -200,7 +199,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
        }

        if (type == Transitions.TRANSIT_CANCEL_ENTERING_DESKTOP_MODE
                && taskInfo.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
                && taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM
                && mPosition != null) {
            // This Transition animates a task to fullscreen after being dragged from the status
            // bar and then released back into the status bar area