From a7cec30f983cbb3d90b13449adf43fec5c1ec677 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Tue, 23 May 2017 11:33:42 -0400 Subject: Resolve inflate attr against default package Change-Id: I2de0f79fb4918770c9f816934b1fc4953073a4f1 Fixes: 38456890 Test: LayoutInflaterTest#testInclude --- core/java/android/view/LayoutInflater.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index f987e4ee184a..ad46d07d61c9 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -923,8 +923,11 @@ public abstract class LayoutInflater { + " include tag: "); } - // Attempt to resolve the "?attr/name" string to an identifier. - layout = context.getResources().getIdentifier(value.substring(1), null, null); + // Attempt to resolve the "?attr/name" string to an attribute + // within the default (e.g. application) package. + layout = context.getResources().getIdentifier( + value.substring(1), "attr", context.getPackageName()); + } // The layout might be referencing a theme attribute. -- cgit v1.2.3-59-g8ed1b