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

Commit 067ca32a authored by Craig Mautner's avatar Craig Mautner
Browse files

Prevent dim surface from flashing.

This fix keeps the dim surface below the highest shown layer. If
two shown layers were both dim it was ambiguous where the dim surface
would appear causing dialogs to first be dimmed and then flash when
the dim was put behind them.

Fixes bug 6497476.

Change-Id: I360cf2d23d58fc4c03edbbed16d79c08c29e48b9
parent ae147152
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -538,9 +538,17 @@ public class WindowAnimator {
        if (mDimAnimator == null) {
            mDimAnimator = new DimAnimator(mService.mFxSession);
        }
        // Only set dim params on the highest dimmed layer.
        final WindowStateAnimator dimWinAnimator = mDimParams == null
                ? null : mDimParams.mDimWinAnimator;
        // Don't turn on for an unshown surface, or for any layer but the highest dimmed one.
        if (winAnimator.mSurfaceShown &&
                (dimWinAnimator == null || !dimWinAnimator.mSurfaceShown
                || dimWinAnimator.mAnimLayer < winAnimator.mAnimLayer)) {
            mService.mH.sendMessage(mService.mH.obtainMessage(SET_DIM_PARAMETERS,
                    new DimAnimator.Parameters(winAnimator, width, height, target)));
        }
    }

    // TODO(cmautner): Move into Handler
    void stopDimming() {