summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkrilax_CZ <skrilax@gmail.com>2016-05-11 22:30:50 -0700
committerEd Carrigan <cretin45@gmail.com>2016-05-12 10:04:27 -0700
commita0211d178b59615e89e2575ff2b8f527253df71c (patch)
tree511d43ddb03af0fb6156aea31eff1494e34c9e5a
parentede95367cbb766b57b0a4c5bc224a0c0f9901ac6 (diff)
downloadandroid_packages_apps_Trebuchet-a0211d178b59615e89e2575ff2b8f527253df71c.zip
android_packages_apps_Trebuchet-a0211d178b59615e89e2575ff2b8f527253df71c.tar.gz
android_packages_apps_Trebuchet-a0211d178b59615e89e2575ff2b8f527253df71c.tar.bz2
Check for null provider info when removing widget
When doing clean installation and restoring backup, any stubs for the widget on the homescreen for apps are not present (downloading them doesn't help) appear to have null provider info. Add a check for that in removeAppWidget to prevent crashing. Issue-id: BUGDUMP-7204604 Change-Id: I207b6a9ba534f572e1937a7b2a0cdc4eb90aff37 (cherry picked from commit 921eb837fc1301edc5e91350a033a1ab6d6bba54)
-rw-r--r--src/com/android/launcher3/Launcher.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 8161d38..4cc7bc4 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2137,8 +2137,10 @@ public class Launcher extends Activity
removeWidgetToAutoAdvance(launcherInfo.hostView);
launcherInfo.hostView = null;
AppWidgetProviderInfo info = mAppWidgetManager.getAppWidgetInfo(launcherInfo.appWidgetId);
- String packageName = info.providerInfo.packageName;
- LauncherApplication.getLauncherStats().sendWidgetRemoveEvent(packageName);
+ if (info != null) {
+ String packageName = info.providerInfo.packageName;
+ LauncherApplication.getLauncherStats().sendWidgetRemoveEvent(packageName);
+ }
}
public void showOutOfSpaceMessage(boolean isHotseatLayout) {