# CallAttributes.Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/telecom/CallAttributes.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                   ||
| ↳ | [android.telecom.CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) |

Build an instance of[CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes). In order to build a valid instance, a[PhoneAccountHandle](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccountHandle), call direction, display name, and[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)address are required.

Note: Pass in the same[PhoneAccountHandle](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccountHandle)that was used to register a[PhoneAccount](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccount)with Telecom. see[TelecomManager.registerPhoneAccount](https://developer.android.com/reference/kotlin/android/telecom/TelecomManager#registerPhoneAccount(android.telecom.PhoneAccount))

## Summary

|                                                                                                                                                                                                                                                                                                                                   Public constructors                                                                                                                                                                                                                                                                                                                                   ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#Builder(android.telecom.PhoneAccountHandle,%20kotlin.Int,%20kotlin.CharSequence,%20android.net.Uri))`(`phoneAccountHandle:` `[PhoneAccountHandle](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccountHandle)`, `callDirection:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `displayName:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`, `address:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)`)` Constructor for the CallAttributes. |

|                                                                                                                                                                                                        Public methods                                                                                                                                                                                                        ||
|------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes)                  | [build](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#build())`()` Build an instance of[CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes)based on the last values passed to the setters or default values.            |
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | [setCallCapabilities](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#setCallCapabilities(kotlin.Int))`(`callCapabilities:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the capabilities of this call.                       |
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | [setCallType](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#setCallType(kotlin.Int))`(`callType:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Sets the type of call; uses to indicate if a call is a video call or audio call.  |
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | [setLogExcluded](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#setLogExcluded(kotlin.Boolean))`(`isExcluded:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Sets the attribute to exclude the call from system call logs. |

## Public constructors

### Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

Constructor for the CallAttributes.Builder class

|                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                          ||
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `phoneAccountHandle` | [PhoneAccountHandle](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccountHandle):that belongs to package registered with Telecom This value cannot be`null`.                                                                                                                                                                                                                                                                                   |
| `callDirection`      | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):of the new call that will be added to Telecom Value is[android.telecom.CallAttributes#DIRECTION_INCOMING](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#DIRECTION_INCOMING:kotlin.Int), or[android.telecom.CallAttributes#DIRECTION_OUTGOING](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#DIRECTION_OUTGOING:kotlin.Int) |
| `displayName`        | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html):of the caller for incoming calls or initiating user for outgoing calls This value cannot be`null`.                                                                                                                                                                                                                                                                      |
| `address`            | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#):of the caller for incoming calls or destination for outgoing calls This value cannot be`null`.                                                                                                                                                                                                                                                                                            |

## Public methods

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun build(): CallAttributes
```

Build an instance of[CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes)based on the last values passed to the setters or default values.

|                                                                                                                  Return                                                                                                                   ||
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| [CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes) | an instance of[CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes)This value cannot be`null`. |

### setCallCapabilities

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Bitmask of call capabilities. Value is either`0`or a combination of[android.telecom.CallAttributes#SUPPORTS_SET_INACTIVE](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#SUPPORTS_SET_INACTIVE:kotlin.Int),[android.telecom.CallAttributes#SUPPORTS_STREAM](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#SUPPORTS_STREAM:kotlin.Int),[android.telecom.CallAttributes#SUPPORTS_TRANSFER](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#SUPPORTS_TRANSFER:kotlin.Int), and[android.telecom.CallAttributes#SUPPORTS_VIDEO_CALLING](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#SUPPORTS_VIDEO_CALLING:kotlin.Int) |

|                                                                        Return                                                                         ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | Builder This value cannot be`null`. |

### setCallType

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
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](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The call type. Value is[android.telecom.CallAttributes#AUDIO_CALL](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#AUDIO_CALL:kotlin.Int), or[android.telecom.CallAttributes#VIDEO_CALL](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#VIDEO_CALL:kotlin.Int) |

|                                                                        Return                                                                         ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | Builder This value cannot be`null`. |

### setLogExcluded

Added in[API level 36.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setLogExcluded(isExcluded: Boolean): CallAttributes.Builder
```

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

|                                                              Parameters                                                               ||
|--------------|-------------------------------------------------------------------------------------------------------------------------|
| `isExcluded` | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):whether the call should be excluded. |

|                                                                        Return                                                                         ||
|------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| [CallAttributes.Builder](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes.Builder#) | Builder This value cannot be`null`. |