CallAttributes.Builder


public static final class CallAttributes.Builder
extends Object

java.lang.Object
   ↳ 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, int callDirection, CharSequence displayName, Uri address)

Constructor for the CallAttributes.Builder class

Public methods

CallAttributes build()

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

CallAttributes.Builder setCallCapabilities(int callCapabilities)

Sets the capabilities of this call.

CallAttributes.Builder setCallType(int callType)

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

CallAttributes.Builder setContactUri(Uri contactUri)

Sets the contact directory URI for the VoIP app.

CallAttributes.Builder setIsGroupCall(boolean isGroupCall)

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

CallAttributes.Builder setLogExcluded(boolean isExcluded)

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

Inherited methods

Public constructors

Builder

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

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
public CallAttributes build ()

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

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

setCallCapabilities

Added in API level 34
public CallAttributes.Builder setCallCapabilities (int callCapabilities)

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:
Returns
CallAttributes.Builder Builder.
This value cannot be null.

setCallType

Added in API level 34
public CallAttributes.Builder setCallType (int callType)

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:
Returns
CallAttributes.Builder Builder.
This value cannot be null.

setContactUri

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

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.

Returns
CallAttributes.Builder Builder.
This value cannot be null.

setIsGroupCall

Added in API level 34
public CallAttributes.Builder setIsGroupCall (boolean isGroupCall)

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

Parameters
isGroupCall boolean: whether the call is a group call.

Returns
CallAttributes.Builder Builder.
This value cannot be null.

setLogExcluded

Added in version 36.1
public CallAttributes.Builder setLogExcluded (boolean isExcluded)

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

Parameters
isExcluded boolean: whether the call should be excluded.

Returns
CallAttributes.Builder Builder.
This value cannot be null.