Added in API level 33

Builder


class Builder
kotlin.Any
   ↳ android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder

This class is used to incrementally build VcnWifiUnderlyingNetworkTemplate objects.

Summary

Public constructors

Construct a Builder object.

Public methods
VcnWifiUnderlyingNetworkTemplate

Build the VcnWifiUnderlyingNetworkTemplate.

VcnWifiUnderlyingNetworkTemplate.Builder
setMetered(matchCriteria: Int)

Set the matching criteria for metered networks.

VcnWifiUnderlyingNetworkTemplate.Builder
setMinDownstreamBandwidthKbps(minEntryDownstreamBandwidthKbps: Int, minExitDownstreamBandwidthKbps: Int)

Set the minimum upstream bandwidths that this template will match.

VcnWifiUnderlyingNetworkTemplate.Builder
setMinUpstreamBandwidthKbps(minEntryUpstreamBandwidthKbps: Int, minExitUpstreamBandwidthKbps: Int)

Set the minimum upstream bandwidths that this template will match.

VcnWifiUnderlyingNetworkTemplate.Builder

Set the SSIDs with which a network can match this priority rule.

Public constructors

Builder

Added in API level 33
Builder()

Construct a Builder object.

Public methods

build

Added in API level 33
fun build(): VcnWifiUnderlyingNetworkTemplate

Build the VcnWifiUnderlyingNetworkTemplate.

Return
VcnWifiUnderlyingNetworkTemplate This value cannot be null.

setMetered

Added in API level 33
fun setMetered(matchCriteria: Int): VcnWifiUnderlyingNetworkTemplate.Builder

Set the matching criteria for metered networks.

A template where setMetered(MATCH_REQUIRED) will only match metered networks (one without NET_CAPABILITY_NOT_METERED). A template where setMetered(MATCH_FORBIDDEN) will only match a network that is not metered (one with NET_CAPABILITY_NOT_METERED).

Parameters
matchCriteria Int: the matching criteria for metered networks. Defaults to MATCH_ANY. Value is android.net.vcn.VcnUnderlyingNetworkTemplate#MATCH_ANY, android.net.vcn.VcnUnderlyingNetworkTemplate#MATCH_REQUIRED, or android.net.vcn.VcnUnderlyingNetworkTemplate#MATCH_FORBIDDEN
Return
VcnWifiUnderlyingNetworkTemplate.Builder This value cannot be null.

setMinDownstreamBandwidthKbps

Added in API level 33
fun setMinDownstreamBandwidthKbps(
    minEntryDownstreamBandwidthKbps: Int,
    minExitDownstreamBandwidthKbps: Int
): VcnWifiUnderlyingNetworkTemplate.Builder

Set the minimum upstream bandwidths that this template will match.

This template will not match a network that does not provide at least the bandwidth passed as the entry bandwidth, except in the case that the network is selected as the VCN Gateway Connection's underlying network, where it will continue to match until the bandwidth drops under the exit bandwidth.

The entry criteria MUST be greater than, or equal to the exit criteria to avoid the invalid case where a network fulfills the entry criteria, but at the same time fails the exit criteria.

Estimated bandwidth of a network is provided by the transport layer, and reported in NetworkCapabilities. The provided estimates will be used without modification.

Parameters
minEntryDownstreamBandwidthKbps Int: the minimum accepted downstream bandwidth for networks that ARE NOT the already-selected underlying network, or 0 to disable this requirement. Disabled by default.
minExitDownstreamBandwidthKbps Int: the minimum accepted downstream bandwidth for a network that IS the already-selected underlying network, or 0 to disable this requirement. Disabled by default.
Return
VcnWifiUnderlyingNetworkTemplate.Builder this Builder instance, for chaining This value cannot be null.

setMinUpstreamBandwidthKbps

Added in API level 33
fun setMinUpstreamBandwidthKbps(
    minEntryUpstreamBandwidthKbps: Int,
    minExitUpstreamBandwidthKbps: Int
): VcnWifiUnderlyingNetworkTemplate.Builder

Set the minimum upstream bandwidths that this template will match.

This template will not match a network that does not provide at least the bandwidth passed as the entry bandwidth, except in the case that the network is selected as the VCN Gateway Connection's underlying network, where it will continue to match until the bandwidth drops under the exit bandwidth.

The entry criteria MUST be greater than, or equal to the exit criteria to avoid the invalid case where a network fulfills the entry criteria, but at the same time fails the exit criteria.

Estimated bandwidth of a network is provided by the transport layer, and reported in NetworkCapabilities. The provided estimates will be used without modification.

Parameters
minEntryUpstreamBandwidthKbps Int: the minimum accepted upstream bandwidth for networks that ARE NOT the already-selected underlying network, or 0 to disable this requirement. Disabled by default.
minExitUpstreamBandwidthKbps Int: the minimum accepted upstream bandwidth for a network that IS the already-selected underlying network, or 0 to disable this requirement. Disabled by default.
Return
VcnWifiUnderlyingNetworkTemplate.Builder this Builder instance, for chaining This value cannot be null.

setSsids

Added in API level 33
fun setSsids(ssids: MutableSet<String!>): VcnWifiUnderlyingNetworkTemplate.Builder

Set the SSIDs with which a network can match this priority rule.

Parameters
ssids MutableSet<String!>: the matching SSIDs. Network with one of the matching SSIDs can match this priority rule. If the set is empty, any SSID will match. The default is an empty set. This value cannot be null.
Return
VcnWifiUnderlyingNetworkTemplate.Builder This value cannot be null.