[RPBB+aapt2] Ensure that XML namespaces are preserved for elements
<dist:module /> is a legal tag for Dynamic Delivery, but the namespaces were
getting stripped off, and aapt2 would complain about a <module /> tag.
RELNOTES: Fixed treatment of <dist:module /> tags in AndroidManifest.xml
@@ -276,6 +276,10 @@ public class ProtoApk implements Closeable {
private void writeXmlFrom(XmlElement element) throws IOException {
ANGLE_OPEN.writeTo(out);
+ if (!element.getNamespaceUriBytes().isEmpty()) {
+ findNamespacePrefix(element.getNamespaceUriBytes()).writeTo(out);
+ COLON.writeTo(out);
+ }
final ByteString name = element.getNameBytes();
name.writeTo(out);
final Map<ByteString, ByteString> namespaces = new HashMap<>();
