public final class CallConfiguration

  1. Object
  2. CallConfiguration

The calling identity this app presents to the operating system: the name shown above a call, the icon beside it, the ringtone, and what kinds of address the app understands.

Hand one to Calls.configure before reporting anything. On Android this registers the PhoneAccount, and until it has been registered TelecomManager silently ignores every incoming call the app reports – no error, no call, nothing in the log. That silence is why configuring is a separate step rather than something inferred from the first call.

What cannot be set here

On iOS the provider’s name, icon and ringtone are also needed before any of this app’s code runs, because a call arriving as a VoIP push is reported to the system by native code during launch. Those come from build hints baked into the app – ios.call.providerName, ios.call.icon, ios.call.ringtone – and what is set here refines them once the app is up. Setting only this and expecting a pushed call to ring with the right name is the mistake the guide warns about.

Constructors

public CallConfiguration()Creates a configuration with the defaults: audio only, calls in the system call log, no conferencing, phone-number and generic handles.

Methods

public CallConfiguration displayName(String name)The name shown above a call.
public CallConfiguration videoSupported(boolean value)Whether the app offers video calls.
public CallConfiguration includesCallsInRecents(boolean value)Whether calls appear in the system call log.
public CallConfiguration maximumCallGroups(int value)How many separate conferences may exist at once.
public CallConfiguration maximumCallsPerGroup(int value)How many calls may be in one conference.
public CallConfiguration handleTypes(CallHandleType[] types)Replaces the set of address kinds the app understands.
public String getDisplayName()The display name, or null for the application’s own.
public boolean isVideoSupported()Whether video is offered.
public boolean isIncludesCallsInRecents()Whether calls appear in the system call log.
public int getMaximumCallGroups()How many conferences may exist at once.
public int getMaximumCallsPerGroup()How many calls may be in one conference.
public CallHandleType[] getHandleTypes()The address kinds the app understands.

Inherited methods

Constructor details

CallConfiguration

public CallConfiguration()
Creates a configuration with the defaults: audio only, calls in the system call log, no conferencing, phone-number and generic handles.

Method details

displayName

public CallConfiguration displayName(String name)
The name shown above a call. Defaults to the application name.

videoSupported

public CallConfiguration videoSupported(boolean value)
Whether the app offers video calls.

includesCallsInRecents

public CallConfiguration includesCallsInRecents(boolean value)
Whether calls appear in the system call log. Turning this off also stops the user calling back from Recents, which is usually not what is wanted.

maximumCallGroups

public CallConfiguration maximumCallGroups(int value)
How many separate conferences may exist at once.

maximumCallsPerGroup

public CallConfiguration maximumCallsPerGroup(int value)
How many calls may be in one conference.

handleTypes

public CallConfiguration handleTypes(CallHandleType[] types)

Replaces the set of address kinds the app understands.

At least one, and null restores the defaults. An EMPTY array is refused rather than obeyed or ignored: it reads as “route nothing to me”, which is not a configuration an account can hold – a PhoneAccount with no URI scheme and a provider with no handle type can never be given a call – and the ports had no way to tell it from “not set”, so they filled in the defaults and the app silently got the types it had just removed. Refusing says so where the caller can still act on it.

Parameters

types CallHandleType[]
the kinds, or null for the defaults

Throws

IllegalArgumentException
when types is present and holds no usable kind

getDisplayName

public String getDisplayName()
The display name, or null for the application’s own.

isVideoSupported

public boolean isVideoSupported()
Whether video is offered.

isIncludesCallsInRecents

public boolean isIncludesCallsInRecents()
Whether calls appear in the system call log.

getMaximumCallGroups

public int getMaximumCallGroups()
How many conferences may exist at once.

getMaximumCallsPerGroup

public int getMaximumCallsPerGroup()
How many calls may be in one conference.

getHandleTypes

public CallHandleType[] getHandleTypes()
The address kinds the app understands.