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.
This commit is contained in:
@@ -322,6 +322,7 @@ public class AppWidgetHostView extends FrameLayout {
|
|||||||
if (mInfo != null) {
|
if (mInfo != null) {
|
||||||
Context theirContext = mContext.createPackageContext(
|
Context theirContext = mContext.createPackageContext(
|
||||||
mInfo.provider.getPackageName(), Context.CONTEXT_RESTRICTED);
|
mInfo.provider.getPackageName(), Context.CONTEXT_RESTRICTED);
|
||||||
|
mRemoteContext = theirContext;
|
||||||
LayoutInflater inflater = (LayoutInflater)
|
LayoutInflater inflater = (LayoutInflater)
|
||||||
theirContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
theirContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
inflater = inflater.cloneInContext(theirContext);
|
inflater = inflater.cloneInContext(theirContext);
|
||||||
@@ -336,8 +337,8 @@ public class AppWidgetHostView extends FrameLayout {
|
|||||||
exception = e;
|
exception = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exception != null && LOGD) {
|
if (exception != null) {
|
||||||
Log.w(TAG, "Error inflating AppWidget " + mInfo, exception);
|
Log.w(TAG, "Error inflating AppWidget " + mInfo + ": " + exception.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultView == null) {
|
if (defaultView == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user