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

Commit d468d44e authored by Maryam Dehaini's avatar Maryam Dehaini
Browse files

Remove RelayoutBlock from WindowDecoration

We previously added the relayout block due to flashes that were caused
when onTaskInfo ran relayout between a transition. This occured because
we were setting task position and cropping the window in relayout. Now
that we are no longer setting the position/ window crop in relayout, we
no longer need the block.

Bug: 274674365
Test: Testing transitions manually to make sure there is no flash
Change-Id: Ic28cdb90b9def39acc8da57561eb6bed737d6b9e
parent 42f9b0d5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -210,7 +210,6 @@ public abstract class WMShellModule {
            SyncTransactionQueue syncQueue,
            Transitions transitions,
            Optional<DesktopTasksController> desktopTasksController,
            RecentsTransitionHandler recentsTransitionHandler,
            RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
        if (DesktopModeStatus.isEnabled()) {
            return new DesktopModeWindowDecorViewModel(
@@ -226,7 +225,6 @@ public abstract class WMShellModule {
                    syncQueue,
                    transitions,
                    desktopTasksController,
                    recentsTransitionHandler,
                    rootTaskDisplayAreaOrganizer);
        }
        return new CaptionWindowDecorViewModel(
+2 −6
Original line number Diff line number Diff line
@@ -320,9 +320,8 @@ class DesktopTasksController(
    }

    /** Move a task with given `taskId` to fullscreen */
    fun moveToFullscreen(taskId: Int, windowDecor: DesktopModeWindowDecoration) {
    fun moveToFullscreen(taskId: Int) {
        shellTaskOrganizer.getRunningTaskInfo(taskId)?.let { task ->
            windowDecor.incrementRelayoutBlock()
            moveToFullscreenWithAnimation(task, task.positionInParent)
        }
    }
@@ -903,20 +902,17 @@ class DesktopTasksController(
     * @param position position of surface when drag ends.
     * @param inputCoordinate the coordinates of the motion event
     * @param taskBounds the updated bounds of the task being dragged.
     * @param windowDecor the window decoration for the task being dragged
     */
    fun onDragPositioningEnd(
        taskInfo: RunningTaskInfo,
        position: Point,
        inputCoordinate: PointF,
        taskBounds: Rect,
        windowDecor: DesktopModeWindowDecoration
        taskBounds: Rect
    ) {
        if (taskInfo.configuration.windowConfiguration.windowingMode != WINDOWING_MODE_FREEFORM) {
            return
        }
        if (taskBounds.top <= transitionAreaHeight) {
            windowDecor.incrementRelayoutBlock()
            moveToFullscreenWithAnimation(taskInfo, position)
        }
        if (inputCoordinate.x <= transitionAreaWidth) {
+0 −2
Original line number Diff line number Diff line
@@ -54,8 +54,6 @@ class ToggleResizeDesktopTaskTransitionHandler(
        taskId: Int,
        windowDecoration: DesktopModeWindowDecoration
    ) {
        // Pause relayout until the transition animation finishes.
        windowDecoration.incrementRelayoutBlock()
        transitions.startTransition(TRANSIT_DESKTOP_MODE_TOGGLE_RESIZE, wct, this)
        taskToDecorationMap.put(taskId, windowDecoration)
    }
+0 −4
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs
                    onChangeTransitionReady(change, startT, finishT);
                    break;
            }
            mWindowDecorViewModel.onTransitionReady(transition, info, change);
        }
        mTransitionToTaskInfo.put(transition, taskInfoList);
    }
@@ -153,8 +152,6 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs

    @Override
    public void onTransitionMerged(@NonNull IBinder merged, @NonNull IBinder playing) {
        mWindowDecorViewModel.onTransitionMerged(merged, playing);

        final List<ActivityManager.RunningTaskInfo> infoOfMerged =
                mTransitionToTaskInfo.get(merged);
        if (infoOfMerged == null) {
@@ -178,7 +175,6 @@ public class FreeformTaskTransitionObserver implements Transitions.TransitionObs
        final List<ActivityManager.RunningTaskInfo> taskInfo =
                mTransitionToTaskInfo.getOrDefault(transition, Collections.emptyList());
        mTransitionToTaskInfo.remove(transition);
        mWindowDecorViewModel.onTransitionFinished(transition);
        for (int i = 0; i < taskInfo.size(); ++i) {
            mWindowDecorViewModel.destroyWindowDecoration(taskInfo.get(i));
        }
+0 −12
Original line number Diff line number Diff line
@@ -23,13 +23,11 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.os.Handler;
import android.os.IBinder;
import android.util.SparseArray;
import android.view.Choreographer;
import android.view.MotionEvent;
import android.view.SurfaceControl;
import android.view.View;
import android.window.TransitionInfo;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;

@@ -76,16 +74,6 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
        }
    }

    @Override
    public void onTransitionReady(IBinder transition, TransitionInfo info,
            TransitionInfo.Change change) {}

    @Override
    public void onTransitionMerged(IBinder merged, IBinder playing) {}

    @Override
    public void onTransitionFinished(IBinder transition) {}

    @Override
    public void setFreeformTaskTransitionStarter(FreeformTaskTransitionStarter transitionStarter) {
        mTaskOperations = new TaskOperations(transitionStarter, mContext, mSyncQueue);
Loading