CallsManagerExtensions


public 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 methods

abstract void
@RequiresApi(value = 26)
@ExperimentalAppActions
addCallWithExtensions(
    @NonNull CallAttributesCompat callAttributes,
    @NonNull SuspendFunction1<@NonNull IntegerUnit> onAnswer,
    @NonNull SuspendFunction1<@NonNull DisconnectCauseUnit> onDisconnect,
    @NonNull SuspendFunction0<Unit> onSetActive,
    @NonNull SuspendFunction0<Unit> onSetInactive,
    @ExtensionFunctionType @NonNull SuspendFunction1<@NonNull ExtensionInitializationScopeUnit> init
)

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 methods

addCallWithExtensions

Added in 1.0.0-beta01
@RequiresApi(value = 26)
@ExperimentalAppActions
abstract void addCallWithExtensions(
    @NonNull CallAttributesCompat callAttributes,
    @NonNull SuspendFunction1<@NonNull IntegerUnit> onAnswer,
    @NonNull SuspendFunction1<@NonNull DisconnectCauseUnit> onDisconnect,
    @NonNull SuspendFunction0<Unit> onSetActive,
    @NonNull SuspendFunction0<Unit> onSetInactive,
    @ExtensionFunctionType @NonNull SuspendFunction1<@NonNull ExtensionInitializationScopeUnit> init
)

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
@NonNull CallAttributesCompat callAttributes

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

@NonNull SuspendFunction1<@NonNull IntegerUnit> onAnswer

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).

@NonNull SuspendFunction1<@NonNull DisconnectCauseUnit> onDisconnect

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).

@NonNull SuspendFunction0<Unit> onSetActive

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).

@NonNull SuspendFunction0<Unit> onSetInactive

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.

@ExtensionFunctionType @NonNull SuspendFunction1<@NonNull ExtensionInitializationScopeUnit> init

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