Merge "Restore the creation of the remote context in sync inflation." into sc-v2-dev am: 184c9eeb95 am: c68bce1d74

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15951444

Change-Id: Ifb0ee1e526930797c01374d334c6c33ee02a9f20
This commit is contained in:
TreeHugger Robot
2021-10-04 17:44:12 +00:00
committed by Automerger Merge Worker

View File

@@ -552,6 +552,10 @@ public class AppWidgetHostView extends FrameLayout {
inflateAsync(rvToApply);
return;
}
// Prepare a local reference to the remote Context so we're ready to
// inflate any requested LayoutParams.
mRemoteContext = getRemoteContext();
int layoutId = rvToApply.getLayoutId();
if (rvToApply.canRecycleView(mView)) {
try {
@@ -727,6 +731,9 @@ public class AppWidgetHostView extends FrameLayout {
} catch (NameNotFoundException e) {
Log.e(TAG, "Package name " + mInfo.providerInfo.packageName + " not found");
return mContext;
} catch (NullPointerException e) {
Log.e(TAG, "Error trying to create the remote context.", e);
return mContext;
}
}