# CallsManager

Artifact: [androidx.core:core-telecom](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/telecom/CallsManager.kt+class:androidx.core.telecom.CallsManager) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
@RequiresApi(value = 26)
public final class CallsManager implements CallsManagerExtensions
```

<br />

*** ** * ** ***

CallsManager allows VoIP applications to add their calls to the Android system service Telecom. By doing this, other services are aware of your VoIP application calls which leads to a more stable environment. For example, a wearable may be able to answer an incoming call from your application if the call is added to the Telecom system. VoIP applications that manage calls and do not inform the Telecom system may experience issues with resources (ex. microphone access).

Note that access to some telecom information is permission-protected. Your app cannot access the protected information or gain access to protected functionality unless it has the appropriate permissions declared in its manifest file. Where permissions apply, they are noted in the method descriptions.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_BASELINE()` If your VoIP application does not want support any of the capabilities below, then your application can register with `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_BASELINE()`. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_OPT_OUT_OF_PREMIUM_NETWORK()` Flag indicating that this VoIP application opts out of automatic requests for premium network capabilities. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_SUPPORTS_CALL_STREAMING()` Flag indicating that this VoIP application supports call streaming. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_SUPPORTS_VIDEO_CALLING()` Flag indicating that your VoIP application supports video calling. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CallsManager(android.content.Context)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context)` |

| ### Public methods |
|---|---|
| `final void` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.MANAGE_OWN_CALLS") https://developer.android.com/reference/androidx/core/telecom/CallsManager#addCall(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat callAttributes, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onAnswer, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/telecom/DisconnectCause.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onDisconnect, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetActive, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetInactive, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallControlScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block )` Adds a new call with the specified `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat` to the telecom service. |
| `void` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#addCallWithExtensions(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat callAttributes, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onAnswer, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/telecom/DisconnectCause.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onDisconnect, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetActive, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetInactive, @https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/extensions/ExtensionInitializationScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> init )` Adds a call with extensions support, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat>>` | `https://developer.android.com/reference/androidx/core/telecom/CallsManager#getAvailableStartingCallEndpoints()()` Continuously streams available call audio endpoints that can be used for a new call session. |
| `final void` | `@https://developer.android.com/reference/androidx/annotation/RequiresPermission(value = "android.permission.MANAGE_OWN_CALLS") https://developer.android.com/reference/androidx/core/telecom/CallsManager#registerAppWithTelecom(kotlin.Int,kotlin.Int)(int capabilities, int backwardsCompatSdkLevel)` Registers the application with the Telecom framework. |

## Constants

### CAPABILITY_BASELINE

```
public static final int CAPABILITY_BASELINE
```

If your VoIP application does not want support any of the capabilities below, then your application can register with `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_BASELINE()`.

Note: Calls can still be added and to the Telecom system but if other services request to perform a capability that is not supported by your application, Telecom will notify the service of the inability to perform the action instead of hitting an error.

### CAPABILITY_OPT_OUT_OF_PREMIUM_NETWORK

```
public static final int CAPABILITY_OPT_OUT_OF_PREMIUM_NETWORK
```

Flag indicating that this VoIP application opts out of automatic requests for premium network capabilities.

By default, the system may automatically request a premium network slice for voice and video calls to improve quality of service. Applications with their own sophisticated network management logic can use this flag to disable the system's behavior and manage network requests themselves.

