Search in sources :

Example 1 with Receiver

use of com.android.tools.build.bundletool.model.manifestelements.Receiver in project bundletool by google.

the class ManifestEditorTest method addReceiver.

@Test
public void addReceiver() throws Exception {
    Receiver receiver = Receiver.builder().setName("receiverName").build();
    XmlNode receiverXmlNode = XmlNode.newBuilder().setElement(receiver.asXmlProtoElement().getProto()).build();
    AndroidManifest androidManifest = AndroidManifest.create(androidManifest("com.test.app"));
    AndroidManifest editedManifest = androidManifest.toEditor().addReceiver(receiver).save();
    assertThat(getApplicationElement(editedManifest).getChildList()).containsExactly(receiverXmlNode);
}
Also used : XmlNode(com.android.aapt.Resources.XmlNode) Receiver(com.android.tools.build.bundletool.model.manifestelements.Receiver) Test(org.junit.Test)

Aggregations

XmlNode (com.android.aapt.Resources.XmlNode)1 Receiver (com.android.tools.build.bundletool.model.manifestelements.Receiver)1 Test (org.junit.Test)1