Added in API level 34

Builder


class Builder
kotlin.Any
   ↳ android.telecom.CallAttributes.Builder

Build an instance of CallAttributes. In order to build a valid instance, a PhoneAccountHandle, call direction, display name, and Uri address are required.

Note: Pass in the same PhoneAccountHandle that was used to register a PhoneAccount with Telecom. see TelecomManager.registerPhoneAccount

Summary

Public constructors
Builder(phoneAccountHandle: PhoneAccountHandle, callDirection: Int, displayName: CharSequence, address: Uri)

Constructor for the CallAttributes.

Public methods
CallAttributes

Build an instance of CallAttributes based on the last values passed to the setters or default values.

CallAttributes.Builder
setCallCapabilities(callCapabilities: Int)

Sets the capabilities of this call.

CallAttributes.Builder
setCallType(callType: Int)

Sets the type of call; uses to indicate if a call is a video call or audio call.

CallAttributes.Builder
setContactUri(contactUri: Uri)

Sets the contact directory URI for the VoIP app.

CallAttributes.Builder
setIsGroupCall(isGroupCall: Boolean)

Sets whether or not this call should be considered a group call.

CallAttributes.Builder
setLogExcluded(isExcluded: Boolean)

Sets the attribute to exclude the call from system call logs.

Public constructors

Builder

Added in API level 34
Builder(
    phoneAccountHandle: PhoneAccountHandle,
    callDirection: Int,
    displayName: CharSequence,
    address: Uri)

Constructor for the CallAttributes.Builder class

Parameters
phoneAccountHandle PhoneAccountHandle: that belongs to package registered with Telecom.
This value cannot be null.
callDirection Int: of the new call that will be added to Telecom.
Value is one of the following:
displayName CharSequence: of the caller for incoming calls or initiating user for outgoing calls.
This value cannot be null.
address Uri: of the caller for incoming calls or destination for outgoing calls.
This value cannot be null.

Public methods

build

Added in API level 34
fun build(): CallAttributes

Build an instance of CallAttributes based on the last values passed to the setters or default values.

Return
CallAttributes an instance of CallAttributes
This value cannot be null.

setCallCapabilities

Added in API level 34
fun setCallCapabilities(callCapabilities: Int): CallAttributes.Builder

Sets the capabilities of this call. Use this to indicate whether your app supports holding, streaming and call transfers.

Parameters
callCapabilities Int: Bitmask of call capabilities.
Value is either 0 or a combination of the following:
Return
CallAttributes.Builder Builder.
This value cannot be null.

setCallType

Added in API level 34
fun setCallType(callType: Int): CallAttributes.Builder

Sets the type of call; uses to indicate if a call is a video call or audio call.

Parameters
callType Int: The call type.
Value is one of the following:
Return
CallAttributes.Builder Builder.
This value cannot be null.

setContactUri

Added in API level 34
fun setContactUri(contactUri: Uri): CallAttributes.Builder

Sets the contact directory URI for the VoIP app. This must be a valid URI pointing to the VoIP contact directory or a valid CP2 contact.

Parameters
contactUri Uri: The contact URI pointing to the VoIP contact directory or CP2 contact.
This value cannot be null.
Return
CallAttributes.Builder Builder.
This value cannot be null.

setIsGroupCall

Added in API level 34
fun setIsGroupCall(isGroupCall: Boolean): CallAttributes.Builder

Sets whether or not this call should be considered a group call.

Parameters
isGroupCall Boolean: whether the call is a group call.
Return
CallAttributes.Builder Builder.
This value cannot be null.

setLogExcluded

fun setLogExcluded(isExcluded: Boolean): CallAttributes.Builder

Sets the attribute to exclude the call from system call logs.

Parameters
isExcluded Boolean: whether the call should be excluded.
Return
CallAttributes.Builder Builder.
This value cannot be null.