diff options
author | Adam Cohen <adamcohen@google.com> | 2014-06-17 00:58:41 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-16 22:12:26 +0000 |
commit | 21b35c52037b6441df22821eb97903811a5e7986 (patch) | |
tree | e4fe40eaf983beb6958a87801f7cd8925ea52c0a | |
parent | a623e2f924bb72d21df181a4e8b2a4f7f9e3196f (diff) | |
parent | 084c31873e5d5015dac9eaac722a6d8387b6dd8d (diff) | |
download | android_packages_apps_Trebuchet-21b35c52037b6441df22821eb97903811a5e7986.tar.gz android_packages_apps_Trebuchet-21b35c52037b6441df22821eb97903811a5e7986.tar.bz2 android_packages_apps_Trebuchet-21b35c52037b6441df22821eb97903811a5e7986.zip |
Merge "Catching TransactionTooLargeException in AppWidgetHost#startListening" into ub-now-master
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetHost.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetHost.java b/src/com/android/launcher3/LauncherAppWidgetHost.java index 7b08d4403..fa5e38f8b 100644 --- a/src/com/android/launcher3/LauncherAppWidgetHost.java +++ b/src/com/android/launcher3/LauncherAppWidgetHost.java @@ -20,6 +20,7 @@ import android.appwidget.AppWidgetHost; import android.appwidget.AppWidgetHostView; import android.appwidget.AppWidgetProviderInfo; import android.content.Context; +import android.os.TransactionTooLargeException; /** * Specific {@link AppWidgetHost} that creates our {@link LauncherAppWidgetHostView} @@ -42,6 +43,22 @@ public class LauncherAppWidgetHost extends AppWidgetHost { } @Override + public void startListening() { + try { + super.startListening(); + } catch (Exception e) { + if (e.getCause() instanceof TransactionTooLargeException) { + // We're willing to let this slide. The exception is being caused by the list of + // RemoteViews which is being passed back. The startListening relationship will + // have been established by this point, and we will end up populating the + // widgets upon bind anyway. See issue 14255011 for more context. + } else { + throw new RuntimeException(e); + } + } + } + + @Override public void stopListening() { super.stopListening(); clearViews(); |