# CallException

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/CallException.kt+class:androidx.core.telecom.CallException) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
public final class CallException extends RuntimeException
```

<br />

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) ||||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) |||
|   |   | ↳ | [java.lang.RuntimeException](https://developer.android.com/reference/java/lang/RuntimeException.html) ||
|   |   |   | ↳ | [androidx.core.telecom.CallException](https://developer.android.com/reference/androidx/core/telecom/CallException) |

*** ** * ** ***

This class defines exceptions that can be thrown when using `https://developer.android.com/reference/androidx/core/telecom/package-summary` APIs.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_BLUETOOTH_DEVICE_IS_NULL() = 8` Telecom was not able to switch the audio route to Bluetooth because the Bluetooth device is null. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE() = 4` The operation has failed because Telecom cannot set the requested call as the current active call. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_DOES_NOT_SUPPORT_HOLD() = 7` The `https://developer.android.com/reference/androidx/core/telecom/CallControlScope#setInactive()` or CallsManager.addCall#onSetInactive failed because the `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` was not set. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_IS_NOT_BEING_TRACKED() = 3` The operation has failed because Telecom has already removed the call from the server side and destroyed all the objects associated with it. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME() = 5` The operation has failed because there is either no PhoneAccount registered with Telecom for the given operation, or the limit of calls has been reached. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL() = 2` The operation has failed due to Telecom failing to hold the current active call for the call attempting to become the new active call. |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_OPERATION_TIMED_OUT() = 6` The operation has failed because the operation failed to complete before the timeout |
| `static final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#ERROR_UNKNOWN() = 1` The operation has failed due to an unknown or unspecified error. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/telecom/CallException#CallException(kotlin.Int)(int code)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/core/telecom/CallException#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#getCode()()` |
| `int` | `https://developer.android.com/reference/androidx/core/telecom/CallException#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/core/telecom/CallException#toString()()` |

### Inherited methods

From [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) `final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html exception)` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` `@https://developer.android.com/reference/androidx/annotation/RecentlyNullable
https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `final @https://developer.android.com/reference/androidx/annotation/NonNull Throwable[]` `@https://developer.android.com/reference/androidx/annotation/RecentlyNonNull
https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintStream.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/io/PrintWriter.html s)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(@https://developer.android.com/reference/androidx/annotation/NonNull StackTraceElement[] stackTrace)`

## Constants

### ERROR_BLUETOOTH_DEVICE_IS_NULL

```
public static final int ERROR_BLUETOOTH_DEVICE_IS_NULL = 8
```

Telecom was not able to switch the audio route to Bluetooth because the Bluetooth device is null. The user should reconnect the Bluetooth device and retry the audio route switch.

### ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE

```
public static final int ERROR_CALL_CANNOT_BE_SET_TO_ACTIVE = 4
```

The operation has failed because Telecom cannot set the requested call as the current active call. The client should end the current active call and re-try the operation.

### ERROR_CALL_DOES_NOT_SUPPORT_HOLD

```
public static final int ERROR_CALL_DOES_NOT_SUPPORT_HOLD = 7
```

The `https://developer.android.com/reference/androidx/core/telecom/CallControlScope#setInactive()` or CallsManager.addCall#onSetInactive failed because the `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` was not set. Please re-add the call with the `https://developer.android.com/reference/androidx/core/telecom/CallAttributesCompat#SUPPORTS_SET_INACTIVE()` if the call should be able to hold.

### ERROR_CALL_IS_NOT_BEING_TRACKED

```
public static final int ERROR_CALL_IS_NOT_BEING_TRACKED = 3
```

The operation has failed because Telecom has already removed the call from the server side and destroyed all the objects associated with it. The client should re-add the call.

### ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME

```
public static final int ERROR_CALL_NOT_PERMITTED_AT_PRESENT_TIME = 5
```

The operation has failed because there is either no PhoneAccount registered with Telecom for the given operation, or the limit of calls has been reached. The client should end the current active call and re-try the failed operation.

### ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL

```
public static final int ERROR_CANNOT_HOLD_CURRENT_ACTIVE_CALL = 2
```

The operation has failed due to Telecom failing to hold the current active call for the call attempting to become the new active call. The client should end the current active call and re-try the failed operation.

### ERROR_OPERATION_TIMED_OUT

```
public static final int ERROR_OPERATION_TIMED_OUT = 6
```

The operation has failed because the operation failed to complete before the timeout

### ERROR_UNKNOWN

```
public static final int ERROR_UNKNOWN = 1
```

The operation has failed due to an unknown or unspecified error.

## Public constructors

### CallException

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

```
public CallException(int code)
```

## Public methods

### equals

```
public boolean equals(Object other)
```

### getCode

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

```
public final int getCode()
```

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```