Platform Telecom Transactional APIs
Telecom Transactional APIs are defined as APIs that leverage
android.os.OutcomeReceivers. The receivers are to be completed by
Telecom for CallControl opertaions and the Client for CallEventCallback
operations. Doing so ensures the client and telecom are in sync with
call states. Also, these APIs are more lightweight than the
ConnectionService way of starting a self-managed call.
bug: 249779561
Test: atest android.telecom.cts.TransactionalApisTest
Change-Id: Icb09b2874d599a40afca8b7e960b14ca1bca606d
diff --git a/telecomm/java/android/telecom/PhoneAccount.java b/telecomm/java/android/telecom/PhoneAccount.java
index ec18c6a..047ab3a 100644
--- a/telecomm/java/android/telecom/PhoneAccount.java
+++ b/telecomm/java/android/telecom/PhoneAccount.java
@@ -418,7 +418,26 @@
*/
public static final int CAPABILITY_VOICE_CALLING_AVAILABLE = 0x20000;
- /* NEXT CAPABILITY: 0x40000 */
+
+ /**
+ * Flag indicating that this {@link PhoneAccount} supports the use TelecomManager APIs that
+ * utilize {@link android.os.OutcomeReceiver}s or {@link java.util.function.Consumer}s.
+ * Be aware, if this capability is set, {@link #CAPABILITY_SELF_MANAGED} will be amended by
+ * Telecom when this {@link PhoneAccount} is registered via
+ * {@link TelecomManager#registerPhoneAccount(PhoneAccount)}.
+ *
+ * <p>
+ * {@link android.os.OutcomeReceiver}s and {@link java.util.function.Consumer}s represent
+ * transactional operations because the operation can succeed or fail. An app wishing to use
+ * transactional operations should define behavior for a successful and failed TelecomManager
+ * API call.
+ *
+ * @see #CAPABILITY_SELF_MANAGED
+ * @see #getCapabilities
+ */
+ public static final int CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS = 0x40000;
+
+ /* NEXT CAPABILITY: [0x80000, 0x100000, 0x200000] */
/**
* URI scheme for telephone number URIs.