Enum CallAvailability
- All Implemented Interfaces:
Comparable<CallAvailability>
Whether the app may ring a call right now. Distinct from
Calls.isSupported(), which asks whether the platform has the machinery
at all: an app can be perfectly supported and still be unable to ring,
because the user is on an emergency call or another app holds one.
Check this before reporting an incoming call so the far end can be told to stop trying, rather than discovering the refusal from a failed report.
The ordinals cross the SPI boundary, so existing constants must not be reordered.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA call can be reported now.An emergency call is in progress.has not run, so a report would be refused.invalid reference
Calls#configureThe user has switched this app's calling off, or the required permission or role is missing.Another application holds a call the system will not interrupt.This application already holds a call the platform will not let it stack another on.The platform has no system call integration at all. -
Method Summary
Modifier and TypeMethodDescriptionstatic CallAvailabilityReturns the enum constant of this type with the specified name.static CallAvailability[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
AVAILABLE
A call can be reported now. -
EMERGENCY_CALL_IN_PROGRESS
An emergency call is in progress. Nothing else may ring. -
OTHER_APP_IN_CALL
Another application holds a call the system will not interrupt. -
NOT_PERMITTED
The user has switched this app's calling off, or the required permission or role is missing. -
UNSUPPORTED
The platform has no system call integration at all. -
NOT_CONFIGURED
has not run, so a report would be refused.invalid reference
Calls#configureAppended rather than inserted: the ordinals cross the SPI boundary.
Android registers a Telecom
PhoneAccountfrom the configuration and ignores calls from an account it does not know, so a report made before configuring is refused whatever the permissions say. This exists because answering AVAILABLE and then refusing the very next report is precisely what the check above is documented to prevent. -
THIS_APP_IN_CALL
This application already holds a call the platform will not let it stack another on.
Appended rather than inserted: the ordinals cross the SPI boundary.
iOS only, and not an oversight elsewhere. The provider is configured for one call group of one call, so CallKit refuses a second report while this app owns a live call -- and answering AVAILABLE there would be the same broken promise as answering it before configure(). Android Telecom accepts a second self-managed call from the same account, so its bridge deliberately does NOT report this; see the note in AndroidCallBridge about isInCall() being true for our own call too.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-