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

Commit 2f8aa394 authored by Robert Carr's avatar Robert Carr
Browse files

Assign animation layer above highest animation target.

Rather than above all stacks. This fixes the case where when
transitioning to the minimized home state, the secondary split
screen app and home are in a transition, but this transition needs
to occur under the primary split-screen app which is not a part
of any transition.

Bug: 69553456
Test: Manual. go/wm-smoke.
Change-Id: I3069e4a1bc3a30a1567eb51731c44f927cc0cefc
parent 850f29a1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1766,6 +1766,9 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
            layer += Z_BOOST_BASE;
        }
        leash.setLayer(layer);

        final DisplayContent dc = getDisplayContent();
        dc.assignStackOrdering(t);
    }

    /**
+32 −20
Original line number Diff line number Diff line
@@ -3531,39 +3531,47 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo

        @Override
        void assignChildLayers(SurfaceControl.Transaction t) {
            assignStackOrdering(t);

            for (int i = 0; i < mChildren.size(); i++) {
                final TaskStack s = mChildren.get(i);
                s.assignChildLayers(t);
            }
        }

        void assignStackOrdering(SurfaceControl.Transaction t) {
            final int HOME_STACK_STATE = 0;
            final int NORMAL_STACK_STATE = 1;
            final int ALWAYS_ON_TOP_STATE = 2;

            int layer = 0;
            int layerForAnimationLayer = 0;

            for (int state = 0; state <= ALWAYS_ON_TOP_STATE; state++) {
                for (int i = 0; i < mChildren.size(); i++) {
                    final TaskStack s = mChildren.get(i);
                    if (state == HOME_STACK_STATE && s.isActivityTypeHome()) {
                        s.assignLayer(t, layer++);
                    } else if (state == NORMAL_STACK_STATE && !s.isActivityTypeHome()
                            && !s.isAlwaysOnTop()) {
                    if (state == HOME_STACK_STATE && !s.isActivityTypeHome()) {
                        continue;
                    } else if (state == NORMAL_STACK_STATE && (s.isActivityTypeHome()
                            || s.isAlwaysOnTop())) {
                        continue;
                    } else if (state == ALWAYS_ON_TOP_STATE && !s.isAlwaysOnTop()) {
                        continue;
                    }
                    s.assignLayer(t, layer++);
                    if (s.inSplitScreenWindowingMode() && mSplitScreenDividerAnchor != null) {
                        t.setLayer(mSplitScreenDividerAnchor, layer++);
                    }
                    } else if (state == ALWAYS_ON_TOP_STATE && s.isAlwaysOnTop()) {
                        s.assignLayer(t, layer++);
                    if (s.isSelfOrChildAnimating()) {
                        // Ensure the animation layer ends up above the
                        // highest animating stack and no higher.
                        layerForAnimationLayer = layer++;
                    }
                }
                // The appropriate place for App-Transitions to occur is right
                // above all other animations but still below things in the Picture-and-Picture
                // windowing mode.
                if (state == NORMAL_STACK_STATE && mAppAnimationLayer != null) {
                    t.setLayer(mAppAnimationLayer, layer++);
            }
            if (mAppAnimationLayer != null) {
                t.setLayer(mAppAnimationLayer, layerForAnimationLayer);
            }
            for (int i = 0; i < mChildren.size(); i++) {
                final TaskStack s = mChildren.get(i);
                s.assignChildLayers(t);
            }

        }

        @Override
@@ -3876,4 +3884,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        }
        super.prepareSurfaces();
    }

    void assignStackOrdering(SurfaceControl.Transaction t) {
        mTaskStackContainers.assignStackOrdering(t);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -1142,7 +1142,7 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
        scheduleAnimation();
    }

    private void reassignLayer(Transaction t) {
    void reassignLayer(Transaction t) {
        final WindowContainer parent = getParent();
        if (parent != null) {
            parent.assignChildLayers(t);