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

Commit aa79aa10 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Amend "Fix various flashes when..." CL"

parents 20f0d091 e7cc44d8
Loading
Loading
Loading
Loading
+7 −22
Original line number Diff line number Diff line
@@ -2295,17 +2295,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        mResizingTasksDuringAnimation.clear();
    }

    private class MoveTaskToFullscreenArgs {
        public int fromStackId;
        public boolean onTop;
    };
    // Used only to closure over the arguments to moveTasksToFullscreenStack without
    // allocation
    private MoveTaskToFullscreenArgs mMoveToFullscreenArgs = new MoveTaskToFullscreenArgs();

    private void moveTasksToFullscreenStackInnerLocked() {
        int fromStackId = mMoveToFullscreenArgs.fromStackId;
        boolean onTop = mMoveToFullscreenArgs.onTop;
    private void moveTasksToFullscreenStackInSurfaceTransaction(int fromStackId,
            boolean onTop) {

        final ActivityStack stack = getStack(fromStackId);
        if (stack == null) {
@@ -2379,10 +2370,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
    }

    void moveTasksToFullscreenStackLocked(int fromStackId, boolean onTop) {
        mMoveToFullscreenArgs.fromStackId = fromStackId;
        mMoveToFullscreenArgs.onTop = onTop;

        mWindowManager.inSurfaceTransaction(this::moveTasksToFullscreenStackInnerLocked);
        mWindowManager.inSurfaceTransaction(
                () -> moveTasksToFullscreenStackInSurfaceTransaction(fromStackId, onTop));
    }

    void resizeDockedStackLocked(Rect dockedBounds, Rect tempDockedTaskBounds,
@@ -2498,11 +2487,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
    }


    // Used only to closure over the argument to removeStack without allocation.
    private int mRemoveStackStackId;
    void removeStackInnerLocked() {
        int stackId = mRemoveStackStackId;

    void removeStackInSurfaceTransaction(int stackId) {
        final ActivityStack stack = getStack(stackId);
        if (stack == null) {
            return;
@@ -2546,8 +2531,8 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
     * instead moved back onto the fullscreen stack.
     */
    void removeStackLocked(int stackId) {
        mRemoveStackStackId = stackId;
        mWindowManager.inSurfaceTransaction(this::removeStackInnerLocked);
        mWindowManager.inSurfaceTransaction(
                () -> removeStackInSurfaceTransaction(stackId));
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -368,6 +368,10 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
                mEnteringAnimation = true;
                mService.mActivityManagerAppTransitionNotifier.onAppTransitionFinishedLocked(token);
            }
            // If we are hidden but there is no delay needed we immediately
            // apply the Surface transaction so that the ActivityManager
            // can have some guarantee on the Surface state
            // following setting the visibility.
            if (hidden && !delayed) {
                SurfaceControl.openTransaction();
                for (int i = mChildren.size() - 1; i >= 0; i--) {
+0 −2
Original line number Diff line number Diff line
@@ -7317,7 +7317,6 @@ public class WindowManagerService extends IWindowManager.Stub
     * WARNING: This method contains locks known to the State of California
     * to cause Deadlocks and other conditions.
     *
     *
     * Begins a surface transaction with which the AM can batch operations.
     * All Surface updates performed by the WindowManager following this
     * will not appear on screen until after the call to
@@ -7330,7 +7329,6 @@ public class WindowManagerService extends IWindowManager.Stub
     * from the new parent are inherited, otherwise it could be revealed
     * mistakenly.
     *
     *
     * TODO(b/36393204): We can investigate totally replacing #deferSurfaceLayout
     * with something like this but it seems that some existing cases of
     * deferSurfaceLayout may be a little too broad, in particular the total