Merge "check surface valid before screenshotting wallapper"

This commit is contained in:
Jay Aliomer
2022-01-21 23:48:07 +00:00
committed by Android (Google) Code Review

View File

@@ -1629,6 +1629,7 @@ public abstract class WallpaperService extends Service {
return;
}
Surface surface = mSurfaceHolder.getSurface();
if (!surface.isValid()) return;
boolean widthIsLarger = mSurfaceSize.x > mSurfaceSize.y;
int smaller = widthIsLarger ? mSurfaceSize.x
: mSurfaceSize.y;