summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/LauncherModel.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 36d4877..83b5d82 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -3513,9 +3513,12 @@ public class LauncherModel extends BroadcastReceiver
// Refresh widget list, if there is any newly added widget
PackageManager pm = context.getPackageManager();
for (String pkg : mPackages) {
- needToRefresh |= !pm.queryBroadcastReceivers(
+ List<ResolveInfo> resolveInfos = pm.queryBroadcastReceivers(
new Intent(AppWidgetManager.ACTION_APPWIDGET_UPDATE)
- .setPackage(pkg), 0).isEmpty();
+ .setPackage(pkg), 0);
+ if (resolveInfos != null) {
+ needToRefresh |= !resolveInfos.isEmpty();
+ }
}
}