Make sure that the dimensions are not negative when drawing pending widget

Bug: 24585203
Change-Id: I3d328d0e1fe81d2704bb5b9d4b340a367bfb9249
This commit is contained in:
Sunny Goyal
2015-10-01 19:35:03 -07:00
parent 1845049c66
commit a682a5d8c7

View File

@@ -218,7 +218,7 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView implemen
mRect.offsetTo((getWidth() - mRect.width()) / 2, (getHeight() - mRect.height()) / 2);
mCenterDrawable.setBounds(mRect);
} else {
float iconSize = Math.min(availableWidth, availableHeight);
float iconSize = Math.max(0, Math.min(availableWidth, availableHeight));
// Use twice the setting size factor, as the setting is drawn at a corner and the
// icon is drawn in the center.