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

Commit 0d3728a1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make animation-background rel-z instead of reparented" into main

parents 0ae551b0 a2a3b187
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -115,6 +115,14 @@ public class RootTaskDisplayAreaOrganizer extends DisplayAreaOrganizer {
        b.setParent(sc);
    }

    /**
     * Sets the layer of {@param sc} to be relative to the TDA on {@param displayId}.
     */
    public void relZToDisplayArea(int displayId, SurfaceControl sc, SurfaceControl.Transaction t,
            int z) {
        t.setRelativeLayer(sc, mLeashes.get(displayId), z);
    }

    /**
     * Re-parents the provided surface to the leash of the provided display.
     *
+11 −10
Original line number Diff line number Diff line
@@ -658,10 +658,16 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {

        for (int i = 0; i < info.getRootCount(); ++i) {
            final int displayId = info.getRoot(i).getDisplayId();
            final SurfaceControl.Builder colorLayerBuilder = new SurfaceControl.Builder()
                    .setName("animation-background")
            final SurfaceControl backgroundSurface = new SurfaceControl.Builder()
                    .setName("animation-background for #" + info.getDebugId())
                    .setCallsite("DefaultTransitionHandler")
                    .setColorLayer();
                    .setColorLayer()
                    .setParent(info.getRoot(i).getLeash())
                    .build();

            startTransaction.setColor(backgroundSurface, colorArray)
                    .setLayer(backgroundSurface, -1)
                    .show(backgroundSurface);

            // Attaching the background surface to the transition root could unexpectedly make it
            // cover one of the split root tasks. To avoid this, put the background surface just
@@ -670,15 +676,10 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                    info.getChanges().stream().anyMatch(c-> c.getTaskInfo() != null
                            && c.getTaskInfo().getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW);
            if (isSplitTaskInvolved) {
                mRootTDAOrganizer.attachToDisplayArea(displayId, colorLayerBuilder);
            } else {
                colorLayerBuilder.setParent(info.getRootLeash());
                mRootTDAOrganizer.relZToDisplayArea(displayId, backgroundSurface, startTransaction,
                        -1);
            }

            final SurfaceControl backgroundSurface = colorLayerBuilder.build();
            startTransaction.setColor(backgroundSurface, colorArray)
                    .setLayer(backgroundSurface, -1)
                    .show(backgroundSurface);
            finishTransaction.remove(backgroundSurface);
        }
    }