public final class CallConfiguration
- Object
- 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
Inherited methods
Constructor details
CallConfiguration
public CallConfiguration()Method details
displayName
public CallConfiguration displayName(String name)videoSupported
public CallConfiguration videoSupported(boolean value)includesCallsInRecents
public CallConfiguration includesCallsInRecents(boolean value)maximumCallGroups
public CallConfiguration maximumCallGroups(int value)maximumCallsPerGroup
public CallConfiguration maximumCallsPerGroup(int value)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
typesCallHandleType[]- the kinds, or null for the defaults
Throws
IllegalArgumentException- when
typesis present and holds no usable kind
getDisplayName
public String getDisplayName()isVideoSupported
public boolean isVideoSupported()isIncludesCallsInRecents
public boolean isIncludesCallsInRecents()getMaximumCallGroups
public int getMaximumCallGroups()getMaximumCallsPerGroup
public int getMaximumCallsPerGroup()getHandleTypes
public CallHandleType[] getHandleTypes()