Fix surface frame size reporting.
The SurfaceHolder provided by the wallpaper service was not reporting the correct size in getSurfaceFrame(). This broke an optimization in the ImageWallpaper. The old code happened to work because calling lockCanvas on the SurfaceHolder with a null dirty rectangle happened to have the side-effect of updating the SurfaceHolder's surface frame size field because it passed mSurfaceFrame as the dirty rect, causing mSurfaceFrame to be set to the size of the region to be drawn. However, relying on this side-effect is wrong. Among other things, the dirty region could actually be smaller than the surface frame. This patch fixes WallpaperService, SurfaceView and ViewRoot to ensure that the surface frame size is always set explicitly and is not modified by calls to lockCanvas. Change-Id: I10948f5ec269409ceaf0f7d32b3f6731e9499ebc
Loading
Please register or sign in to comment