CallEndpointCompat


@RequiresApi(value = 26)
public final class CallEndpointCompat implements Comparable


Constructor for a CallEndpointCompat object.

Summary

Constants

static final int

Indicates that the type of endpoint through which call media flows is a Bluetooth.

static final int

Indicates that the type of endpoint through which call media flows is an earpiece.

static final int

Indicates that the type of endpoint through which call media flows is a speakerphone.

static final int

Indicates that the type of endpoint through which call media flows is an external.

static final int

Indicates that the type of endpoint through which call media flows is unknown type.

static final int

Indicates that the type of endpoint through which call media flows is a wired headset.

Public constructors

CallEndpointCompat(
    @NonNull CharSequence name,
    int type,
    @NonNull ParcelUuid identifier
)

Public methods

int

Compares this CallEndpointCompat to the other CallEndpointCompat for order.

boolean
equals(Object other)
final @NonNull ParcelUuid

A unique identifier for this endpoint on the device

final @NonNull CharSequence

Human-readable name associated with the endpoint

final int

The type of endpoint through which call media being routed Allowed values: TYPE_EARPIECE , TYPE_BLUETOOTH , TYPE_WIRED_HEADSET , TYPE_SPEAKER , TYPE_STREAMING , TYPE_UNKNOWN

int
@NonNull String

Constants

TYPE_BLUETOOTH

public static final int TYPE_BLUETOOTH = 2

Indicates that the type of endpoint through which call media flows is a Bluetooth.

TYPE_EARPIECE

public static final int TYPE_EARPIECE = 1

Indicates that the type of endpoint through which call media flows is an earpiece.

TYPE_SPEAKER

public static final int TYPE_SPEAKER = 4

Indicates that the type of endpoint through which call media flows is a speakerphone.

TYPE_STREAMING

public static final int TYPE_STREAMING = 5

Indicates that the type of endpoint through which call media flows is an external.

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN

Indicates that the type of endpoint through which call media flows is unknown type.

TYPE_WIRED_HEADSET

public static final int TYPE_WIRED_HEADSET = 3

Indicates that the type of endpoint through which call media flows is a wired headset.

Public constructors

CallEndpointCompat

Added in 1.0.0-beta01
public CallEndpointCompat(
    @NonNull CharSequence name,
    int type,
    @NonNull ParcelUuid identifier
)
Parameters
@NonNull CharSequence name

Human-readable name associated with the endpoint

int type

The type of endpoint through which call media being routed Allowed values: TYPE_EARPIECE , TYPE_BLUETOOTH , TYPE_WIRED_HEADSET , TYPE_SPEAKER , TYPE_STREAMING , TYPE_UNKNOWN

@NonNull ParcelUuid identifier

A unique identifier for this endpoint on the device

Public methods

compareTo

Added in 1.0.0-beta01
public int compareTo(@NonNull CallEndpointCompat other)

Compares this CallEndpointCompat to the other CallEndpointCompat for order. Returns a positive number if this type rank is greater than the other value. Returns a negative number if this type rank is less than the other value. Sort the CallEndpoint by type. Ranking them by:

  1. TYPE_WIRED_HEADSET

  2. TYPE_BLUETOOTH

  3. TYPE_SPEAKER

  4. TYPE_EARPIECE

  5. TYPE_STREAMING

  6. TYPE_UNKNOWN If two endpoints have the same type, the name is compared to determine the value.

equals

public boolean equals(Object other)

getIdentifier

Added in 1.0.0-beta01
public final @NonNull ParcelUuid getIdentifier()

A unique identifier for this endpoint on the device

getName

Added in 1.0.0-beta01
public final @NonNull CharSequence getName()

Human-readable name associated with the endpoint

getType

Added in 1.0.0-beta01
public final int getType()

The type of endpoint through which call media being routed Allowed values: TYPE_EARPIECE , TYPE_BLUETOOTH , TYPE_WIRED_HEADSET , TYPE_SPEAKER , TYPE_STREAMING , TYPE_UNKNOWN

hashCode

public int hashCode()

toString

public @NonNull String toString()