api-impl/android/content: implement metadata bundle in PackageInfo

This commit is contained in:
Mis012
2023-10-08 22:33:14 +02:00
parent 2bb61d98be
commit 1b33acb658
3 changed files with 36 additions and 6 deletions

View File

@@ -834,7 +834,12 @@ public final class AssetManager {
for (TableBlock tableBlock : tableBlocks) {
for (PackageBlock packageBlock : tableBlock.listPackages()) {
if (packageBlock.getName().equals(defPackage)) {
return packageBlock.getEntry("", type, name).getResourceId();
Entry entry = packageBlock.getEntry("", type, name);
if(entry != null) {
return entry.getResourceId();
} else {
return -1; // TODO: investigate
}
}
}
}