ConnectionMigrationOptions


public class ConnectionMigrationOptions
extends Object

java.lang.Object
   ↳ android.net.http.ConnectionMigrationOptions


A class configuring the HTTP connection migration functionality.

Connection migration stops open connections to servers from being destroyed when the client device switches its L4 connectivity (typically the IP address as a result of using a different network). This is particularly common with mobile devices losing wifi connectivity and switching to cellular data, or vice versa (a.k.a. the parking lot problem). QUIC uses connection identifiers which are independent of the underlying transport layer to make this possible. If the client connects to a new network and wants to preserve the existing connection, they can do so by using a connection identifier the server knows to be a continuation of the existing connection.

The features are only available for QUIC connections and the server needs to support connection migration.

Summary

Nested classes

class ConnectionMigrationOptions.Builder

Builder for ConnectionMigrationOptions

Constants

int MIGRATION_OPTION_DISABLED

Option is disabled.

int MIGRATION_OPTION_ENABLED

Option is enabled.

int MIGRATION_OPTION_UNSPECIFIED

Option is unspecified, platform default value will be used.

Public methods

int getAllowNonDefaultNetworkUsage()

See Builder.setAllowNonDefaultNetworkUsage(int)

int getDefaultNetworkMigration()

See Builder.setDefaultNetworkMigration(int)

int getPathDegradationMigration()

See Builder.setPathDegradationMigration(int)

Inherited methods

Constants

MIGRATION_OPTION_DISABLED

Added in API level 34
Also in S Extensions 7
public static final int MIGRATION_OPTION_DISABLED

Option is disabled.

Constant Value: 2 (0x00000002)

MIGRATION_OPTION_ENABLED

Added in API level 34
Also in S Extensions 7
public static final int MIGRATION_OPTION_ENABLED

Option is enabled.

Constant Value: 1 (0x00000001)

MIGRATION_OPTION_UNSPECIFIED

Added in API level 34
Also in S Extensions 7
public static final int MIGRATION_OPTION_UNSPECIFIED

Option is unspecified, platform default value will be used.

Constant Value: 0 (0x00000000)

Public methods

getAllowNonDefaultNetworkUsage

Added in API level 34
Also in S Extensions 7
public int getAllowNonDefaultNetworkUsage ()

See Builder.setAllowNonDefaultNetworkUsage(int)

Returns
int Value is MIGRATION_OPTION_UNSPECIFIED, MIGRATION_OPTION_ENABLED, or MIGRATION_OPTION_DISABLED

getDefaultNetworkMigration

Added in API level 34
Also in S Extensions 7
public int getDefaultNetworkMigration ()

See Builder.setDefaultNetworkMigration(int)

Returns
int Value is MIGRATION_OPTION_UNSPECIFIED, MIGRATION_OPTION_ENABLED, or MIGRATION_OPTION_DISABLED

getPathDegradationMigration

Added in API level 34
Also in S Extensions 7
public int getPathDegradationMigration ()

See Builder.setPathDegradationMigration(int)

Returns
int Value is MIGRATION_OPTION_UNSPECIFIED, MIGRATION_OPTION_ENABLED, or MIGRATION_OPTION_DISABLED