Map<String, ResourceValue> typeMap;
// if allowed, search in the project resources first.
if (frameworkOnly == false) {
typeMap = mProjectResources.get(resType);
ResourceValue item = typeMap.get(resName);
if (item != null) {
return item;
}
}
// now search in the framework resources.
typeMap = mFrameworkResources.get(resType);
ResourceValue item = typeMap.get(resName);
if (item != null) {
return item;
}
// if it was not found and the type is an id, it is possible that the ID was
// generated dynamically when compiling the framework resources.
// Look for it in the R map.
if (mFrameworkProvider != null && resType == ResourceType.ID) {
if (mFrameworkProvider.getId(resType, resName) != null) {
return new ResourceValue(resType, resName, true);
}
}
// didn't find the resource anywhere.
if (mLogger != null) {
mLogger.warning(LayoutLog.TAG_RESOURCES_RESOLVE,
"Couldn't resolve resource @" +
(frameworkOnly ? "android:" : "") + resType + "/" + resName,
new ResourceValue(resType, resName, frameworkOnly));
}
return null;
}