VcnWifiUnderlyingNetworkTemplate.Builder


public static final class VcnWifiUnderlyingNetworkTemplate.Builder
extends Object

java.lang.Object
   ↳ android.net.vcn.VcnWifiUnderlyingNetworkTemplate.Builder


This class is used to incrementally build VcnWifiUnderlyingNetworkTemplate objects.

Summary

Public constructors

Builder()

Construct a Builder object.

Public methods

VcnWifiUnderlyingNetworkTemplate build()

Build the VcnWifiUnderlyingNetworkTemplate.

VcnWifiUnderlyingNetworkTemplate.Builder setMetered(int matchCriteria)

Set the matching criteria for metered networks.

VcnWifiUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps(int minEntryDownstreamBandwidthKbps, int minExitDownstreamBandwidthKbps)

Set the minimum upstream bandwidths that this template will match.

VcnWifiUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps(int minEntryUpstreamBandwidthKbps, int minExitUpstreamBandwidthKbps)

Set the minimum upstream bandwidths that this template will match.

VcnWifiUnderlyingNetworkTemplate.Builder setSsids(Set<String> ssids)

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

Inherited methods

Public constructors

Builder

Added in API level 33
public Builder ()

Construct a Builder object.

Public methods

build

Added in API level 33
public VcnWifiUnderlyingNetworkTemplate build ()

Build the VcnWifiUnderlyingNetworkTemplate.

Returns
VcnWifiUnderlyingNetworkTemplate This value cannot be null.

setMetered

Added in API level 33
public VcnWifiUnderlyingNetworkTemplate.Builder setMetered (int matchCriteria)

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 VcnUnderlyingNetworkTemplate.MATCH_ANY. Value is VcnUnderlyingNetworkTemplate.MATCH_ANY, VcnUnderlyingNetworkTemplate.MATCH_REQUIRED, or VcnUnderlyingNetworkTemplate.MATCH_FORBIDDEN

Returns
VcnWifiUnderlyingNetworkTemplate.Builder This value cannot be null.

setMinDownstreamBandwidthKbps

Added in API level 33
public VcnWifiUnderlyingNetworkTemplate.Builder setMinDownstreamBandwidthKbps (int minEntryDownstreamBandwidthKbps, 
                int minExitDownstreamBandwidthKbps)

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.

Returns
VcnWifiUnderlyingNetworkTemplate.Builder this Builder instance, for chaining This value cannot be null.

setMinUpstreamBandwidthKbps

Added in API level 33
public VcnWifiUnderlyingNetworkTemplate.Builder setMinUpstreamBandwidthKbps (int minEntryUpstreamBandwidthKbps, 
                int minExitUpstreamBandwidthKbps)

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.

Returns
VcnWifiUnderlyingNetworkTemplate.Builder this Builder instance, for chaining This value cannot be null.

setSsids

Added in API level 33
public VcnWifiUnderlyingNetworkTemplate.Builder setSsids (Set<String> ssids)

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

Parameters
ssids Set: 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.

Returns
VcnWifiUnderlyingNetworkTemplate.Builder This value cannot be null.