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

Commit 7b371ddf authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Do not pass invalid bounds for dim layer

Makes the entire system freeze.

Bug: 26396656
Change-Id: I9e9b0a297a351cd8ef72cdc8f5994df6c42567d9
parent 2a37455a
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -172,12 +172,18 @@ public class DockedStackDividerController implements DimLayerUser {
    void setResizeDimLayer(boolean visible, int targetStackId, float alpha) {
        SurfaceControl.openTransaction();
        TaskStack stack = mDisplayContent.mService.mStackIdToStack.get(targetStackId);
        if (visible && stack != null) {
        boolean visibleAndValid = visible && stack != null;
        if (visibleAndValid) {
            stack.getDimBounds(mTmpRect);
            if (mTmpRect.height() > 0) {
                mDimLayer.setBounds(mTmpRect);
            mDimLayer.show(mDisplayContent.mService.mLayersController.getResizeDimLayer(), alpha,
                    0 /* duration */);
                mDimLayer.show(mDisplayContent.mService.mLayersController.getResizeDimLayer(),
                        alpha, 0 /* duration */);
            } else {
                visibleAndValid = false;
            }
        }
        if (!visibleAndValid) {
            mDimLayer.hide();
        }
        SurfaceControl.closeTransaction();