use of com.android.aapt.Resources.Id in project bundletool by google.
the class ResourceAnalyzerTest method attributeWithCompiledItem_nonRef_ignored.
@Test
public void attributeWithCompiledItem_nonRef_ignored() throws Exception {
XmlNode manifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", // Attributes of all possible types, except for ref.
ImmutableList.of(// str
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "str", Item.newBuilder().setStr(String.getDefaultInstance()).build()), // raw_str
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "raw_str", Item.newBuilder().setRawStr(RawString.getDefaultInstance()).build()), // styled_str
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "styled_str", Item.newBuilder().setStyledStr(StyledString.getDefaultInstance()).build()), // file
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "file", Item.newBuilder().setFile(FileReference.getDefaultInstance()).build()), // id
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "id", Item.newBuilder().setId(Id.getDefaultInstance()).build()), // prim
xmlCompiledItemAttribute(NO_NAMESPACE_URI, "prim", Item.newBuilder().setPrim(Primitive.getDefaultInstance()).build()))))))).getManifestRoot().getProto();
ResourceTable resourceTable = resourceTable(pkg(0x0f, "com.test.app", type(0x01, "string", entry(0x0099, "not_referenced", value("", DEFAULT_CONFIG)))));
AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(manifest).setResourceTable(resourceTable)).build();
ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromBaseManifest();
assertThat(resourceIds).isEmpty();
}
Aggregations