Merge "SurfaceFlinger: Validate layers before casting." into qt-dev