Merge "PrintSpooler: fix monkey crash if height&width small than 0"

am: 4a41744919

Change-Id: I3b704d0f3e27bb26e00c60cd22145767d6c08335
This commit is contained in:
huiwan
2017-08-14 23:59:13 +00:00
committed by android-build-merger

View File

@@ -486,6 +486,12 @@ public final class PageAdapter extends Adapter<ViewHolder> {
loadingContent.layout(0, 0, loadingContent.getMeasuredWidth(),
loadingContent.getMeasuredHeight());
// To create a bitmap, height & width should be larger than 0
if (mPageContentHeight <= 0 || mPageContentWidth <= 0) {
Log.w(LOG_TAG, "Unable to create bitmap, height or width smaller than 0!");
return;
}
Bitmap loadingBitmap = Bitmap.createBitmap(mPageContentWidth, mPageContentHeight,
Bitmap.Config.ARGB_8888);
loadingContent.draw(new Canvas(loadingBitmap));