Språk

ConnectionMigrationOptions.Builder.SetAllowNonDefaultNetworkUsage Method

Definition

Sets whether connections can be migrated to an alternate network when Cronet detects a degradation of the path currently in use.

[Android.Runtime.Register("setAllowNonDefaultNetworkUsage", "(I)Landroid/net/http/ConnectionMigrationOptions$Builder;", "", ApiSince=34)]
public Android.Net.Http.ConnectionMigrationOptions.Builder SetAllowNonDefaultNetworkUsage(Android.Net.Http.ConnectionMigrationOption state);
[<Android.Runtime.Register("setAllowNonDefaultNetworkUsage", "(I)Landroid/net/http/ConnectionMigrationOptions$Builder;", "", ApiSince=34)>]
member this.SetAllowNonDefaultNetworkUsage : Android.Net.Http.ConnectionMigrationOption -> Android.Net.Http.ConnectionMigrationOptions.Builder

Parameters

state
ConnectionMigrationOption

one of the MIGRATION_OPTION_* values. Value is one of the following: ConnectionMigrationOptions.MIGRATION_OPTION_UNSPECIFIED; ConnectionMigrationOptions.MIGRATION_OPTION_ENABLED; ConnectionMigrationOptions.MIGRATION_OPTION_DISABLED

Returns

this builder for chaining. This value cannot be null.

Attributes

Remarks

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 ConnectionMigrationOptions.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.

Android reference for android.net.http.ConnectionMigrationOptions.Builder.setAllowNonDefaultNetworkUsage.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to