public com.android.server.AttributeCache$Entry | get(java.lang.String packageName, int resId, int[] styleable, int userId)
synchronized (this) {
Package pkg = mPackages.get(packageName);
HashMap<int[], Entry> map = null;
Entry ent = null;
if (pkg != null) {
map = pkg.mMap.get(resId);
if (map != null) {
ent = map.get(styleable);
if (ent != null) {
return ent;
}
}
} else {
Context context;
try {
context = mContext.createPackageContextAsUser(packageName, 0,
new UserHandle(userId));
if (context == null) {
return null;
}
} catch (PackageManager.NameNotFoundException e) {
return null;
}
pkg = new Package(context);
mPackages.put(packageName, pkg);
}
if (map == null) {
map = new HashMap<int[], Entry>();
pkg.mMap.put(resId, map);
}
try {
ent = new Entry(pkg.context,
pkg.context.obtainStyledAttributes(resId, styleable));
map.put(styleable, ent);
} catch (Resources.NotFoundException e) {
return null;
}
return ent;
}
|