Added in API level 23

Callback


abstract class Callback
kotlin.Any
   ↳ android.telecom.InCallService.VideoCall.Callback

The InCallService extends this class to provide a means of receiving callbacks from the Connection.VideoProvider.

When the InCallService receives the Call.Callback#onVideoCallChanged(Call, VideoCall) callback, it should create an instance its VideoCall.Callback implementation and set it on the VideoCall using VideoCall#registerCallback(Callback).

Summary

Public constructors

Public methods
abstract Unit

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

abstract Unit

Handles events related to the current video session which the InCallService may wish to handle.

abstract Unit

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

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

Handles a change to the video dimensions from the peer device.

abstract Unit

Called when the Connection.VideoProvider receives a session modification request from the peer device.

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

Called when the Connection.VideoProvider receives a response to a session modification request previously sent to the peer device.

abstract Unit
onVideoQualityChanged(videoQuality: Int)

Handles a change to the video quality.

Public constructors

Callback

Callback()

Public methods

onCallDataUsageChanged

Added in API level 23
abstract fun onCallDataUsageChanged(dataUsage: Long): Unit

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

Used by the Connection.VideoProvider in response to VideoCall#requestCallDataUsage(). May also be called periodically by the Connection.VideoProvider.

Callback originates from Connection.VideoProvider#setCallDataUsage(long).

Parameters
dataUsage Long: The updated data usage (in bytes).

onCallSessionEvent

Added in API level 23
abstract fun onCallSessionEvent(event: Int): Unit

Handles events related to the current video session which the 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).

Parameters
event Int: The event. Valid values are: Connection.VideoProvider#SESSION_EVENT_RX_PAUSE, Connection.VideoProvider#SESSION_EVENT_RX_RESUME, Connection.VideoProvider#SESSION_EVENT_TX_START, Connection.VideoProvider#SESSION_EVENT_TX_STOP, Connection.VideoProvider#SESSION_EVENT_CAMERA_FAILURE, Connection.VideoProvider#SESSION_EVENT_CAMERA_READY, Connection.VideoProvider#SESSION_EVENT_CAMERA_PERMISSION_ERROR.

onCameraCapabilitiesChanged

Added in API level 23
abstract fun onCameraCapabilitiesChanged(cameraCapabilities: VideoProfile.CameraCapabilities!): Unit

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

Used by the Connection.VideoProvider in response to VideoCall#requestCameraCapabilities(). The Connection.VideoProvider may also report the camera capabilities after a call to VideoCall#setCamera(String).

Callback originates from Connection.VideoProvider#changeCameraCapabilities(.

Parameters
cameraCapabilities VideoProfile.CameraCapabilities!: The changed camera capabilities.

onPeerDimensionsChanged

Added in API level 23
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).

Parameters
width Int: The updated peer video width.
height Int: The updated peer video height.

onSessionModifyRequestReceived

Added in API level 23
abstract fun onSessionModifyRequestReceived(videoProfile: VideoProfile!): Unit

Called when the Connection.VideoProvider receives a session modification request from the peer device.

The 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 should call VideoCall#sendSessionModifyResponse(VideoProfile) to indicate the video profile agreed upon.

Callback originates from Connection.VideoProvider#receiveSessionModifyRequest(VideoProfile).

Parameters
videoProfile VideoProfile!: The requested video profile.

onSessionModifyResponseReceived

Added in API level 23
abstract fun onSessionModifyResponseReceived(
    status: Int,
    requestedProfile: VideoProfile!,
    responseProfile: VideoProfile!
): Unit

Called when the 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 until the Call video state changes (the Call.Callback#onDetailsChanged(Call, Call.Details) callback is triggered when the video state changes).

Callback originates from Connection.VideoProvider#receiveSessionModifyResponse(int, VideoProfile,.

Parameters
status Int: Status of the session modify request. Valid values are Connection.VideoProvider#SESSION_MODIFY_REQUEST_SUCCESS, Connection.VideoProvider#SESSION_MODIFY_REQUEST_FAIL, Connection.VideoProvider#SESSION_MODIFY_REQUEST_INVALID, Connection.VideoProvider#SESSION_MODIFY_REQUEST_TIMED_OUT, Connection.VideoProvider#SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE.
requestedProfile VideoProfile!: The original request which was sent to the peer device.
responseProfile VideoProfile!: The actual profile changes made by the peer device.

onVideoQualityChanged

Added in API level 23
abstract fun onVideoQualityChanged(videoQuality: Int): Unit

Handles a change to the video quality.

Callback originates from Connection.VideoProvider#changeVideoQuality(int).

Parameters
videoQuality Int: The updated peer video quality. Valid values: VideoProfile#QUALITY_HIGH, VideoProfile#QUALITY_MEDIUM, VideoProfile#QUALITY_LOW, VideoProfile#QUALITY_DEFAULT.