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
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user