This capability should be passed in {@link #registerAppWithTelecom(int, int)}.

### CAPABILITY_SUPPORTS_CALL_STREAMING

```
public static final int CAPABILITY_SUPPORTS_CALL_STREAMING
```

Flag indicating that this VoIP application supports call streaming. Call streaming means a call can be streamed from a root device to another device to continue the call without completely transferring it. The call continues to take place on the source device, however media and control are streamed to another device. `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat.Companion.CallType`#`https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_SUPPORTS_CALL_STREAMING()` must also be set on per call basis in the event an application wants to gate this capability on a stricter basis.

### CAPABILITY_SUPPORTS_VIDEO_CALLING

```
public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING
```

Flag indicating that your VoIP application supports video calling. This is not an indication that your application is currently able to make a video call, but rather that it has the ability to make video calls (but not necessarily at this time).

Whether a call can make a video call is ultimately controlled by `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat`s capability `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat.Companion.CallType`#`https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#CALL_TYPE_VIDEO_CALL()`, which indicates that particular call is currently capable of making a video call.

## Public constructors

### CallsManager

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public CallsManager(@NonNull Context context)
```

## Public methods

### addCall

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
@RequiresPermission(value = "android.permission.MANAGE_OWN_CALLS")
public final void addCall(
    @NonNull CallAttributesCompat callAttributes,
    @NonNull SuspendFunction1<@NonNull Integer, Unit> onAnswer,
    @NonNull SuspendFunction1<@NonNull DisconnectCause, Unit> onDisconnect,
    @NonNull SuspendFunction0<Unit> onSetActive,
    @NonNull SuspendFunction0<Unit> onSetInactive,
    @NonNull Function1<@NonNull CallControlScope, Unit> block
)
```

Adds a new call with the specified `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat` to the telecom service. This method can be used to add both incoming and outgoing calls. Once the call is ready to be disconnected, use the `https://developer.android.com/reference/androidx/core/telecom/CallControlScope#disconnect(android.telecom.DisconnectCause)`.

**Call Lifecycle** : Your app is given foreground execution priority as long as you have an ongoing call and are posting a `https://developer.android.com/reference/android/app/Notification.CallStyle.html` notification within 5 seconds of adding the call via this method. When your application is given foreground execution priority, your app is treated as a foreground service. Foreground execution priority will prevent the `https://developer.android.com/reference/android/app/ActivityManager.html` from killing your application when it is placed the background. Foreground execution priority is removed from your app when all of your app's calls terminate or your app no longer posts a valid notification.

- Other things that should be noted:

  - For outgoing calls, your application should either immediately post a `https://developer.android.com/reference/android/app/Notification.CallStyle.html` notification or delay adding the call via this addCall method until the remote side is ready.

  - addCall will NOT complete until the call session has ended. Instead, the addCall block, which is called the `https://developer.android.com/reference/androidx/core/telecom/CallControlScope`, will run once the call has been added. Do not put addCall in a function expecting it to return or add logic after the addCall request that is important for the call session.

  - Only one call setup can be in progress at a time. If `https://developer.android.com/reference/androidx/core/telecom/CallsManager#addCall(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.Function1)` is invoked while another call is currently being set up and registered with the system, it will immediately throw an `https://developer.android.com/reference/androidx/core/telecom/CallException` with `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME()`. Client applications must wait for the existing call setup to complete (i.e. until the `https://developer.android.com/reference/androidx/core/telecom/CallControlScope` block begins executing) before initiating another call.

  - Each lambda function (onAnswer, onDisconnect, onSetActive, onSetInactive) will be invoked by Telecom whenever the system needs your VoIP application to change the call state. For example, if there is an ongoing VoIP call in your application and the system receives a sim call, Telecom will invoke onSetInactive to place your call on hold/inactive if the user answers the incoming sim call. These events may not occur during most calls but should still be implemented in the event Telecom needs to manipulate your applications call state.

  - Each lambda function (onAnswer, onDisconnect, onSetActive, onSetInactive) has a timeout of 5000 milliseconds. Failing to complete the suspend fun before the timeout will result in a failed transaction.

  - Telecom assumes each callback (onAnswer, onDisconnect, onSetActive, onSetInactive) is handled successfully on the client side. If the callback cannot be completed, an Exception should be thrown. Telecom will rethrow the Exception and tear down the call session.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat callAttributes` | attributes of the new call (incoming or outgoing, address, etc. ) |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onAnswer` | where callType is the audio/video state the call should be answered as. Telecom is informing your VoIP application to answer an incoming call and set it to active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/telecom/DisconnectCause.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onDisconnect` | where disconnectCause represents the cause for disconnecting the call. Telecom is informing your VoIP application to disconnect the incoming call. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetActive` | Telecom is informing your VoIP application to set the call active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetInactive` | Telecom is informing your VoIP application to set the call inactive. This is the same as holding a call for two endpoints but can be extended to setting a meeting inactive. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g.Wearable). Note: Your app must stop using the microphone and playing incoming media when returning. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallControlScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> block` | DSL interface block that will run when the call is ready |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | if the device is on an invalid build |
| `https://developer.android.com/reference/androidx/core/telecom/CallException` | if the platform cannot add the call (e.g. reached max # of calls) or failed with an exception (e.g. call was already removed) |
| `https://developer.android.com/reference/androidx/core/telecom/CallException` | with error code `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_OPERATION_TIMED_OUT()` if the call failed to be added within 5000 milliseconds |
| `https://developer.android.com/reference/androidx/core/telecom/CallException` | with error code `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME()` if another call setup is currently in progress. Client applications must wait for the existing call setup to complete before initiating another call. |

### addCallWithExtensions

```
public void addCallWithExtensions(
    @NonNull CallAttributesCompat callAttributes,
    @NonNull SuspendFunction1<@NonNull Integer, Unit> onAnswer,
    @NonNull SuspendFunction1<@NonNull DisconnectCause, Unit> onDisconnect,
    @NonNull SuspendFunction0<Unit> onSetActive,
    @NonNull SuspendFunction0<Unit> onSetInactive,
    @NonNull SuspendFunction1<@NonNull ExtensionInitializationScope, Unit> init
)
```

Adds a call with extensions support, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat callAttributes` | attributes of the new call (incoming or outgoing, address, etc. ) |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onAnswer` | where callType is the audio/video state the call should be answered as. Telecom is informing your VoIP application to answer an incoming call and set it to active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/telecom/DisconnectCause.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onDisconnect` | where disconnectCause represents the cause for disconnecting the call. Telecom is informing your VoIP application to disconnect the incoming call. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetActive` | Telecom is informing your VoIP application to set the call active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable). |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction0<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> onSetInactive` | Telecom is informing your VoIP application to set the call inactive. This is the same as holding a call for two endpoints but can be extended to setting a meeting inactive. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g.Wearable). Note: Your app must stop using the microphone and playing incoming media when returning. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull SuspendFunction1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/extensions/ExtensionInitializationScope, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> init` | The scope used to first initialize Extensions that will be used when the call is first notified to the platform and UX surfaces. Once the call is set up, the user's implementation of `https://developer.android.com/reference/androidx/core/telecom/extensions/ExtensionInitializationScope#onCall(kotlin.coroutines.SuspendFunction1)` will be called. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/core/telecom/CallException` | with error code `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME()` if another call setup is currently in progress. Client applications must wait for the existing call setup to complete before initiating another call. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/telecom/extensions/CallsManagerExtensions#addCallWithExtensions(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction1)` |   |

### getAvailableStartingCallEndpoints

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

```
public final @NonNull Flow<@NonNull List<@NonNull CallEndpointCompat>> getAvailableStartingCallEndpoints()
```

Continuously streams available call audio endpoints that can be used for a new call session. This API leverages `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/index.html` to emit updates as the available audio endpoints change.

**Bluetooth Permissions**:

- For API level 31 and above: The `https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_CONNECT` runtime permission is highly recommended.

- For API levels 28-30: The following runtime permissions are highly recommended:

  - `https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH` - Allows apps to view Bluetooth information.

  - `https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADMIN` - Allows apps to connect to paired devices.

For all API levels: Granting these permissions allows the API to display the names of multiple connected Bluetooth devices. Without these permissions, only the active Bluetooth device will be surfaced.

**Coroutine Usage and Cleanup:** The returned `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` from this `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/index.html` should be collected within a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html`. To properly manage resources and prevent leaks, ensure that the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` is cancelled when it's no longer needed. This can be achieved by calling `cancel()` on the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/index.html` of the collecting `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html`. Ideally, this cleanup should occur within the same scope where the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` is being collected.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat>>` | A `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html` that continuously emits a list of available `https://developer.android.com/reference/androidx/core/telecom/CallEndpointCompat`s. |

### registerAppWithTelecom

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
@RequiresPermission(value = "android.permission.MANAGE_OWN_CALLS")
public final void registerAppWithTelecom(int capabilities, int backwardsCompatSdkLevel)
```

Registers the application with the Telecom framework.

VoIP applications should call this API during application setup to register their capabilities (e.g., video) before adding calls via `https://developer.android.com/reference/androidx/core/telecom/CallsManager#addCall(androidx.core.telecom.CallAttributesCompat,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction1,kotlin.coroutines.SuspendFunction0,kotlin.coroutines.SuspendFunction0,kotlin.Function1)`.The library automatically handles unregistering any previous configuration.

**Note:** This method should not be called while there are active calls, as it may cause unexpected behavior or call disconnection.

Core-telecom abstracts two platform implementations: the legacy `ConnectionService` APIs and the modern transactional APIs (introduced in SDK 34). The `backwardsCompatSdkLevel` parameter allows you to control which implementation is used.

| Parameters |
|---|---|
| `int capabilities` | The set of capabilities your application supports, such as `https://developer.android.com/reference/androidx/core/telecom/CallsManager#CAPABILITY_SUPPORTS_VIDEO_CALLING()`. Value is either `0` or a combination of the following: - `1` - `2` - `4` - `8` <br /> |
| `int backwardsCompatSdkLevel` | Sets the highest SDK version (inclusive) that should be forced to use the legacy `ConnectionService` implementation. - **Default:** `VERSION_CODES.TIRAMISU` (33). This default ensures that all devices on SDK 34 and higher will use the modern transactional APIs. - **Behavior:** This parameter provides developers with the flexibility to prefer the behavior of the legacy implementation on specific OS versions. - **Clamping:** The provided value is automatically clamped to a safe range: it cannot be lower than `33` or higher than the current device's SDK version. For example, to force the legacy path on a device running SDK 35, you would pass in `35`. Passing in `40` on an SDK 35 device would be clamped to `35`. |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unsupported-operation-exception/index.html` | if the device is on an invalid build |