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

Commit 3e948592 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Update layer order of tasks when restoring pip to previous task" into main

parents f6239727 67d168ed
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4786,6 +4786,12 @@ class Task extends TaskFragment {
                    if (com.android.window.flags.Flags.removePrepareSurfaceInPlacement()
                            && lastParentBeforePip.mSyncState == SYNC_STATE_NONE) {
                        lastParentBeforePip.prepareSurfaces();
                        // If the moveToFront is a part of finishing transition, then make sure
                        // the z-order of tasks are up-to-date.
                        if (topActivity.mTransitionController.inFinishingTransition(topActivity)) {
                            Transition.assignLayers(taskDisplayArea,
                                    taskDisplayArea.getPendingTransaction());
                        }
                    }
                }
                if (isPip2ExperimentEnabled) {
+7 −6
Original line number Diff line number Diff line
@@ -1048,7 +1048,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        // the animation played. This puts the layers back into the correct order.
        for (int i = displays.size() - 1; i >= 0; --i) {
            if (displays.valueAt(i) == null) continue;
            updateDisplayLayers(displays.valueAt(i), t);
            assignLayers(displays.valueAt(i), t);
        }

        for (int i = 0; i < info.getRootCount(); ++i) {
@@ -1056,12 +1056,13 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
        }
    }

    private static void updateDisplayLayers(DisplayContent dc, SurfaceControl.Transaction t) {
        dc.mTransitionController.mBuildingFinishLayers = true;
    /** Assigns the layers for the start or end state of transition. */
    static void assignLayers(WindowContainer<?> wc, SurfaceControl.Transaction t) {
        wc.mTransitionController.mBuildingFinishLayers = true;
        try {
            dc.assignChildLayers(t);
            wc.assignChildLayers(t);
        } finally {
            dc.mTransitionController.mBuildingFinishLayers = false;
            wc.mTransitionController.mBuildingFinishLayers = false;
        }
    }

@@ -2717,7 +2718,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
            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);
            assignLayers(dc, startT);
            startT.setLayer(rootLeash, leashReference.getLastLayer());
            outInfo.addRootLeash(endDisplayId, rootLeash,
                    ancestor.getBounds().left, ancestor.getBounds().top);