am fd99e777: Merge "Fix NPE that occurs with poorly behaved widgets" into ics-mr1

* commit 'fd99e7776af59d9f2b4ca6ce75dda0a546b58a36':
  Fix NPE that occurs with poorly behaved widgets
This commit is contained in:
Michael Jurka
2011-11-11 13:51:35 -08:00
committed by Android Git Automerger
@@ -460,7 +460,14 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
AppWidgetManager.getInstance(mLauncher).getInstalledProviders();
Intent shortcutsIntent = new Intent(Intent.ACTION_CREATE_SHORTCUT);
List<ResolveInfo> shortcuts = mPackageManager.queryIntentActivities(shortcutsIntent, 0);
mWidgets.addAll(widgets);
for (AppWidgetProviderInfo widget : widgets) {
if (widget.minWidth > 0 && widget.minHeight > 0) {
mWidgets.add(widget);
} else {
Log.e(LOG_TAG, "Widget " + widget.provider + " has invalid dimensions (" +
widget.minWidth + ", " + widget.minHeight + ")");
}
}
mWidgets.addAll(shortcuts);
Collections.sort(mWidgets,
new LauncherModel.WidgetAndShortcutNameComparator(mPackageManager));