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

Commit e4c0cf0f authored by Robin Lee's avatar Robin Lee
Browse files

Set parent on animation-background before building

Setting a parent after building doesn't seem to do much.
For consistency and cleaner traces we'll put the animation
background under the right parent during construction when
it's going under a transition root too.

Change-Id: I2def0ae3391d017a64c118b7a4932b7e25b8d8af
Test: atest FlickerTestsAppLaunch
Test: atest ActivityTransitionTests
Bug: 333525723
parent 553ca7e5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -594,7 +594,6 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                    .setName("animation-background")
                    .setCallsite("DefaultTransitionHandler")
                    .setColorLayer();
            final SurfaceControl backgroundSurface = colorLayerBuilder.build();

            // 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
@@ -605,8 +604,10 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
            if (isSplitTaskInvolved) {
                mRootTDAOrganizer.attachToDisplayArea(displayId, colorLayerBuilder);
            } else {
                startTransaction.reparent(backgroundSurface, info.getRootLeash());
                colorLayerBuilder.setParent(info.getRootLeash());
            }

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