# CallControl

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

# CallControl

*** ** * ** ***

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

```
class CallControl
```

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

CallControl provides client side control of a call. Each Call will get an individual CallControl instance in which the client can alter the state of the associated call. Outgoing and incoming calls should move to active (via[CallControl.setActive(Executor, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/telecom/CallControl#setActive(java.util.concurrent.Executor,%20android.os.OutcomeReceiver))or answered (via[CallControl.answer(int, Executor, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/telecom/CallControl#answer(kotlin.Int,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))before 60 seconds. If the new call is not moved to active or answered before 60 seconds, the call will be disconnected.

Each method is Transactional meaning that it can succeed or fail. If a transaction succeeds, the[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called by Telecom. Otherwise, the[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))is called and provides a[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)that details why the operation failed.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                     Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [answer](https://developer.android.com/reference/kotlin/android/telecom/CallControl#answer(kotlin.Int,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`videoState:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request Telecom answer an incoming call.                                                                                                |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [disconnect](https://developer.android.com/reference/kotlin/android/telecom/CallControl#disconnect(android.telecom.DisconnectCause,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`disconnectCause:` `[DisconnectCause](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause)`, `executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request Telecom disconnect the call and remove the call from telecom tracking. |
| [ParcelUuid](https://developer.android.com/reference/kotlin/android/os/ParcelUuid.html#) | [getCallId](https://developer.android.com/reference/kotlin/android/telecom/CallControl#getCallId())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [requestCallEndpointChange](https://developer.android.com/reference/kotlin/android/telecom/CallControl#requestCallEndpointChange(android.telecom.CallEndpoint,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`callEndpoint:` `[CallEndpoint](https://developer.android.com/reference/kotlin/android/telecom/CallEndpoint)`, `executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request a CallEndpoint change.                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [requestMuteState](https://developer.android.com/reference/kotlin/android/telecom/CallControl#requestMuteState(kotlin.Boolean,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`isMuted:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, `executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request a new mute state.                                                                                  |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [requestVideoState](https://developer.android.com/reference/kotlin/android/telecom/CallControl#requestVideoState(kotlin.Int,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`videoState:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request a new video state for the ongoing call.                                                                   |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [sendEvent](https://developer.android.com/reference/kotlin/android/telecom/CallControl#sendEvent(kotlin.String,%20android.os.Bundle))`(`event:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `extras:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)`)` Raises an event to the[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)implementations tracking this call via[android.telecom.Call.Callback#onConnectionEvent(Call, String, Bundle)](https://developer.android.com/reference/kotlin/android/telecom/Call.Callback#onConnectionEvent(android.telecom.Call,%20kotlin.String,%20android.os.Bundle)).                                                                             |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [setActive](https://developer.android.com/reference/kotlin/android/telecom/CallControl#setActive(java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request Telecom set the call state to active.                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [setInactive](https://developer.android.com/reference/kotlin/android/telecom/CallControl#setInactive(java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request Telecom set the call state to inactive.                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)             | [startCallStreaming](https://developer.android.com/reference/kotlin/android/telecom/CallControl#startCallStreaming(java.util.concurrent.Executor,%20android.os.OutcomeReceiver))`(`executor:` `[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)`, `callback:` `[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,` `[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!>`)` Request start a call streaming session.                                                                                                                                                                                   |

## Public methods

### answer

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

```
fun answer(
    videoState: Int, 
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request Telecom answer an incoming call. For outgoing calls and calls that have been placed on hold, use[CallControl.setActive(Executor, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/telecom/CallControl#setActive(java.util.concurrent.Executor,%20android.os.OutcomeReceiver)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `videoState` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):to report to Telecom. Telecom will store VideoState in the event another service/device requests it in order to continue the call on another screen. 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)                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `executor`   | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                  |
| `callback`   | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully switched the call state to active[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to set the call state to active. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

### disconnect

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

```
fun disconnect(
    disconnectCause: DisconnectCause, 
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request Telecom disconnect the call and remove the call from telecom tracking.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `disconnectCause` | [DisconnectCause](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause):represents the cause for disconnecting the call. The only valid codes for the[android.telecom.DisconnectCause](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause)passed in are: - [DisconnectCause.LOCAL](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause#LOCAL:kotlin.Int) - [DisconnectCause.REMOTE](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause#REMOTE:kotlin.Int) - [DisconnectCause.REJECTED](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause#REJECTED:kotlin.Int) - [DisconnectCause.MISSED](https://developer.android.com/reference/kotlin/android/telecom/DisconnectCause#MISSED:kotlin.Int) This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `executor`        | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `callback`        | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:That will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully disconnected the call.[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to disconnect the call. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. Note: After the call has been successfully disconnected, calling any CallControl API will result in the[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))with[CallException.CODE_CALL_IS_NOT_BEING_TRACKED](https://developer.android.com/reference/kotlin/android/telecom/CallException#CODE_CALL_IS_NOT_BEING_TRACKED:kotlin.Int). This value cannot be`null`. |

### getCallId

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

```
fun getCallId(): ParcelUuid
```

|                                                                                                            Return                                                                                                            ||
|------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|
| [ParcelUuid](https://developer.android.com/reference/kotlin/android/os/ParcelUuid.html#) | the callId Telecom assigned to this CallControl object which should be attached to an individual call. This value cannot be`null`. |

### requestCallEndpointChange

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

```
fun requestCallEndpointChange(
    callEndpoint: CallEndpoint, 
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request a CallEndpoint change. Clients should not define their own CallEndpoint when requesting a change. Instead, the new endpoint should be one of the valid endpoints provided by[CallEventCallback.onAvailableCallEndpointsChanged(List)](https://developer.android.com/reference/kotlin/android/telecom/CallEventCallback#onAvailableCallEndpointsChanged(kotlin.collections.MutableList)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ||
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `callEndpoint` | [CallEndpoint](https://developer.android.com/reference/kotlin/android/telecom/CallEndpoint):The[CallEndpoint](https://developer.android.com/reference/kotlin/android/telecom/CallEndpoint)to change to. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `executor`     | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                                                                                                                                          |
| `callback`     | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:The[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully changed the CallEndpoint that was requested.[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to switch to the requested CallEndpoint. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

### requestMuteState

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

```
fun requestMuteState(
    isMuted: Boolean, 
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request a new mute state. Note:[CallEventCallback.onMuteStateChanged(boolean)](https://developer.android.com/reference/kotlin/android/telecom/CallEventCallback#onMuteStateChanged(kotlin.Boolean))will be called every time the mute state is changed and can be used to track the current mute state.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ||
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `isMuted`  | [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html):The new mute state. Passing in a[Boolean.TRUE](https://developer.android.com/reference/kotlin/java/lang/Boolean.html#TRUE:kotlin.Boolean)for the isMuted parameter will mute the call.[Boolean.FALSE](https://developer.android.com/reference/kotlin/java/lang/Boolean.html#FALSE:kotlin.Boolean)will unmute the call.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                                                                                                         |
| `callback` | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:The[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully changed the mute state.[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to switch to the mute state. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

### requestVideoState

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

```
fun requestVideoState(
    videoState: Int, 
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request a new video state for the ongoing call. This can only be changed if the application has registered a[PhoneAccount](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccount)with the[PhoneAccount.CAPABILITY_SUPPORTS_VIDEO_CALLING](https://developer.android.com/reference/kotlin/android/telecom/PhoneAccount#CAPABILITY_SUPPORTS_VIDEO_CALLING:kotlin.Int)and set the[CallAttributes.SUPPORTS_VIDEO_CALLING](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes#SUPPORTS_VIDEO_CALLING:kotlin.Int)when adding the call via[TelecomManager.addCall(CallAttributes, Executor, OutcomeReceiver,](https://developer.android.com/reference/kotlin/android/telecom/TelecomManager#addCall(android.telecom.CallAttributes,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver,%20android.telecom.CallControlCallback,%20android.telecom.CallEventCallback))

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `videoState` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):to report to Telecom. To see the valid argument to pass, see android.telecom.CallAttributes.CallType. 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)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `executor`   | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                     |
| `callback`   | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully switched the video state.[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to set the new video state. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

|                                                                             Exceptions                                                                              ||
|--------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `java.lang.IllegalArgumentException` | if the argument passed for videoState is invalid. To see a list of valid states, see android.telecom.CallAttributes.CallType. |

### sendEvent

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

```
fun sendEvent(
    event: String, 
    extras: Bundle
): Unit
```

Raises an event to the[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)implementations tracking this call via[android.telecom.Call.Callback#onConnectionEvent(Call, String, Bundle)](https://developer.android.com/reference/kotlin/android/telecom/Call.Callback#onConnectionEvent(android.telecom.Call,%20kotlin.String,%20android.os.Bundle)). These events and the associated extra keys for the`Bundle`parameter are mutually defined by a VoIP application and[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService). This API is used to relay additional information about a call other than what is specified in the[android.telecom.CallAttributes](https://developer.android.com/reference/kotlin/android/telecom/CallAttributes)to[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)s. This might include, for example, a change to the list of participants in a meeting, or the name of the speakers who have their hand raised. Where appropriate, the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)s tracking this call may choose to render this additional information about the call. An automotive calling UX, for example may have enough screen real estate to indicate the number of participants in a meeting, but to prevent distractions could suppress the list of participants.

|                                                                                                                                                                                                       Parameters                                                                                                                                                                                                       ||
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `event`  | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html):a string event identifier agreed upon between a VoIP application and an[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)This value cannot be`null`.                                                                                                             |
| `extras` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#):a[android.os.Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)containing information about the event, as agreed upon between a VoIP application and[android.telecom.InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService). This value cannot be`null`. |

### setActive

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

```
fun setActive(
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request Telecom set the call state to active. This method should be called when either an outgoing call is ready to go active or a held call is ready to go active again. For incoming calls that are ready to be answered, use[CallControl.answer(int, Executor, OutcomeReceiver)](https://developer.android.com/reference/kotlin/android/telecom/CallControl#answer(kotlin.Int,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                  |
| `callback` | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully switched the call state to active[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to set the call state to active. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

### setInactive

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

```
fun setInactive(
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request Telecom set the call state to inactive. This the same as hold for two call endpoints but can be extended to setting a meeting to inactive.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                                      |
| `callback` | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully switched the call state to inactive[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to set the call state to inactive. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |

### startCallStreaming

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

```
fun startCallStreaming(
    executor: Executor, 
    callback: OutcomeReceiver<Void!, CallException!>
): Unit
```

Request start a call streaming session. On receiving valid request, telecom will bind to the`CallStreamingService`implemented by a general call streaming sender. So that the call streaming sender can perform streaming local device audio to another remote device and control the call during streaming.

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ||
|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#):The[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)on which the[OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)callback will be called on. Callback and listener events are dispatched through this[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#), providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use[Context.getMainExecutor()](https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()). Otherwise, provide an[Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#)that dispatches to an appropriate thread. This value cannot be`null`.                                                        |
| `callback` | [OutcomeReceiver](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#)\<[Void](https://developer.android.com/reference/kotlin/java/lang/Void.html#)!,[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)!\>:that will be completed on the Telecom side that details success or failure of the requested operation.[OutcomeReceiver.onResult](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onResult(android.os.OutcomeReceiver.R))will be called if Telecom has successfully started the call streaming.[OutcomeReceiver.onError](https://developer.android.com/reference/kotlin/android/os/OutcomeReceiver.html#onError(android.os.OutcomeReceiver.E))will be called if Telecom has failed to start the call streaming. A[CallException](https://developer.android.com/reference/kotlin/android/telecom/CallException)will be passed that details why the operation failed. This value cannot be`null`. |