Fixing issue where you couldn't set null RemoteViews for a widget

-> As noted here: http://code.google.com/p/android/issues/detail?id=35014

Change-Id: Id5d1c47b6961d4b448453d8b16700801c0137f2b
This commit is contained in:
Adam Cohen
2012-07-16 12:02:10 -07:00
parent f8d05b4ea6
commit e582746621

View File

@@ -817,7 +817,10 @@ class AppWidgetServiceImpl {
return;
}
int bitmapMemoryUsage = views.estimateMemoryUsage();
int bitmapMemoryUsage = 0;
if (views != null) {
bitmapMemoryUsage = views.estimateMemoryUsage();
}
if (bitmapMemoryUsage > mMaxWidgetBitmapMemory) {
throw new IllegalArgumentException("RemoteViews for widget update exceeds maximum" +
" bitmap memory usage (used: " + bitmapMemoryUsage + ", max: " +