diff options
author | Hyunyoung Song <hyunyoungs@google.com> | 2015-04-14 11:50:44 -0700 |
---|---|---|
committer | Hyunyoung Song <hyunyoungs@google.com> | 2015-04-14 11:50:44 -0700 |
commit | 6da9c32204347d0980d3e76a5ff03bc3431b49a7 (patch) | |
tree | 81931eb84f0f78c594142eb60f764ce6694c6df0 /src | |
parent | 9d07e3d561b4b9819e7bc8778dd3e2b45b0344d9 (diff) | |
download | android_packages_apps_Trebuchet-6da9c32204347d0980d3e76a5ff03bc3431b49a7.tar.gz android_packages_apps_Trebuchet-6da9c32204347d0980d3e76a5ff03bc3431b49a7.tar.bz2 android_packages_apps_Trebuchet-6da9c32204347d0980d3e76a5ff03bc3431b49a7.zip |
Fix null pointer exception in WidgetsModel
Due to not clearing the PackageItemInfos list when uninstall happened,
uninstalled PackageItemInfo lingered around when there wasn't associated
Widgets to it. Hence causing null pointer exception.
b/20216900
Change-Id: I5601cf618079044d24ffc3ee835c1468fa2e9371
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/widget/WidgetsModel.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/launcher3/widget/WidgetsModel.java b/src/com/android/launcher3/widget/WidgetsModel.java index 1447befb2..71a7b9446 100644 --- a/src/com/android/launcher3/widget/WidgetsModel.java +++ b/src/com/android/launcher3/widget/WidgetsModel.java @@ -71,8 +71,10 @@ public class WidgetsModel { // Temporary list for {@link PackageItemInfos} to avoid having to go through // {@link mPackageItemInfos} to locate the key to be used for {@link #mWidgetsList} HashMap<String, PackageItemInfo> tmpPackageItemInfos = new HashMap<>(); + // clear the lists. mWidgetsList.clear(); + mPackageItemInfos.clear(); // add and update. for (Object o: widgetsShortcuts) { |