summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-03-08 23:47:45 (GMT)
committercretin45 <cretin45@gmail.com>2016-03-08 23:50:37 (GMT)
commite48ef94fd67a228c3ab402bdbb2b77c8a5440012 (patch)
tree2530a416dad668cdc0761153633719c25acc91eb /src
parent0a244ba105d2f2b6b5427f5d4999b9db3c468e10 (diff)
downloadandroid_packages_apps_Trebuchet-e48ef94fd67a228c3ab402bdbb2b77c8a5440012.zip
android_packages_apps_Trebuchet-e48ef94fd67a228c3ab402bdbb2b77c8a5440012.tar.gz
android_packages_apps_Trebuchet-e48ef94fd67a228c3ab402bdbb2b77c8a5440012.tar.bz2
Trebuchet: Guard against NPE while querying for widget updates
Issue-id: CYNGNOS-1867 Change-Id: I43db0096da5f35bd2810f8793d8281607afea1ff
Diffstat (limited to 'src')
-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 f8f5390..e90ea17 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -3585,9 +3585,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();
+ }
}
}