# InCallService.VideoCall.Callback

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

# Callback

*** ** * ** ***

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

```
abstract class Callback
```

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

The[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)extends this class to provide a means of receiving callbacks from the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider).

When the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)receives the[Call.Callback.onVideoCallChanged(Call, VideoCall)](https://developer.android.com/reference/kotlin/android/telecom/Call.Callback#onVideoCallChanged(android.telecom.Call,%20android.telecom.InCallService.VideoCall))callback, it should create an instance its[VideoCall.Callback](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#)implementation and set it on the[VideoCall](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall)using[VideoCall.registerCallback(Callback)](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall#registerCallback(android.telecom.InCallService.VideoCall.Callback)).

## Summary

|                                                         Public constructors                                                          ||
|-----------------------------------------------------------------------------------------------------------------------------------|---|
| [Callback](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#Callback())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                                                                                                                                          Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallDataUsageChanged](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onCallDataUsageChanged(kotlin.Long))`(`dataUsage:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Handles an update to the total data used for the current video session.                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCallSessionEvent](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onCallSessionEvent(kotlin.Int))`(`event:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Handles events related to the current video session which the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)may wish to handle.                                                                                                                                                                                                                                                                                                                                                                                 |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCameraCapabilitiesChanged](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onCameraCapabilitiesChanged(android.telecom.VideoProfile.CameraCapabilities))`(`cameraCapabilities:` `[VideoProfile.CameraCapabilities](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile.CameraCapabilities)!`)` Handles a change in the capabilities of the currently selected camera.                                                                                                                                                                                                                                                                                                                                                            |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onPeerDimensionsChanged](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onPeerDimensionsChanged(kotlin.Int,%20kotlin.Int))`(`width:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `height:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Handles a change to the video dimensions from the peer device.                                                                                                                                                                                                                                                                                                                                                                                |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSessionModifyRequestReceived](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onSessionModifyRequestReceived(android.telecom.VideoProfile))`(`videoProfile:` `[VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!`)` Called when the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)receives a session modification request from the peer device.                                                                                                                                                                                                                                                                                            |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSessionModifyResponseReceived](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onSessionModifyResponseReceived(kotlin.Int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))`(`status:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `requestedProfile:` `[VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!`, `responseProfile:` `[VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!`)` Called when the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)receives a response to a session modification request previously sent to the peer device. |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onVideoQualityChanged](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall.Callback#onVideoQualityChanged(kotlin.Int))`(`videoQuality:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Handles a change to the video quality.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

## Public constructors

### Callback

```
Callback()
```

## Public methods

### onCallDataUsageChanged

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

```
abstract fun onCallDataUsageChanged(dataUsage: Long): Unit
```

Handles an update to the total data used for the current video session.

Used by the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)in response to[VideoCall.requestCallDataUsage()](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall#requestCallDataUsage()). May also be called periodically by the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider).

Callback originates from[Connection.VideoProvider.setCallDataUsage(long)](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#setCallDataUsage(kotlin.Long)).

|                                                          Parameters                                                          ||
|-------------|-----------------------------------------------------------------------------------------------------------------|
| `dataUsage` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The updated data usage (in bytes). |

### onCallSessionEvent

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

```
abstract fun onCallSessionEvent(event: Int): Unit
```

Handles events related to the current video session which the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)may wish to handle. These are separate from requested changes to the session due to the underlying protocol or connection.

Callback originates from[Connection.VideoProvider.handleCallSessionEvent(int)](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#handleCallSessionEvent(kotlin.Int)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `event` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The event. Valid values are:[Connection.VideoProvider.SESSION_EVENT_RX_PAUSE](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_PAUSE:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_RX_RESUME](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_RESUME:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_TX_START](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_START:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_TX_STOP](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_STOP:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_CAMERA_READY](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_READY:kotlin.Int),[Connection.VideoProvider.SESSION_EVENT_CAMERA_PERMISSION_ERROR](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_PERMISSION_ERROR:kotlin.Int). |

### onCameraCapabilitiesChanged

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

```
abstract fun onCameraCapabilitiesChanged(cameraCapabilities: VideoProfile.CameraCapabilities!): Unit
```

Handles a change in the capabilities of the currently selected camera.

Used by the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)in response to[VideoCall.requestCameraCapabilities()](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall#requestCameraCapabilities()). The[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)may also report the camera capabilities after a call to[VideoCall.setCamera(String)](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall#setCamera(kotlin.String)).

Callback originates from[Connection.VideoProvider.changeCameraCapabilities(](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities)).

|                                                                                        Parameters                                                                                         ||
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cameraCapabilities` | [VideoProfile.CameraCapabilities](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile.CameraCapabilities)!:The changed camera capabilities. |

### onPeerDimensionsChanged

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

```
abstract fun onPeerDimensionsChanged(
    width: Int, 
    height: Int
): Unit
```

Handles a change to the video dimensions from the peer device. This could happen if, for example, the peer changes orientation of their device, or switches cameras.

Callback originates from[Connection.VideoProvider.changePeerDimensions(int, int)](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#changePeerDimensions(kotlin.Int,%20kotlin.Int)).

|                                                     Parameters                                                      ||
|----------|-----------------------------------------------------------------------------------------------------------|
| `width`  | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The updated peer video width.  |
| `height` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The updated peer video height. |

### onSessionModifyRequestReceived

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

```
abstract fun onSessionModifyRequestReceived(videoProfile: VideoProfile!): Unit
```

Called when the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)receives a session modification request from the peer device.

The[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)may potentially prompt the user to confirm whether they wish to accept the request, or decide to automatically accept the request. In either case the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)should call[VideoCall.sendSessionModifyResponse(VideoProfile)](https://developer.android.com/reference/kotlin/android/telecom/InCallService.VideoCall#sendSessionModifyResponse(android.telecom.VideoProfile))to indicate the video profile agreed upon.

Callback originates from[Connection.VideoProvider.receiveSessionModifyRequest(VideoProfile)](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#receiveSessionModifyRequest(android.telecom.VideoProfile)).

|                                                                Parameters                                                                 ||
|----------------|---------------------------------------------------------------------------------------------------------------------------|
| `videoProfile` | [VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!:The requested video profile. |

### onSessionModifyResponseReceived

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

```
abstract fun onSessionModifyResponseReceived(
    status: Int, 
    requestedProfile: VideoProfile!, 
    responseProfile: VideoProfile!
): Unit
```

Called when the[Connection.VideoProvider](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider)receives a response to a session modification request previously sent to the peer device.

The new video state should not be considered active by the[InCallService](https://developer.android.com/reference/kotlin/android/telecom/InCallService)until the[Call](https://developer.android.com/reference/kotlin/android/telecom/Call)video state changes (the[Call.Callback.onDetailsChanged(Call, Call.Details)](https://developer.android.com/reference/kotlin/android/telecom/Call.Callback#onDetailsChanged(android.telecom.Call,%20android.telecom.Call.Details))callback is triggered when the video state changes).

Callback originates from[Connection.VideoProvider.receiveSessionModifyResponse(int, VideoProfile,](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(kotlin.Int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile)).

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `status`           | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Status of the session modify request. Valid values are[Connection.VideoProvider.SESSION_MODIFY_REQUEST_SUCCESS](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS:kotlin.Int),[Connection.VideoProvider.SESSION_MODIFY_REQUEST_FAIL](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_FAIL:kotlin.Int),[Connection.VideoProvider.SESSION_MODIFY_REQUEST_INVALID](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_INVALID:kotlin.Int),[Connection.VideoProvider.SESSION_MODIFY_REQUEST_TIMED_OUT](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_TIMED_OUT:kotlin.Int),[Connection.VideoProvider.SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE:kotlin.Int). |
| `requestedProfile` | [VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!:The original request which was sent to the peer device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `responseProfile`  | [VideoProfile](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile)!:The actual profile changes made by the peer device.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

### onVideoQualityChanged

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

```
abstract fun onVideoQualityChanged(videoQuality: Int): Unit
```

Handles a change to the video quality.

Callback originates from[Connection.VideoProvider.changeVideoQuality(int)](https://developer.android.com/reference/kotlin/android/telecom/Connection.VideoProvider#changeVideoQuality(kotlin.Int)).

|                                                                                                                                                                                                                                                                                                                                      Parameters                                                                                                                                                                                                                                                                                                                                      ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `videoQuality` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The updated peer video quality. Valid values:[VideoProfile.QUALITY_HIGH](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile#QUALITY_HIGH:kotlin.Int),[VideoProfile.QUALITY_MEDIUM](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile#QUALITY_MEDIUM:kotlin.Int),[VideoProfile.QUALITY_LOW](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile#QUALITY_LOW:kotlin.Int),[VideoProfile.QUALITY_DEFAULT](https://developer.android.com/reference/kotlin/android/telecom/VideoProfile#QUALITY_DEFAULT:kotlin.Int). |