# Connection.VideoProvider

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#constants)\|[Ctors](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#pubctors)\|[Methods](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#inhmethods)  

# Connection.VideoProvider

*** ** * ** ***

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

`
public
static

abstract
class
Connection.VideoProvider
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telecom.Connection.VideoProvider |

<br />

*** ** * ** ***

Provides a means of controlling the video session associated with a[Connection](https://developer.android.com/reference/android/telecom/Connection).

Implementations create a custom subclass of[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)and the[ConnectionService](https://developer.android.com/reference/android/telecom/ConnectionService)creates an instance sets it on the[Connection](https://developer.android.com/reference/android/telecom/Connection)using[Connection.setVideoProvider(VideoProvider)](https://developer.android.com/reference/android/telecom/Connection#setVideoProvider(android.telecom.Connection.VideoProvider)). Any connection which supports video should set the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider).

The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)serves two primary purposes: it provides a means for Telecom and[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations to issue requests related to the video session; it provides a means for the[ConnectionService](https://developer.android.com/reference/android/telecom/ConnectionService)to report events and information related to the video session to Telecom and the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations.

[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations interact with the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)via[InCallService.VideoCall](https://developer.android.com/reference/android/telecom/InCallService.VideoCall).

## Summary

|                                                                                                                                                                                                                                                               ### Constants                                                                                                                                                                                                                                                                ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE) A camera failure has occurred for the selected camera.                                                                                                                                                                                                                                                                                                                                |
| `int` | [SESSION_EVENT_CAMERA_PERMISSION_ERROR](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_PERMISSION_ERROR) Session event raised by Telecom when[InCallService.VideoCall.setCamera(String)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setCamera(java.lang.String))is called and the caller does not have the necessary[Manifest.permission.CAMERA](https://developer.android.com/reference/android/Manifest.permission#CAMERA)permission. |
| `int` | [SESSION_EVENT_CAMERA_READY](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_READY) Issued after[SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE)when the camera is once again ready for operation.                                                                                                                                                                               |
| `int` | [SESSION_EVENT_RX_PAUSE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_PAUSE) Video is not being received (no protocol pause was issued).                                                                                                                                                                                                                                                                                                                                       |
| `int` | [SESSION_EVENT_RX_RESUME](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_RESUME) Video reception has resumed after a[SESSION_EVENT_RX_PAUSE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_PAUSE).                                                                                                                                                                                                                           |
| `int` | [SESSION_EVENT_TX_START](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_START) Video transmission has begun.                                                                                                                                                                                                                                                                                                                                                                     |
| `int` | [SESSION_EVENT_TX_STOP](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_STOP) Video transmission has stopped.                                                                                                                                                                                                                                                                                                                                                                     |
| `int` | [SESSION_MODIFY_REQUEST_FAIL](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_FAIL) Session modify request failed.                                                                                                                                                                                                                                                                                                                                                          |
| `int` | [SESSION_MODIFY_REQUEST_INVALID](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_INVALID) Session modify request ignored due to invalid parameters.                                                                                                                                                                                                                                                                                                                         |
| `int` | [SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE) Session modify request rejected by remote user.                                                                                                                                                                                                                                                                                                             |
| `int` | [SESSION_MODIFY_REQUEST_SUCCESS](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS) Session modify request was successful.                                                                                                                                                                                                                                                                                                                                            |
| `int` | [SESSION_MODIFY_REQUEST_TIMED_OUT](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_TIMED_OUT) Session modify request timed out.                                                                                                                                                                                                                                                                                                                                             |

|                                                   ### Public constructors                                                    ||
|---------------------------------------------------------------------------------------------------------------------------|---|
| ` `[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#VideoProvider())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                          ### Public methods                                                                                                                                                                                                                                                                                                                                                                           ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void`          | ` `[changeCameraCapabilities](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities))`(`[VideoProfile.CameraCapabilities](https://developer.android.com/reference/android/telecom/VideoProfile.CameraCapabilities)` cameraCapabilities) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the capabilities of the current camera have changed.                                                                                                                                                                                                               |
| ` void`          | ` `[changePeerDimensions](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#changePeerDimensions(int,%20int))`(int width, int height) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the dimensions of the peer's video have changed.                                                                                                                                                                                                                                                                                                                                                                                          |
| ` void`          | ` `[changeVideoQuality](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#changeVideoQuality(int))`(int videoQuality) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the video quality of the call has changed.                                                                                                                                                                                                                                                                                                                                                                                                                |
| ` void`          | ` `[handleCallSessionEvent](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))`(int event) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)reports a call session event.                                                                                                                                                                                                                                                                                                                        |
| ` abstract void` | ` `[onRequestCameraCapabilities](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onRequestCameraCapabilities())`() ` Issues a request to the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)to retrieve the camera capabilities.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` abstract void` | ` `[onRequestConnectionDataUsage](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onRequestConnectionDataUsage())`() ` Issues a request to the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)to retrieve the current data usage for the video component of the current[Connection](https://developer.android.com/reference/android/telecom/Connection).                                                                                                                                                                                                                                                                                                          |
| ` abstract void` | ` `[onSendSessionModifyRequest](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSendSessionModifyRequest(android.telecom.VideoProfile,%20android.telecom.VideoProfile))`(`[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` fromProfile, `[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` toProfile) ` Issues a request to modify the properties of the current video session.                                                                                                                                                                                                                                                         |
| ` abstract void` | ` `[onSendSessionModifyResponse](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSendSessionModifyResponse(android.telecom.VideoProfile))`(`[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` responseProfile) ` Provides a response to a request to change the current video session properties.                                                                                                                                                                                                                                                                                                                                                                            |
| ` abstract void` | ` `[onSetCamera](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetCamera(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` cameraId) ` Sets the camera to be used for the outgoing video.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` abstract void` | ` `[onSetDeviceOrientation](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetDeviceOrientation(int))`(int rotation) ` Sets the device orientation, in degrees.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ` abstract void` | ` `[onSetDisplaySurface](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetDisplaySurface(android.view.Surface))`(`[Surface](https://developer.android.com/reference/android/view/Surface)` surface) ` Sets the surface to be used for displaying the video received from the remote device.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ` abstract void` | ` `[onSetPauseImage](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetPauseImage(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` uri) ` Provides the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)with the[Uri](https://developer.android.com/reference/android/net/Uri)of an image to be displayed to the peer device when the video signal is paused.                                                                                                                                                                                                                                                                 |
| ` abstract void` | ` `[onSetPreviewSurface](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetPreviewSurface(android.view.Surface))`(`[Surface](https://developer.android.com/reference/android/view/Surface)` surface) ` Sets the surface to be used for displaying a preview of what the user's camera is currently capturing.                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` abstract void` | ` `[onSetZoom](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetZoom(float))`(float value) ` Sets the camera zoom ratio.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` void`          | ` `[receiveSessionModifyRequest](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyRequest(android.telecom.VideoProfile))`(`[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` videoProfile) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)receives a session modification request.                                                                                                                                                                                |
| ` void`          | ` `[receiveSessionModifyResponse](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))`(int status, `[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` requestedProfile, `[VideoProfile](https://developer.android.com/reference/android/telecom/VideoProfile)` responseProfile) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)receives a response to a session modification request. |
| ` void`          | ` `[setCallDataUsage](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#setCallDataUsage(long))`(long dataUsage) ` Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the data usage of the video associated with the current[Connection](https://developer.android.com/reference/android/telecom/Connection)has changed.                                                                                                                                                                                                                                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### SESSION_EVENT_CAMERA_FAILURE

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

```
public static final int SESSION_EVENT_CAMERA_FAILURE
```

A camera failure has occurred for the selected camera. The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)can use this as a cue to inform the user the camera is not available.

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 5 (0x00000005)  

### SESSION_EVENT_CAMERA_PERMISSION_ERROR

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

```
public static final int SESSION_EVENT_CAMERA_PERMISSION_ERROR
```

Session event raised by Telecom when[InCallService.VideoCall.setCamera(String)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setCamera(java.lang.String))is called and the caller does not have the necessary[Manifest.permission.CAMERA](https://developer.android.com/reference/android/Manifest.permission#CAMERA)permission.

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 7 (0x00000007)  

### SESSION_EVENT_CAMERA_READY

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

```
public static final int SESSION_EVENT_CAMERA_READY
```

Issued after[SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE)when the camera is once again ready for operation. The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)can use this as a cue to inform the user that the camera has become available again.

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 6 (0x00000006)  

### SESSION_EVENT_RX_PAUSE

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

```
public static final int SESSION_EVENT_RX_PAUSE
```

Video is not being received (no protocol pause was issued).

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 1 (0x00000001)  

### SESSION_EVENT_RX_RESUME

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

```
public static final int SESSION_EVENT_RX_RESUME
```

Video reception has resumed after a[SESSION_EVENT_RX_PAUSE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_PAUSE).

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 2 (0x00000002)  

### SESSION_EVENT_TX_START

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

```
public static final int SESSION_EVENT_TX_START
```

Video transmission has begun. This occurs after a negotiated start of video transmission when the underlying protocol has actually begun transmitting video to the remote party.

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 3 (0x00000003)  

### SESSION_EVENT_TX_STOP

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

```
public static final int SESSION_EVENT_TX_STOP
```

Video transmission has stopped. This occurs after a negotiated stop of video transmission when the underlying protocol has actually stopped transmitting video to the remote party.

<br />

**See also:**

- [handleCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#handleCallSessionEvent(int))

Constant Value: 4 (0x00000004)  

### SESSION_MODIFY_REQUEST_FAIL

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

```
public static final int SESSION_MODIFY_REQUEST_FAIL
```

Session modify request failed.

<br />

**See also:**

- [receiveSessionModifyResponse(int, VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))

Constant Value: 2 (0x00000002)  

### SESSION_MODIFY_REQUEST_INVALID

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

```
public static final int SESSION_MODIFY_REQUEST_INVALID
```

Session modify request ignored due to invalid parameters.

<br />

**See also:**

- [receiveSessionModifyResponse(int, VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))

Constant Value: 3 (0x00000003)  

### SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE

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

```
public static final int SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE
```

Session modify request rejected by remote user.

<br />

**See also:**

- [receiveSessionModifyResponse(int, VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))

Constant Value: 5 (0x00000005)  

### SESSION_MODIFY_REQUEST_SUCCESS

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

```
public static final int SESSION_MODIFY_REQUEST_SUCCESS
```

Session modify request was successful.

<br />

**See also:**

- [receiveSessionModifyResponse(int, VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))

Constant Value: 1 (0x00000001)  

### SESSION_MODIFY_REQUEST_TIMED_OUT

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

```
public static final int SESSION_MODIFY_REQUEST_TIMED_OUT
```

Session modify request timed out.

<br />

**See also:**

- [receiveSessionModifyResponse(int, VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))

Constant Value: 4 (0x00000004)

## Public constructors

### VideoProvider

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

```
public VideoProvider ()
```

<br />

<br />

## Public methods

### changeCameraCapabilities

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

```
public void changeCameraCapabilities (VideoProfile.CameraCapabilities cameraCapabilities)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the capabilities of the current camera have changed.

The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)should call this in response to[VideoProvider.onRequestCameraCapabilities()](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onRequestCameraCapabilities()), or when the current camera is changed via[VideoProvider.onSetCamera(String)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSetCamera(java.lang.String)).

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onCameraCapabilitiesChanged(
VideoProfile.CameraCapabilities)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onCameraCapabilitiesChanged(android.telecom.VideoProfile.CameraCapabilities)).

<br />

|                                          Parameters                                          ||
|----------------------|------------------------------------------------------------------------|
| `cameraCapabilities` | `VideoProfile.CameraCapabilities`: The new camera capabilities. <br /> |

### changePeerDimensions

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

```
public void changePeerDimensions (int width, 
                int height)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the dimensions of the peer's video have changed.

This could occur if, for example, the peer rotates their device, changing the aspect ratio of the video, or if the user switches between the back and front cameras.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onPeerDimensionsChanged(int, int)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onPeerDimensionsChanged(int,%20int)).

<br />

|                       Parameters                       ||
|----------|----------------------------------------------|
| `width`  | `int`: The updated peer video width. <br />  |
| `height` | `int`: The updated peer video height. <br /> |

### changeVideoQuality

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

```
public void changeVideoQuality (int videoQuality)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the video quality of the call has changed.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onVideoQualityChanged(int)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onVideoQualityChanged(int)).

<br />

|                                                                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                                                                 ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `videoQuality` | `int`: The updated video quality. Valid values:[VideoProfile.QUALITY_HIGH](https://developer.android.com/reference/android/telecom/VideoProfile#QUALITY_HIGH),[VideoProfile.QUALITY_MEDIUM](https://developer.android.com/reference/android/telecom/VideoProfile#QUALITY_MEDIUM),[VideoProfile.QUALITY_LOW](https://developer.android.com/reference/android/telecom/VideoProfile#QUALITY_LOW),[VideoProfile.QUALITY_DEFAULT](https://developer.android.com/reference/android/telecom/VideoProfile#QUALITY_DEFAULT). <br /> |

### handleCallSessionEvent

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

```
public void handleCallSessionEvent (int event)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)reports a call session event.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onCallSessionEvent(int)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onCallSessionEvent(int)).

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `event` | `int`: The event. Valid values are:[VideoProvider.SESSION_EVENT_RX_PAUSE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_PAUSE),[VideoProvider.SESSION_EVENT_RX_RESUME](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_RX_RESUME),[VideoProvider.SESSION_EVENT_TX_START](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_START),[VideoProvider.SESSION_EVENT_TX_STOP](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_TX_STOP),[VideoProvider.SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE),[VideoProvider.SESSION_EVENT_CAMERA_READY](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_READY),[VideoProvider.SESSION_EVENT_CAMERA_FAILURE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE). <br /> |

