Builder
class Builder
kotlin.Any | |
↳ | android.net.http.ConnectionMigrationOptions.Builder |
Builder for ConnectionMigrationOptions
.
Summary
Public constructors | |
---|---|
Builder() |
Public methods | |
---|---|
ConnectionMigrationOptions |
build() Creates and returns the final |
ConnectionMigrationOptions.Builder |
setAllowNonDefaultNetworkUsage(state: Int) Sets whether connections can be migrated to an alternate network when Cronet detects a degradation of the path currently in use. |
ConnectionMigrationOptions.Builder |
setDefaultNetworkMigration(state: Int) Sets whether to enable the possibility of migrating connections on default network change. |
ConnectionMigrationOptions.Builder |
setPathDegradationMigration(state: Int) Sets whether to enable the possibility of migrating connections if the current path is performing poorly. |
Public constructors
Public methods
build
fun build(): ConnectionMigrationOptions
Creates and returns the final ConnectionMigrationOptions
instance, based on the values in this builder.
Return | |
---|---|
ConnectionMigrationOptions |
This value cannot be null . |
setAllowNonDefaultNetworkUsage
fun setAllowNonDefaultNetworkUsage(state: Int): ConnectionMigrationOptions.Builder
Sets whether connections can be migrated to an alternate network when Cronet detects a degradation of the path currently in use. Requires setting setPathDegradationMigration(int)
to MIGRATION_OPTION_ENABLED
to have any effect.
Note: This setting can result in requests being sent on non-default metered networks, eating into the users' data budgets and incurring extra costs. Make sure you're using metered networks sparingly.
Parameters | |
---|---|
state |
Int: one of the MIGRATION_OPTION_* values Value is android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_UNSPECIFIED , android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_ENABLED , or android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_DISABLED |
Return | |
---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining This value cannot be null . |
setDefaultNetworkMigration
fun setDefaultNetworkMigration(state: Int): ConnectionMigrationOptions.Builder
Sets whether to enable the possibility of migrating connections on default network change. If enabled, active QUIC connections will be migrated onto the new network when the platform indicates that the default network is changing.
Parameters | |
---|---|
state |
Int: one of the MIGRATION_OPTION_* values Value is android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_UNSPECIFIED , android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_ENABLED , or android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_DISABLED |
Return | |
---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining This value cannot be null . |
See Also
setPathDegradationMigration
fun setPathDegradationMigration(state: Int): ConnectionMigrationOptions.Builder
Sets whether to enable the possibility of migrating connections if the current path is performing poorly.
Depending on other configuration, this can result to migrating the connections within the same default network, or to a non-default network.
Parameters | |
---|---|
state |
Int: one of the MIGRATION_OPTION_* values Value is android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_UNSPECIFIED , android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_ENABLED , or android.net.http.ConnectionMigrationOptions#MIGRATION_OPTION_DISABLED |
Return | |
---|---|
ConnectionMigrationOptions.Builder |
this builder for chaining This value cannot be null . |