diff options
author | Alan Viverette <alanv@google.com> | 2014-01-07 20:28:56 +0000 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2014-01-07 20:28:56 +0000 |
commit | eb14ccf0202b3050830523865e147b2dcfa819ba (patch) | |
tree | d2e7c8c4286acdb07f00b78c815c46db60059fe6 | |
parent | dd9233253b88d86473403d5b63c72e223b5e40bd (diff) | |
download | frameworks_base-eb14ccf0202b3050830523865e147b2dcfa819ba.zip frameworks_base-eb14ccf0202b3050830523865e147b2dcfa819ba.tar.gz frameworks_base-eb14ccf0202b3050830523865e147b2dcfa819ba.tar.bz2 |
Revert "Allow Views to specify a theme override"
Inheriting the parent view's Context breaks RemoteView inflation.
This reverts commit dd9233253b88d86473403d5b63c72e223b5e40bd.
Change-Id: I1c9a940a31169cd42b7356ad58548597a2efbb24
-rw-r--r-- | core/java/android/view/LayoutInflater.java | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index 32c9885..aa43bad 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -91,8 +91,6 @@ public abstract class LayoutInflater { private static final String TAG_1995 = "blink"; private static final String TAG_REQUEST_FOCUS = "requestFocus"; - private static final String ATTR_THEME = "theme"; - /** * Hook to allow clients of the LayoutInflater to restrict the set of Views that are allowed * to be inflated. @@ -679,44 +677,23 @@ public abstract class LayoutInflater { name = attrs.getAttributeValue(null, "class"); } - // Apply a theme override, if necessary. - final Context viewContext; - final int themeResId = attrs.getAttributeResourceValue(null, ATTR_THEME, 0); - if (themeResId != 0) { - viewContext = new ContextThemeWrapper(mContext, themeResId); - } else if (parent != null) { - viewContext = parent.getContext(); - } else { - viewContext = mContext; - } - if (DEBUG) System.out.println("******** Creating view: " + name); try { View view; - if (mFactory2 != null) { - view = mFactory2.onCreateView(parent, name, viewContext, attrs); - } else if (mFactory != null) { - view = mFactory.onCreateView(name, viewContext, attrs); - } else { - view = null; - } + if (mFactory2 != null) view = mFactory2.onCreateView(parent, name, mContext, attrs); + else if (mFactory != null) view = mFactory.onCreateView(name, mContext, attrs); + else view = null; if (view == null && mPrivateFactory != null) { - view = mPrivateFactory.onCreateView(parent, name, viewContext, attrs); + view = mPrivateFactory.onCreateView(parent, name, mContext, attrs); } - + if (view == null) { - final Object lastContext = mConstructorArgs[0]; - mConstructorArgs[0] = viewContext; - try { - if (-1 == name.indexOf('.')) { - view = onCreateView(parent, name, attrs); - } else { - view = createView(name, null, attrs); - } - } finally { - mConstructorArgs[0] = lastContext; + if (-1 == name.indexOf('.')) { + view = onCreateView(parent, name, attrs); + } else { + view = createView(name, null, attrs); } } |