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

Commit 79aa62b4 authored by mattsziklay's avatar mattsziklay Committed by Matt Sziklay
Browse files

Move VisualIndicator logic to a separate UI thread.

Moves the indicator logic to ShellDesktopThread in order to free up
the main thread.

Additionally, moves view-related logic to a separate class.

Bug: 366413536
Test: perfetto, manual
Flag: com.android.window.flags.enable_desktop_windowing_mode
Change-Id: I265fa3414592e81e8c08d08d8cb60d76b5b9cb96
parent 44a905df
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -134,6 +134,7 @@ import com.android.wm.shell.recents.RecentsTransitionHandler;
import com.android.wm.shell.shared.TransactionPool;
import com.android.wm.shell.shared.TransactionPool;
import com.android.wm.shell.shared.annotations.ShellAnimationThread;
import com.android.wm.shell.shared.annotations.ShellAnimationThread;
import com.android.wm.shell.shared.annotations.ShellBackgroundThread;
import com.android.wm.shell.shared.annotations.ShellBackgroundThread;
import com.android.wm.shell.shared.annotations.ShellDesktopThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.desktopmode.DesktopModeCompatPolicy;
import com.android.wm.shell.shared.desktopmode.DesktopModeCompatPolicy;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
@@ -750,6 +751,7 @@ public abstract class WMShellModule {
            MultiInstanceHelper multiInstanceHelper,
            MultiInstanceHelper multiInstanceHelper,
            @ShellMainThread ShellExecutor mainExecutor,
            @ShellMainThread ShellExecutor mainExecutor,
            @ShellMainThread Handler mainHandler,
            @ShellMainThread Handler mainHandler,
            @ShellDesktopThread ShellExecutor desktopExecutor,
            Optional<DesktopTasksLimiter> desktopTasksLimiter,
            Optional<DesktopTasksLimiter> desktopTasksLimiter,
            Optional<RecentTasksController> recentTasksController,
            Optional<RecentTasksController> recentTasksController,
            InteractionJankMonitor interactionJankMonitor,
            InteractionJankMonitor interactionJankMonitor,
@@ -789,6 +791,7 @@ public abstract class WMShellModule {
                recentsTransitionHandler,
                recentsTransitionHandler,
                multiInstanceHelper,
                multiInstanceHelper,
                mainExecutor,
                mainExecutor,
                desktopExecutor,
                desktopTasksLimiter,
                desktopTasksLimiter,
                recentTasksController.orElse(null),
                recentTasksController.orElse(null),
                interactionJankMonitor,
                interactionJankMonitor,
+41 −364

File changed.

Preview size limit exceeded, changes collapsed.

+12 −20

File changed.

Preview size limit exceeded, changes collapsed.

+5 −5
Original line number Original line Diff line number Diff line
@@ -582,7 +582,7 @@ sealed class DragToDesktopTransitionHandler(
                startPosition.y.toInt() + unscaledStartHeight,
                startPosition.y.toInt() + unscaledStartHeight,
            )
            )


        dragToDesktopStateListener?.onCommitToDesktopAnimationStart(startTransaction)
        dragToDesktopStateListener?.onCommitToDesktopAnimationStart()
        // Accept the merge by applying the merging transaction (applied by #showResizeVeil)
        // Accept the merge by applying the merging transaction (applied by #showResizeVeil)
        // and finish callback. Show the veil and position the task at the first frame before
        // and finish callback. Show the veil and position the task at the first frame before
        // starting the final animation.
        // starting the final animation.
@@ -713,7 +713,7 @@ sealed class DragToDesktopTransitionHandler(
                addListener(
                addListener(
                    object : AnimatorListenerAdapter() {
                    object : AnimatorListenerAdapter() {
                        override fun onAnimationEnd(animation: Animator) {
                        override fun onAnimationEnd(animation: Animator) {
                            dragToDesktopStateListener?.onCancelToDesktopAnimationEnd(tx)
                            dragToDesktopStateListener?.onCancelToDesktopAnimationEnd()
                            // Start the cancel transition to restore order.
                            // Start the cancel transition to restore order.
                            startCancelDragToDesktopTransition()
                            startCancelDragToDesktopTransition()
                        }
                        }
@@ -806,9 +806,9 @@ sealed class DragToDesktopTransitionHandler(
    )
    )


    interface DragToDesktopStateListener {
    interface DragToDesktopStateListener {
        fun onCommitToDesktopAnimationStart(tx: SurfaceControl.Transaction)
        fun onCommitToDesktopAnimationStart()


        fun onCancelToDesktopAnimationEnd(tx: SurfaceControl.Transaction)
        fun onCancelToDesktopAnimationEnd()
    }
    }


    sealed class TransitionState {
    sealed class TransitionState {
@@ -1013,7 +1013,7 @@ constructor(
        val startBoundsWithOffset =
        val startBoundsWithOffset =
            Rect(startBounds).apply { offset(startPosition.x.toInt(), startPosition.y.toInt()) }
            Rect(startBounds).apply { offset(startPosition.x.toInt(), startPosition.y.toInt()) }


        dragToDesktopStateListener?.onCommitToDesktopAnimationStart(startTransaction)
        dragToDesktopStateListener?.onCommitToDesktopAnimationStart()
        // Accept the merge by applying the merging transaction (applied by #showResizeVeil)
        // Accept the merge by applying the merging transaction (applied by #showResizeVeil)
        // and finish callback. Show the veil and position the task at the first frame before
        // and finish callback. Show the veil and position the task at the first frame before
        // starting the final animation.
        // starting the final animation.
+6 −4

File changed.

Preview size limit exceeded, changes collapsed.

Loading