Skip to content
Commit b8560b66 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Fix AppWidget layout inflation to resolve references.

When RemoteViews inflates a layout and set of actions, it
uses a cloned remote Context so it can fully access the
resources needed to complete the inflate.  However, in one
specific case when inflating the root view, LayoutInflater
calls back to the soon-to-be parent view to request the
correct set of LayoutParams through generateLayoutParams().

The default implementation of generateLayoutParams() uses
the Context of the /local/ View instead of the remote
Context being used for the inflation, which means that any
LayoutParam references in the root view are unresolved.

To fix this, we internally create our own copy of the target
remote Context.  This way, when the remote LayoutInflater
calls generateLayoutParams(), we inflate it using the remote
Context to correctly resolve any references.

This change is required as part of http://b/2038594
parent 3397f169
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment