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 | |
---|---|
Callback() |
Public methods | |
---|---|
abstract Unit |
onCallDataUsageChanged(dataUsage: Long) Handles an update to the total data used for the current video session. |
abstract Unit |
onCallSessionEvent(event: Int) Handles events related to the current video session which the |
abstract Unit |
onCameraCapabilitiesChanged(cameraCapabilities: VideoProfile.CameraCapabilities!) 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 |
onSessionModifyRequestReceived(videoProfile: VideoProfile!) Called when the |
abstract Unit |
onSessionModifyResponseReceived(status: Int, requestedProfile: VideoProfile!, responseProfile: VideoProfile!) Called when the |
abstract Unit |
onVideoQualityChanged(videoQuality: Int) Handles a change to the video quality. |
Public constructors
Callback
Callback()
Public methods
onCallDataUsageChanged
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
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)
.
onCameraCapabilitiesChanged
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
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
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
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
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 . |