PreferentialNetworkServiceConfig.Builder
public
static
final
class
PreferentialNetworkServiceConfig.Builder
extends Object
| java.lang.Object | |
| ↳ | android.app.admin.PreferentialNetworkServiceConfig.Builder |
Builder used to create PreferentialNetworkServiceConfig objects.
Specify the preferred Network preference
Summary
Public constructors | |
|---|---|
Builder()
Constructs an empty Builder with preferential network disabled by default. |
|
Public methods | |
|---|---|
PreferentialNetworkServiceConfig
|
build()
Returns an instance of |
PreferentialNetworkServiceConfig.Builder
|
setEnabled(boolean isEnabled)
Set the preferential network service enabled state. |
PreferentialNetworkServiceConfig.Builder
|
setExcludedUids(int[] uids)
Set the array of uids who are not allowed through this preferential network service. |
PreferentialNetworkServiceConfig.Builder
|
setFallbackToDefaultConnectionAllowed(boolean allowFallbackToDefaultConnection)
Set whether the default connection should be used as fallback. |
PreferentialNetworkServiceConfig.Builder
|
setIncludedUids(int[] uids)
Set the array of uids whose network access will go through this preferential network service. |
PreferentialNetworkServiceConfig.Builder
|
setNetworkId(int preferenceId)
Set the preferential network identifier. |
Inherited methods | |
|---|---|
Public constructors
Builder
public Builder ()
Constructs an empty Builder with preferential network disabled by default.
Public methods
build
public PreferentialNetworkServiceConfig build ()
Returns an instance of PreferentialNetworkServiceConfig created from the
fields set on this builder.
| Returns | |
|---|---|
PreferentialNetworkServiceConfig |
This value cannot be null. |
setEnabled
public PreferentialNetworkServiceConfig.Builder setEnabled (boolean isEnabled)
Set the preferential network service enabled state. Default value is false.
| Parameters | |
|---|---|
isEnabled |
boolean: the desired network preference to use, true to enable else false |
| Returns | |
|---|---|
PreferentialNetworkServiceConfig.Builder |
The builder to facilitate chaining.
This value cannot be null. |
setExcludedUids
public PreferentialNetworkServiceConfig.Builder setExcludedUids (int[] uids)
Set the array of uids who are not allowed through this preferential network service. Included UIDs and Excluded UIDs can't both be non-empty. if both are empty, it means this request applies to all uids in the user profile. if included is not empty, then only included UIDs are applied. if excluded is not empty, then it is all uids in the user profile except these UIDs.
| Parameters | |
|---|---|
uids |
int: array of excluded uids
This value cannot be null. |
| Returns | |
|---|---|
PreferentialNetworkServiceConfig.Builder |
The builder to facilitate chaining.
This value cannot be null. |
See also:
setFallbackToDefaultConnectionAllowed
public PreferentialNetworkServiceConfig.Builder setFallbackToDefaultConnectionAllowed (boolean allowFallbackToDefaultConnection)
Set whether the default connection should be used as fallback. This boolean configures whether the default connection (default internet or wifi) should be used if a preferential network service connection is not available. Default value is true
| Parameters | |
|---|---|
allowFallbackToDefaultConnection |
boolean: true if fallback is allowed else false |
| Returns | |
|---|---|
PreferentialNetworkServiceConfig.Builder |
The builder to facilitate chaining.
This value cannot be null. |
setIncludedUids
public PreferentialNetworkServiceConfig.Builder setIncludedUids (int[] uids)
Set the array of uids whose network access will go through this preferential network service. Included UIDs and Excluded UIDs can't both be non-empty. if both are empty, it means this request applies to all uids in the user profile. if included is not empty, then only included UIDs are applied. if excluded is not empty, then it is all uids in the user profile except these UIDs.
| Parameters | |
|---|---|
uids |
int: array of included uids
This value cannot be null. |
| Returns | |
|---|---|
PreferentialNetworkServiceConfig.Builder |
The builder to facilitate chaining.
This value cannot be null. |
See also:
setNetworkId
public PreferentialNetworkServiceConfig.Builder setNetworkId (int preferenceId)
Set the preferential network identifier. preference identifier is applicable only if preferential network service is enabled.
| Returns | |
|---|---|
PreferentialNetworkServiceConfig.Builder |
The builder to facilitate chaining.
This value cannot be null. |