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

Commit 6894ea37 authored by Pragya Bajoria's avatar Pragya Bajoria Committed by Android (Google) Code Review
Browse files

Merge "Remove the check of Transitions.ENABLE_SHELL_TRANSITIONS for desktop...

Merge "Remove the check of Transitions.ENABLE_SHELL_TRANSITIONS for desktop mode use-cases since the flag value is default true." into main
parents de0984d8 0a1d9f52
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -68,9 +68,7 @@ class DesktopModeLoggerTransitionObserver(
    private val idSequence: InstanceIdSequence by lazy { InstanceIdSequence(Int.MAX_VALUE) }

    init {
        if (
            Transitions.ENABLE_SHELL_TRANSITIONS && DesktopModeStatus.canEnterDesktopMode(context)
        ) {
        if (DesktopModeStatus.canEnterDesktopMode(context)) {
            shellInit.addInitCallback(this::onInit, this)
        }
    }
+24 −49
Original line number Diff line number Diff line
@@ -261,18 +261,13 @@ class DesktopTasksController(
        val wct = WindowContainerTransaction()
        bringDesktopAppsToFront(displayId, wct)

        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
        val transitionType = transitionType(remoteTransition)
            val handler =
                remoteTransition?.let {
        val handler = remoteTransition?.let {
            OneShotRemoteHandler(transitions.mainExecutor, remoteTransition)
        }
        transitions.startTransition(transitionType, wct, handler).also { t ->
            handler?.setTransition(t)
        }
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }
    }

    /** Gets number of visible tasks in [displayId]. */
@@ -388,12 +383,8 @@ class DesktopTasksController(
            bringDesktopAppsToFrontBeforeShowingNewTask(task.displayId, wct, task.taskId)
        addMoveToDesktopChanges(wct, task)

        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
        val transition = enterDesktopTaskTransitionHandler.moveToDesktop(wct, transitionSource)
        addPendingMinimizeTransition(transition, taskToMinimize)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }
    }

    /**
@@ -499,11 +490,9 @@ class DesktopTasksController(
        // Rather than set windowing mode to multi-window at task level, set it to
        // undefined and inherit from split stage.
        wct.setWindowingMode(task.token, WINDOWING_MODE_UNDEFINED)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {

        transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }

    }

    private fun exitSplitIfApplicable(wct: WindowContainerTransaction, taskInfo: RunningTaskInfo) {
@@ -537,17 +526,12 @@ class DesktopTasksController(
        val wct = WindowContainerTransaction()
        addMoveToFullscreenChanges(wct, task)

        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
        exitDesktopTaskTransitionHandler.startTransition(
                transitionSource,
                wct,
                position,
                mOnAnimationFinishedCallback
            )
        } else {
            shellTaskOrganizer.applyTransaction(wct)
            releaseVisualIndicator()
        }
    }

    /** Move a task to the front */
@@ -584,12 +568,9 @@ class DesktopTasksController(
        wct.reorder(taskInfo.token, true /* onTop */, true /* includingParents */)
        val taskToMinimize =
            addAndGetMinimizeChangesIfNeeded(taskInfo.displayId, wct, taskInfo.taskId)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {

        val transition = transitions.startTransition(TRANSIT_TO_FRONT, wct, null /* handler */)
        addPendingMinimizeTransition(transition, taskToMinimize)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }
    }

    /**
@@ -645,11 +626,9 @@ class DesktopTasksController(

        val wct = WindowContainerTransaction()
        wct.reparent(task.token, displayAreaInfo.token, true /* onTop */)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {

        transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }

    }

    /** Moves a task in/out of full immersive state within the desktop. */
@@ -733,11 +712,9 @@ class DesktopTasksController(

        taskbarDesktopTaskListener?.onTaskbarCornerRoundingUpdate(doesAnyTaskRequireTaskbarRounding)
        val wct = WindowContainerTransaction().setBounds(taskInfo.token, destinationBounds)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {

        toggleResizeDesktopTaskTransitionHandler.startTransition(wct)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }

    }

    private fun getMaximizeBounds(taskInfo: RunningTaskInfo, stableBounds: Rect): Rect {
@@ -847,11 +824,9 @@ class DesktopTasksController(

        taskbarDesktopTaskListener?.onTaskbarCornerRoundingUpdate(true)
        val wct = WindowContainerTransaction().setBounds(taskInfo.token, destinationBounds)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {

        toggleResizeDesktopTaskTransitionHandler.startTransition(wct, currentDragBounds)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }

    }

    @VisibleForTesting
+1 −3
Original line number Diff line number Diff line
@@ -48,9 +48,7 @@ class DesktopTasksTransitionObserver(
) : Transitions.TransitionObserver {

    init {
        if (
            Transitions.ENABLE_SHELL_TRANSITIONS && DesktopModeStatus.canEnterDesktopMode(context)
        ) {
        if (DesktopModeStatus.canEnterDesktopMode(context)) {
            shellInit.addInitCallback(::onInit, this)
        }
    }
+0 −8
Original line number Diff line number Diff line
@@ -99,11 +99,6 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener,
        state.mTaskInfo = taskInfo;
        state.mLeash = leash;
        mTasks.put(taskInfo.taskId, state);
        if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
            SurfaceControl.Transaction t = new SurfaceControl.Transaction();
            mWindowDecorationViewModel.onTaskOpening(taskInfo, leash, t, t);
            t.apply();
        }

        if (DesktopModeStatus.canEnterDesktopMode(mContext)) {
            mDesktopRepository.ifPresent(repository -> {
@@ -139,9 +134,6 @@ public class FreeformTaskListener implements ShellTaskOrganizer.TaskListener,
            });
        }
        mWindowDecorationViewModel.onTaskVanished(taskInfo);
        if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
            mWindowDecorationViewModel.destroyWindowDecoration(taskInfo);
        }
        updateLaunchAdjacentController();
    }

+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs
        mImmersiveTransitionHandler = immersiveTransitionHandler;
        mWindowDecorViewModel = windowDecorViewModel;
        mTaskChangeListener = taskChangeListener;
        if (Transitions.ENABLE_SHELL_TRANSITIONS && FreeformComponents.isFreeformEnabled(context)) {
        if (FreeformComponents.isFreeformEnabled(context)) {
            shellInit.addInitCallback(this::onInit, this);
        }
    }
Loading