summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-11-11 13:49:34 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-11-11 13:49:34 -0800
commitfd99e7776af59d9f2b4ca6ce75dda0a546b58a36 (patch)
treef2000824a8b9dff554db42c53faf3ab46fc133a6 /src/com
parentebea84d1c95f4c38ba8cee46cd586fd757b4fce2 (diff)
parentdbc1f657863dd9c57a2d30381d3fb36bc7076456 (diff)
downloadandroid_packages_apps_Trebuchet-fd99e7776af59d9f2b4ca6ce75dda0a546b58a36.tar.gz
android_packages_apps_Trebuchet-fd99e7776af59d9f2b4ca6ce75dda0a546b58a36.tar.bz2
android_packages_apps_Trebuchet-fd99e7776af59d9f2b4ca6ce75dda0a546b58a36.zip
Merge "Fix NPE that occurs with poorly behaved widgets" into ics-mr1
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 5382ef3be..cde0b4b2d 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -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));