### onRequestCameraCapabilities

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

```
public abstract void onRequestCameraCapabilities ()
```

Issues a request to the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)to retrieve the camera capabilities.

The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)should respond by communicating the capabilities of the chosen camera via[VideoProvider.changeCameraCapabilities(VideoProfile.CameraCapabilities)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities)).

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.requestCameraCapabilities()](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#requestCameraCapabilities()).

<br />

### onRequestConnectionDataUsage

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

```
public abstract void onRequestConnectionDataUsage ()
```

Issues a request to the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)to retrieve the current data usage for the video component of the current[Connection](https://developer.android.com/reference/android/telecom/Connection).

The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)should respond by communicating current data usage, in bytes, via[VideoProvider.setCallDataUsage(long)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#setCallDataUsage(long)).

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.requestCallDataUsage()](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#requestCallDataUsage()).

<br />

### onSendSessionModifyRequest

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

```
public abstract void onSendSessionModifyRequest (VideoProfile fromProfile, 
                VideoProfile toProfile)
```

Issues a request to modify the properties of the current video session.

Example scenarios include: requesting an audio-only call to be upgraded to a bi-directional video call, turning on or off the user's camera, sending a pause signal when the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)is no longer the foreground application.

If the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)determines a request to be invalid, it should call[receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))to report the invalid request back to the[InCallService](https://developer.android.com/reference/android/telecom/InCallService).

Where a request requires confirmation from the user of the peer device, the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)must communicate the request to the peer device and handle the user's response.[receiveSessionModifyResponse(int, android.telecom.VideoProfile, android.telecom.VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#receiveSessionModifyResponse(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile))is used to inform the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)of the result of the request.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.sendSessionModifyRequest(VideoProfile)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#sendSessionModifyRequest(android.telecom.VideoProfile)).

