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

Commit 45011a7d authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Do not update task layer during collecting." into udc-qpr-dev

parents 4c1dfffe f35452be
Loading
Loading
Loading
Loading
+19 −10
Original line number Diff line number Diff line
@@ -959,20 +959,25 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        }
        // Need to update layers on involved displays since they were all paused while
        // the animation played. This puts the layers back into the correct order.
        mController.mBuildingFinishLayers = true;
        try {
        for (int i = displays.size() - 1; i >= 0; --i) {
            if (displays.valueAt(i) == null) continue;
                displays.valueAt(i).assignChildLayers(t);
            }
        } finally {
            mController.mBuildingFinishLayers = false;
            updateDisplayLayers(displays.valueAt(i), t);
        }

        for (int i = 0; i < info.getRootCount(); ++i) {
            t.reparent(info.getRoot(i).getLeash(), null);
        }
    }

    private static void updateDisplayLayers(DisplayContent dc, SurfaceControl.Transaction t) {
        dc.mTransitionController.mBuildingFinishLayers = true;
        try {
            dc.assignChildLayers(t);
        } finally {
            dc.mTransitionController.mBuildingFinishLayers = false;
        }
    }

    /**
     * Build a transaction that cleans-up transition-only surfaces (transition root and snapshots).
     * This will ALWAYS be applied on transition finish just in-case
@@ -2346,8 +2351,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            final WindowContainer<?> wc = sortedTargets.get(i).mContainer;
            // Don't include wallpapers since they are in a different DA.
            if (isWallpaper(wc)) continue;
            final int endDisplayId = getDisplayId(wc);
            if (endDisplayId < 0) continue;
            final DisplayContent dc = wc.getDisplayContent();
            if (dc == null) continue;
            final int endDisplayId = dc.getDisplayId();

            // Check if Root was already created for this display with a higher-Z window
            if (outInfo.findRootIndex(endDisplayId) >= 0) continue;
@@ -2369,6 +2375,9 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            final SurfaceControl rootLeash = leashReference.makeAnimationLeash().setName(
                    "Transition Root: " + leashReference.getName()).build();
            rootLeash.setUnreleasedWarningCallSite("Transition.calculateTransitionRoots");
            // Update layers to start transaction because we prevent assignment during collect, so
            // the layer of transition root can be correct.
            updateDisplayLayers(dc, startT);
            startT.setLayer(rootLeash, leashReference.getLastLayer());
            outInfo.addRootLeash(endDisplayId, rootLeash,
                    ancestor.getBounds().left, ancestor.getBounds().top);
+3 −1
Original line number Diff line number Diff line
@@ -558,7 +558,9 @@ class TransitionController {
            return wc.asWindowState() == null;
        }
        // Always allow WindowState to assign layers since it won't affect transition.
        return wc.asWindowState() != null || !isPlaying();
        return wc.asWindowState() != null || (!isPlaying()
                // Don't assign task while collecting.
                && !(wc.asTask() != null && isCollecting()));
    }

    @WindowConfiguration.WindowingMode