Merge "DO NOT MERGE: Initialize layoutlib variables before using them" into mnc-ub-dev

This commit is contained in:
Diego Perez
2016-03-10 16:06:39 +00:00
committed by Android (Google) Code Review

View File

@@ -89,6 +89,12 @@ public class Resources_Delegate {
// first get the String related to this id in the framework
Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id);
// Set the layoutlib callback and context for resources
if (resources != Resources.mSystem && resources.mLayoutlibCallback == null) {
resources.mLayoutlibCallback = Resources.mSystem.mLayoutlibCallback;
resources.mContext = Resources.mSystem.mContext;
}
if (resourceInfo != null) {
platformResFlag_out[0] = true;
String attributeName = resourceInfo.getSecond();
@@ -98,12 +104,6 @@ public class Resources_Delegate {
resourceInfo.getFirst(), attributeName));
}
// Set the layoutlib callback and context for resources
if (resources != Resources.mSystem && resources.mLayoutlibCallback == null) {
resources.mLayoutlibCallback = Resources.mSystem.mLayoutlibCallback;
resources.mContext = Resources.mSystem.mContext;
}
// didn't find a match in the framework? look in the project.
if (resources.mLayoutlibCallback != null) {
resourceInfo = resources.mLayoutlibCallback.resolveResourceId(id);