<br />

|                                        Parameters                                        ||
|---------------|---------------------------------------------------------------------------|
| `fromProfile` | `VideoProfile`: The video profile prior to the request. <br />            |
| `toProfile`   | `VideoProfile`: The video profile with the requested changes made. <br /> |

### onSendSessionModifyResponse

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

```
public abstract void onSendSessionModifyResponse (VideoProfile responseProfile)
```

Provides a response to a request to change the current video session properties.

For example, if the peer requests and upgrade from an audio-only call to a bi-directional video call, could decline the request and keep the call as audio-only. In such a scenario, the`responseProfile`would have a video state of[VideoProfile.STATE_AUDIO_ONLY](https://developer.android.com/reference/android/telecom/VideoProfile#STATE_AUDIO_ONLY). If the user had decided to accept the request, the video state would be[VideoProfile.STATE_BIDIRECTIONAL](https://developer.android.com/reference/android/telecom/VideoProfile#STATE_BIDIRECTIONAL).

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.sendSessionModifyResponse(VideoProfile)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#sendSessionModifyResponse(android.telecom.VideoProfile))in response to a[InCallService.VideoCall.Callback.onSessionModifyRequestReceived(VideoProfile)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onSessionModifyRequestReceived(android.telecom.VideoProfile))callback.

<br />

|                              Parameters                               ||
|-------------------|----------------------------------------------------|
| `responseProfile` | `VideoProfile`: The response video profile. <br /> |

### onSetCamera

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

```
public abstract void onSetCamera (String cameraId)
```

Sets the camera to be used for the outgoing video.

The[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)should respond by communicating the capabilities of the chosen camera via[VideoProvider.changeCameraCapabilities(VideoProfile.CameraCapabilities)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#changeCameraCapabilities(android.telecom.VideoProfile.CameraCapabilities)).

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setCamera(String)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setCamera(java.lang.String)).

<br />

|                                                                                                   Parameters                                                                                                   ||
|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cameraId` | `String`: The id of the camera (use ids as reported by[CameraManager.getCameraIdList()](https://developer.android.com/reference/android/hardware/camera2/CameraManager#getCameraIdList())). <br /> |

### onSetDeviceOrientation

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

```
public abstract void onSetDeviceOrientation (int rotation)
```

Sets the device orientation, in degrees. Assumes that a standard portrait orientation of the device is 0 degrees.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setDeviceOrientation(int)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setDeviceOrientation(int)).

<br />

|                          Parameters                           ||
|------------|---------------------------------------------------|
| `rotation` | `int`: The device orientation, in degrees. <br /> |

### onSetDisplaySurface

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

```
public abstract void onSetDisplaySurface (Surface surface)
```

Sets the surface to be used for displaying the video received from the remote device.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setDisplaySurface(Surface)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setDisplaySurface(android.view.Surface)).

<br />

|                                                Parameters                                                ||
|-----------|-----------------------------------------------------------------------------------------------|
| `surface` | `Surface`: The[Surface](https://developer.android.com/reference/android/view/Surface). <br /> |

### onSetPauseImage

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

```
public abstract void onSetPauseImage (Uri uri)
```

Provides the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)with the[Uri](https://developer.android.com/reference/android/net/Uri)of an image to be displayed to the peer device when the video signal is paused.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setPauseImage(Uri)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setPauseImage(android.net.Uri)).

<br />

|                  Parameters                   ||
|-------|----------------------------------------|
| `uri` | `Uri`: URI of image to display. <br /> |

### onSetPreviewSurface

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

```
public abstract void onSetPreviewSurface (Surface surface)
```

Sets the surface to be used for displaying a preview of what the user's camera is currently capturing. When video transmission is enabled, this is the video signal which is sent to the remote device.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setPreviewSurface(Surface)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setPreviewSurface(android.view.Surface)).

<br />

|                                                Parameters                                                ||
|-----------|-----------------------------------------------------------------------------------------------|
| `surface` | `Surface`: The[Surface](https://developer.android.com/reference/android/view/Surface). <br /> |

### onSetZoom

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

```
public abstract void onSetZoom (float value)
```

Sets the camera zoom ratio.

Sent from the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.setZoom(float)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall#setZoom(float)).

<br />

|                                                                                                                                     Parameters                                                                                                                                      ||
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `value` | `float`: The camera zoom ratio; for the current camera, should be a value in the range defined by[CameraCharacteristics.CONTROL_ZOOM_RATIO_RANGE](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#CONTROL_ZOOM_RATIO_RANGE). <br /> |

### receiveSessionModifyRequest

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

```
public void receiveSessionModifyRequest (VideoProfile videoProfile)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)receives a session modification request.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onSessionModifyRequestReceived(VideoProfile)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onSessionModifyRequestReceived(android.telecom.VideoProfile)),

