summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkrilax_CZ <skrilax@gmail.com>2016-05-12 05:30:50 (GMT)
committerSkrilax_CZ <skrilax@gmail.com>2016-05-12 05:34:52 (GMT)
commit921eb837fc1301edc5e91350a033a1ab6d6bba54 (patch)
tree6bd2f51fc106518e66581b5ef5e737dfd4b90e78
parentfe7faac0dba67667ae671e6cf59c9706d45e579b (diff)
downloadandroid_packages_apps_Trebuchet-921eb837fc1301edc5e91350a033a1ab6d6bba54.zip
android_packages_apps_Trebuchet-921eb837fc1301edc5e91350a033a1ab6d6bba54.tar.gz
android_packages_apps_Trebuchet-921eb837fc1301edc5e91350a033a1ab6d6bba54.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. Change-Id: I207b6a9ba534f572e1937a7b2a0cdc4eb90aff37
-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) {