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

Commit 9825ec61 authored by Romain Guy's avatar Romain Guy
Browse files

Prevents the WindowManager from requesting empty or negative surfaces.

Windows with a negative Y position can end up in createSurfaceLocked()
with mFrame containing a negative height, causing SurfaceFlinger to go
crazy when asked to create the surface. This change simply guards
against such a situation by instead asking for a 1x1 surface and relying
or later layout operations to resize the window to the appropriate size.

Change-Id: I66f2058f4cd1cf069b12d3d23e6fd340dc76b74e
parent ae5dd1d1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7072,6 +7072,11 @@ public class WindowManagerService extends IWindowManager.Stub
                    h = mRequestedHeight;
                }

                // Something is wrong and SurfaceFlinger will not like this,
                // try to revert to sane values
                if (w <= 0) w = 1;
                if (h <= 0) h = 1;

                try {
                    mSurface = new Surface(
                            mSession.mSurfaceSession, mSession.mPid,