<br />

|                             Parameters                              ||
|----------------|-----------------------------------------------------|
| `videoProfile` | `VideoProfile`: The requested video profile. <br /> |

**See also:**

- [onSendSessionModifyRequest(VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSendSessionModifyRequest(android.telecom.VideoProfile,%20android.telecom.VideoProfile))  

### receiveSessionModifyResponse

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

```
public void receiveSessionModifyResponse (int status, 
                VideoProfile requestedProfile, 
                VideoProfile responseProfile)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider)receives a response to a session modification request.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onSessionModifyResponseReceived(int,
VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onSessionModifyResponseReceived(int,%20android.telecom.VideoProfile,%20android.telecom.VideoProfile)).

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `status`           | `int`: Status of the session modify request. Valid values are[VideoProvider.SESSION_MODIFY_REQUEST_SUCCESS](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS),[VideoProvider.SESSION_MODIFY_REQUEST_FAIL](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_FAIL),[VideoProvider.SESSION_MODIFY_REQUEST_INVALID](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_INVALID),[VideoProvider.SESSION_MODIFY_REQUEST_TIMED_OUT](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_TIMED_OUT),[VideoProvider.SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE) <br /> |
| `requestedProfile` | `VideoProfile`: The original request which was sent to the peer device. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `responseProfile`  | `VideoProfile`: The actual profile changes agreed to by the peer device. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

**See also:**

- [onSendSessionModifyRequest(VideoProfile, VideoProfile)](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onSendSessionModifyRequest(android.telecom.VideoProfile,%20android.telecom.VideoProfile))  

### setCallDataUsage

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

```
public void setCallDataUsage (long dataUsage)
```

Used to inform listening[InCallService](https://developer.android.com/reference/android/telecom/InCallService)implementations when the data usage of the video associated with the current[Connection](https://developer.android.com/reference/android/telecom/Connection)has changed.

This could be in response to a preview request via[onRequestConnectionDataUsage()](https://developer.android.com/reference/android/telecom/Connection.VideoProvider#onRequestConnectionDataUsage()), or as a periodic update by the[VideoProvider](https://developer.android.com/reference/android/telecom/Connection.VideoProvider). Where periodic updates of data usage are provided, they should be provided at most for every 1 MB of data transferred and no more than once every 10 sec.

Received by the[InCallService](https://developer.android.com/reference/android/telecom/InCallService)via[InCallService.VideoCall.Callback.onCallDataUsageChanged(long)](https://developer.android.com/reference/android/telecom/InCallService.VideoCall.Callback#onCallDataUsageChanged(long)).

<br />

|                                                            Parameters                                                             ||
|-------------|----------------------------------------------------------------------------------------------------------------------|
| `dataUsage` | `long`: The updated data usage (in bytes). Reported as the cumulative bytes used since the start of the call. <br /> |