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

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

Merge "Respect Z-ordering when assigning fullscreen-dim layer." into oc-dev

parents bf08eb6d e3024512
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -188,6 +188,7 @@ class DimLayerController {
    boolean animateDimLayers() {
        int fullScreen = -1;
        int fullScreenAndDimming = -1;
        int topFullScreenUserLayer = 0;
        boolean result = false;

        for (int i = mState.size() - 1; i >= 0; i--) {
@@ -213,8 +214,18 @@ class DimLayerController {
            // and we have to make sure we always animate the layer.
            if (user.dimFullscreen() && state.dimLayer == mSharedFullScreenDimLayer) {
                fullScreen = i;
                if (mState.valueAt(i).continueDimming) {
                if (!state.continueDimming) {
                    continue;
                }

                // When choosing which user to assign the shared fullscreen layer to
                // we need to look at Z-order.
                if (topFullScreenUserLayer == 0 ||
                        (state.animator != null && state.animator.mAnimLayer > topFullScreenUserLayer)) {
                    fullScreenAndDimming = i;
                    if (state.animator != null) {
                        topFullScreenUserLayer = state.animator.mAnimLayer;
                    }
                }
            } else {
                // We always want to animate the non fullscreen windows, they don't share their