CallsManagerExtensions


interface CallsManagerExtensions

Known direct subclasses
CallsManager

CallsManager allows VoIP applications to add their calls to the Android system service Telecom.


Provide the ability for CallsManager to support extensions on a call.

Extensions allow an application to support optional features beyond the scope of call state management and audio routing. These optional features provide the application with the ability to describe additional information about the call, which allows remote surfaces (automotive, watches, etc..) to provide UX related to this additional information. Additionally, remote surfaces can perform actions using a configured extension to notify this application of a remote user request.

Summary

Public functions

suspend Unit
@RequiresApi(value = 26)
@ExperimentalAppActions
addCallWithExtensions(
    callAttributes: CallAttributesCompat,
    onAnswer: suspend (callType: Int) -> Unit,
    onDisconnect: suspend (disconnectCause: DisconnectCause) -> Unit,
    onSetActive: suspend () -> Unit,
    onSetInactive: suspend () -> Unit,
    init: suspend ExtensionInitializationScope.() -> Unit
)

Adds a call with extensions support using ExtensionInitializationScope, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons.

Public functions

addCallWithExtensions

Added in 1.0.0-beta01
@RequiresApi(value = 26)
@ExperimentalAppActions
suspend fun addCallWithExtensions(
    callAttributes: CallAttributesCompat,
    onAnswer: suspend (callType: Int) -> Unit,
    onDisconnect: suspend (disconnectCause: DisconnectCause) -> Unit,
    onSetActive: suspend () -> Unit,
    onSetInactive: suspend () -> Unit,
    init: suspend ExtensionInitializationScope.() -> Unit
): Unit

Adds a call with extensions support using ExtensionInitializationScope, which allows an app to implement optional additional actions that go beyond the scope of a call, such as information about meeting participants and icons.

Parameters
callAttributes: CallAttributesCompat

attributes of the new call (incoming or outgoing, address, etc. )

onAnswer: suspend (callType: Int) -> Unit

where callType is the audio/video state the call should be answered as. Telecom is informing your VoIP application to answer an incoming call and set it to active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable).

onDisconnect: suspend (disconnectCause: DisconnectCause) -> Unit

where disconnectCause represents the cause for disconnecting the call. Telecom is informing your VoIP application to disconnect the incoming call. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable).

onSetActive: suspend () -> Unit

Telecom is informing your VoIP application to set the call active. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g. Wearable).

onSetInactive: suspend () -> Unit

Telecom is informing your VoIP application to set the call inactive. This is the same as holding a call for two endpoints but can be extended to setting a meeting inactive. Telecom is requesting this on behalf of an system service (e.g. Automotive service) or a device (e.g.Wearable). Note: Your app must stop using the microphone and playing incoming media when returning.

init: suspend ExtensionInitializationScope.() -> Unit

The scope used to first initialize Extensions that will be used when the call is first notified to the platform and UX surfaces. Once the call is set up, the user's implementation of ExtensionInitializationScope.onCall will be called.

See also
addCall