From 220dec2897d739ecb627e46b4cafbd664f4ff762 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Wed, 19 Aug 2009 09:31:51 -0700 Subject: [PATCH] Use remote Context when inflating initialLayout, add debug. To help track down http://b/2055197 this change adds back exception logging when inflating initialLayout. On a hunch, it also assigns the remote Context so generateLayoutParams() can inflate correctly. --- core/java/android/appwidget/AppWidgetHostView.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index cced338a8e0d8..a4c141ebfdf6d 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -322,6 +322,7 @@ public class AppWidgetHostView extends FrameLayout { if (mInfo != null) { Context theirContext = mContext.createPackageContext( mInfo.provider.getPackageName(), Context.CONTEXT_RESTRICTED); + mRemoteContext = theirContext; LayoutInflater inflater = (LayoutInflater) theirContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater = inflater.cloneInContext(theirContext); @@ -336,8 +337,8 @@ public class AppWidgetHostView extends FrameLayout { exception = e; } - if (exception != null && LOGD) { - Log.w(TAG, "Error inflating AppWidget " + mInfo, exception); + if (exception != null) { + Log.w(TAG, "Error inflating AppWidget " + mInfo + ": " + exception.toString()); } if (defaultView == null) {