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

Commit cb1887ec authored by Chong Zhang's avatar Chong Zhang
Browse files

Destroy dimLayer surface in removeDimLayerUser() if it is not fullscreen.

For a non-fullscreen dimLayerUser, its dimLayer surface is not shared with
other dimLayerUsers and should be destroyed when we remove it from mState.

Change-Id: Iaf300178c2534b87fccca99a836ae3416605c9ca
parent 7058e4ca
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -270,8 +270,15 @@ class DimLayerController {
    }

    void removeDimLayerUser(DimLayer.DimLayerUser dimLayerUser) {
        DimLayerState state = mState.get(dimLayerUser);
        if (state != null) {
            // Destroy the surface, unless it's the shared fullscreen dim.
            if (state.dimLayer != mSharedFullScreenDimLayer) {
                state.dimLayer.destroySurface();
            }
            mState.remove(dimLayerUser);
        }
    }

    void applyDimBehind(DimLayer.DimLayerUser dimLayerUser, WindowStateAnimator animator) {
        applyDim(dimLayerUser, animator, false /* aboveApp */);