summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSkrilax_CZ <skrilax@gmail.com>2016-05-11 22:30:50 -0700
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:22:22 -0700
commitd1ea738e7bd00896c3db73c78abfab2ee12f77f2 (patch)
tree44c4a2f4f34fc05a1866d2b9060cc7bc937463b1
parente9d85348fd851e7b6e5ed39a70c9a31b606842ee (diff)
downloadandroid_packages_apps_Trebuchet-d1ea738e7bd00896c3db73c78abfab2ee12f77f2.zip
android_packages_apps_Trebuchet-d1ea738e7bd00896c3db73c78abfab2ee12f77f2.tar.gz
android_packages_apps_Trebuchet-d1ea738e7bd00896c3db73c78abfab2ee12f77f2.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.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c892f4b..4255aa5 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2107,6 +2107,11 @@ public class Launcher extends Activity
public void removeAppWidget(LauncherAppWidgetInfo launcherInfo) {
removeWidgetToAutoAdvance(launcherInfo.hostView);
launcherInfo.hostView = null;
+ AppWidgetProviderInfo info = mAppWidgetManager.getAppWidgetInfo(launcherInfo.appWidgetId);
+ if (info != null) {
+ String packageName = info.providerInfo.packageName;
+ LauncherApplication.getLauncherStats().sendWidgetRemoveEvent(packageName);
+ }
}
public void showOutOfSpaceMessage(boolean isHotseatLayout) {