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

Commit b0707717 authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Assign animation layer above highest animation target."

parents 9c490c65 2f8aa394
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
@@ -3524,39 +3524,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
@@ -3854,4 +3862,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
@@ -1129,7 +1129,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);