Search in sources :

Example 1 with DISTRIBUTION_NAMESPACE_URI

use of com.android.tools.build.bundletool.model.AndroidManifest.DISTRIBUTION_NAMESPACE_URI in project bundletool by google.

the class ManifestProtoUtils method withUserCountriesConditionInternal.

private static ManifestMutator withUserCountriesConditionInternal(ImmutableList<String> codes, Optional<Boolean> exclude) {
    XmlProtoElementBuilder userCountries = XmlProtoElementBuilder.create(DISTRIBUTION_NAMESPACE_URI, "user-countries");
    exclude.ifPresent(excludeValue -> userCountries.addAttribute(XmlProtoAttributeBuilder.create(DISTRIBUTION_NAMESPACE_URI, "exclude").setValueAsBoolean(excludeValue)));
    for (String countryCode : codes) {
        userCountries.addChildElement(XmlProtoElementBuilder.create(DISTRIBUTION_NAMESPACE_URI, "country").addAttribute(XmlProtoAttributeBuilder.create(DISTRIBUTION_NAMESPACE_URI, "code").setValueAsString(countryCode)));
    }
    return manifestElement -> manifestElement.getOrCreateChildElement(DISTRIBUTION_NAMESPACE_URI, "module").getOrCreateChildElement(DISTRIBUTION_NAMESPACE_URI, "delivery").getOrCreateChildElement(DISTRIBUTION_NAMESPACE_URI, "install-time").getOrCreateChildElement(DISTRIBUTION_NAMESPACE_URI, "conditions").addChildElement(userCountries);
}
Also used : ACTIVITY_ALIAS_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.ACTIVITY_ALIAS_ELEMENT_NAME) PERMISSION_TREE_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.PERMISSION_TREE_ELEMENT_NAME) Arrays(java.util.Arrays) ISOLATED_SPLITS_ID(com.android.tools.build.bundletool.model.AndroidManifest.ISOLATED_SPLITS_ID) VERSION_CODE_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.VERSION_CODE_RESOURCE_ID) INSTALL_LOCATION_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.INSTALL_LOCATION_ATTRIBUTE_NAME) TARGET_SANDBOX_VERSION_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.TARGET_SANDBOX_VERSION_RESOURCE_ID) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) EXTRACT_NATIVE_LIBS_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.EXTRACT_NATIVE_LIBS_ATTRIBUTE_NAME) XmlAttribute(com.android.aapt.Resources.XmlAttribute) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) Item(com.android.aapt.Resources.Item) DeliveryType(com.android.bundle.Commands.DeliveryType) SUPPORTS_GL_TEXTURE_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.SUPPORTS_GL_TEXTURE_ELEMENT_NAME) PROVIDER_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.PROVIDER_ELEMENT_NAME) XmlNamespace(com.android.aapt.Resources.XmlNamespace) META_DATA_KEY_FUSED_MODULE_NAMES(com.android.tools.build.bundletool.model.AndroidManifest.META_DATA_KEY_FUSED_MODULE_NAMES) NAME_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.NAME_RESOURCE_ID) SDK_LIBRARY_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.SDK_LIBRARY_ELEMENT_NAME) SPLIT_NAME_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.SPLIT_NAME_ATTRIBUTE_NAME) MAX_SDK_VERSION_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.MAX_SDK_VERSION_ATTRIBUTE_NAME) SPLIT_NAME_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.SPLIT_NAME_RESOURCE_ID) XmlProtoElementBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoElementBuilder) Reference(com.android.aapt.Resources.Reference) VALUE_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.VALUE_RESOURCE_ID) VALUE_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.VALUE_ATTRIBUTE_NAME) VERSION_NAME_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.VERSION_NAME_ATTRIBUTE_NAME) NATIVE_ACTIVITY_LIB_NAME(com.android.tools.build.bundletool.model.AndroidManifest.NATIVE_ACTIVITY_LIB_NAME) VERSION_NAME_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.VERSION_NAME_RESOURCE_ID) Optional(java.util.Optional) PERMISSION_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.PERMISSION_ELEMENT_NAME) ICON_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.ICON_RESOURCE_ID) ICON_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.ICON_ATTRIBUTE_NAME) DEVICE_GROUP_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.DEVICE_GROUP_ELEMENT_NAME) RESOURCE_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.RESOURCE_RESOURCE_ID) RECEIVER_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.RECEIVER_ELEMENT_NAME) XmlProtoNode(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoNode) XmlProtoAttributeBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoAttributeBuilder) PERMISSION_GROUP_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.PERMISSION_GROUP_ELEMENT_NAME) THEME_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.THEME_RESOURCE_ID) DISTRIBUTION_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.DISTRIBUTION_NAMESPACE_URI) Function(java.util.function.Function) META_DATA_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.META_DATA_ELEMENT_NAME) CONDITION_DEVICE_GROUPS_NAME(com.android.tools.build.bundletool.model.AndroidManifest.CONDITION_DEVICE_GROUPS_NAME) EXTRACT_NATIVE_LIBS_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.EXTRACT_NATIVE_LIBS_RESOURCE_ID) ImmutableList(com.google.common.collect.ImmutableList) ACTIVITY_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.ACTIVITY_ELEMENT_NAME) MODULE_TYPE_ASSET_VALUE(com.android.tools.build.bundletool.model.AndroidManifest.MODULE_TYPE_ASSET_VALUE) INSTALL_LOCATION_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.INSTALL_LOCATION_RESOURCE_ID) MAX_SDK_VERSION_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.MAX_SDK_VERSION_RESOURCE_ID) XmlProtoNodeBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoNodeBuilder) Nullable(javax.annotation.Nullable) APPLICATION_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.APPLICATION_ELEMENT_NAME) USES_SDK_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.USES_SDK_ELEMENT_NAME) MIN_SDK_VERSION_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.MIN_SDK_VERSION_RESOURCE_ID) THEME_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.THEME_ATTRIBUTE_NAME) ObjectArrays(com.google.common.collect.ObjectArrays) MIN_SDK_VERSION_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.MIN_SDK_VERSION_ATTRIBUTE_NAME) TARGET_SDK_VERSION_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.TARGET_SDK_VERSION_RESOURCE_ID) SDK_MAJOR_VERSION_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.SDK_MAJOR_VERSION_ATTRIBUTE_NAME) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) TARGET_SDK_VERSION_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.TARGET_SDK_VERSION_ATTRIBUTE_NAME) Consumer(java.util.function.Consumer) XmlNode(com.android.aapt.Resources.XmlNode) SERVICE_ELEMENT_NAME(com.android.tools.build.bundletool.model.AndroidManifest.SERVICE_ELEMENT_NAME) HAS_CODE_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.HAS_CODE_RESOURCE_ID) XmlElement(com.android.aapt.Resources.XmlElement) DEBUGGABLE_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.DEBUGGABLE_ATTRIBUTE_NAME) Resources(com.android.aapt.Resources) NAME_ATTRIBUTE_NAME(com.android.tools.build.bundletool.model.AndroidManifest.NAME_ATTRIBUTE_NAME) DEBUGGABLE_RESOURCE_ID(com.android.tools.build.bundletool.model.AndroidManifest.DEBUGGABLE_RESOURCE_ID) XmlProtoElementBuilder(com.android.tools.build.bundletool.model.utils.xmlproto.XmlProtoElementBuilder)

