From 2526568630228e3f7c11a16aef7afae6e69de4ba Mon Sep 17 00:00:00 2001 From: Hunter Knepshield Date: Wed, 19 Jan 2022 02:25:06 -0800 Subject: APIs for SIM call manager voice status This CL creates two new PhoneAccount capabilities for the SIM call manager (and potentially telephony itself for PSTN PhoneAccounts) to advertise that they support voice calling, potentially independent of voice service state. With this information, telecom will feed updated back into telephony for plumbing through the standard ServiceState-based APIs. Bug: 205737545 Test: atest android.telecom.cts.PhoneAccountOperationsTest (an additional CTS test for the TelephonyManager API will be added as a follow-up) Change-Id: If7a5b03a7aa630823ac238ef27721e5e6cc596e6 --- telecomm/java/android/telecom/PhoneAccount.java | 50 +++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) (limited to 'telecomm/java') diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java index e332d3ff2b4d..ec18c6a696b8 100644 --- a/telecomm/java/android/telecom/PhoneAccount.java +++ b/telecomm/java/android/telecom/PhoneAccount.java @@ -380,7 +380,45 @@ public final class PhoneAccount implements Parcelable { */ public static final int CAPABILITY_CALL_COMPOSER = 0x8000; - /* NEXT CAPABILITY: 0x10000 */ + /** + * Flag indicating that this {@link PhoneAccount} provides SIM-based voice calls, potentially as + * an over-the-top solution such as wi-fi calling. + * + *

Similar to {@link #CAPABILITY_SUPPORTS_VIDEO_CALLING}, this capability indicates this + * {@link PhoneAccount} has the ability to make voice calls (but not necessarily at this time). + * Whether this {@link PhoneAccount} can make a voice call is ultimately controlled by {@link + * #CAPABILITY_VOICE_CALLING_AVAILABLE}, which indicates whether this {@link PhoneAccount} is + * currently capable of making a voice call. Consider a case where, for example, a {@link + * PhoneAccount} supports making voice calls (e.g. {@link + * #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS}), but a current lack of network connectivity + * prevents voice calls from being made (e.g. {@link #CAPABILITY_VOICE_CALLING_AVAILABLE}). + * + *

In order to declare this capability, this {@link PhoneAccount} must also declare {@link + * #CAPABILITY_SIM_SUBSCRIPTION} or {@link #CAPABILITY_CONNECTION_MANAGER} and satisfy the + * associated requirements. + * + * @see #CAPABILITY_VOICE_CALLING_AVAILABLE + * @see #getCapabilities + */ + public static final int CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS = 0x10000; + + /** + * Flag indicating that this {@link PhoneAccount} is currently able to place SIM-based + * voice calls, similar to {@link #CAPABILITY_VIDEO_CALLING}. + * + *

See also {@link #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS}, which indicates whether + * the {@code PhoneAccount} supports placing SIM-based voice calls or not. + * + *

In order to declare this capability, this {@link PhoneAccount} must also declare {@link + * #CAPABILITY_SIM_SUBSCRIPTION} or {@link #CAPABILITY_CONNECTION_MANAGER} and satisfy the + * associated requirements. + * + * @see #CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS + * @see #getCapabilities + */ + public static final int CAPABILITY_VOICE_CALLING_AVAILABLE = 0x20000; + + /* NEXT CAPABILITY: 0x40000 */ /** * URI scheme for telephone number URIs. @@ -1102,14 +1140,20 @@ public final class PhoneAccount implements Parcelable { sb.append("SimSub "); } if (hasCapabilities(CAPABILITY_RTT)) { - sb.append("Rtt"); + sb.append("Rtt "); } if (hasCapabilities(CAPABILITY_ADHOC_CONFERENCE_CALLING)) { - sb.append("AdhocConf"); + sb.append("AdhocConf "); } if (hasCapabilities(CAPABILITY_CALL_COMPOSER)) { sb.append("CallComposer "); } + if (hasCapabilities(CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS)) { + sb.append("SuppVoice "); + } + if (hasCapabilities(CAPABILITY_VOICE_CALLING_AVAILABLE)) { + sb.append("Voice "); + } return sb.toString(); } -- cgit v1.2.3-59-g8ed1b