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

Commit ed7c93e3 authored by Evan Rosky's avatar Evan Rosky Committed by Automerger Merge Worker
Browse files

Merge "Calculate the correct surface layers for finishTransaction" into...

Merge "Calculate the correct surface layers for finishTransaction" into tm-qpr-dev am: 43c0cbec am: 8e14b1fb

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19261966



Change-Id: I23fcb915792d27087dc9e4d471630bf373fc0859
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2222f57b 8e14b1fb
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -533,10 +533,15 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
        }
        // 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;
        }
        if (rootLeash.isValid()) {
            t.reparent(rootLeash, null);
        }
+17 −0
Original line number Diff line number Diff line
@@ -100,6 +100,14 @@ class TransitionController {
    // TODO(b/188595497): remove when not needed.
    final StatusBarManagerInternal mStatusBar;

    /**
     * `true` when building surface layer order for the finish transaction. We want to prevent
     * wm from touching z-order of surfaces during transitions, but we still need to be able to
     * calculate the layers for the finishTransaction. So, when assigning layers into the finish
     * transaction, set this to true so that the {@link canAssignLayers} will allow it.
     */
    boolean mBuildingFinishLayers = false;

    TransitionController(ActivityTaskManagerService atm,
            TaskSnapshotController taskSnapshotController,
            TransitionTracer transitionTracer) {
@@ -309,6 +317,15 @@ class TransitionController {
        return false;
    }

    /**
     * Whether WM can assign layers to window surfaces at this time. This is usually false while
     * playing, but can be "opened-up" for certain transition operations like calculating layers
     * for finishTransaction.
     */
    boolean canAssignLayers() {
        return mBuildingFinishLayers || !isPlaying();
    }

    @WindowConfiguration.WindowingMode
    int getWindowingModeAtStart(@NonNull WindowContainer wc) {
        if (mCollectingTransition == null) return wc.getWindowingMode();
+1 −1
Original line number Diff line number Diff line
@@ -2476,7 +2476,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
    void assignLayer(Transaction t, int layer) {
        // Don't assign layers while a transition animation is playing
        // TODO(b/173528115): establish robust best-practices around z-order fighting.
        if (mTransitionController.isPlaying()) return;
        if (!mTransitionController.canAssignLayers()) return;
        final boolean changed = layer != mLastLayer || mLastRelativeToLayer != null;
        if (mSurfaceControl != null && changed) {
            setLayer(t, layer);