Aggregations

Resources (com.android.aapt.Resources)1 Item (com.android.aapt.Resources.Item)1 Primitive (com.android.aapt.Resources.Primitive)1 Reference (com.android.aapt.Resources.Reference)1 XmlAttribute (com.android.aapt.Resources.XmlAttribute)1 XmlElement (com.android.aapt.Resources.XmlElement)1 XmlNamespace (com.android.aapt.Resources.XmlNamespace)1 XmlNode (com.android.aapt.Resources.XmlNode)1 DeliveryType (com.android.bundle.Commands.DeliveryType)1 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)1 ACTIVITY_ALIAS_ELEMENT_NAME (com.android.tools.build.bundletool.model.AndroidManifest.ACTIVITY_ALIAS_ELEMENT_NAME)1 ACTIVITY_ELEMENT_NAME (com.android.tools.build.bundletool.model.AndroidManifest.ACTIVITY_ELEMENT_NAME)1 ANDROID_NAMESPACE_URI (com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI)1 APPLICATION_ELEMENT_NAME (com.android.tools.build.bundletool.model.AndroidManifest.APPLICATION_ELEMENT_NAME)1 CONDITION_DEVICE_GROUPS_NAME (com.android.tools.build.bundletool.model.AndroidManifest.CONDITION_DEVICE_GROUPS_NAME)1 DEBUGGABLE_ATTRIBUTE_NAME (com.android.tools.build.bundletool.model.AndroidManifest.DEBUGGABLE_ATTRIBUTE_NAME)1 DEBUGGABLE_RESOURCE_ID (com.android.tools.build.bundletool.model.AndroidManifest.DEBUGGABLE_RESOURCE_ID)1 DEVICE_GROUP_ELEMENT_NAME (com.android.tools.build.bundletool.model.AndroidManifest.DEVICE_GROUP_ELEMENT_NAME)1 DISTRIBUTION_NAMESPACE_URI (com.android.tools.build.bundletool.model.AndroidManifest.DISTRIBUTION_NAMESPACE_URI)1 EXTRACT_NATIVE_LIBS_ATTRIBUTE_NAME (com.android.tools.build.bundletool.model.AndroidManifest.EXTRACT_NATIVE_LIBS_ATTRIBUTE_NAME)1