From d8faf70b80b0dfcbc1e52d3a2027a26e1c40c572 Mon Sep 17 00:00:00 2001 From: Santos Cordon Date: Wed, 20 May 2015 16:55:59 -0700 Subject: [PATCH] Add intents for enabling phone accounts. Bug: 20303449 Change-Id: If0057d42373b6964193c562ae8a8487a0299da76 --- telecomm/java/android/telecom/TelecomManager.java | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/telecomm/java/android/telecom/TelecomManager.java b/telecomm/java/android/telecom/TelecomManager.java index 308c204676b4..145c99381ca5 100644 --- a/telecomm/java/android/telecom/TelecomManager.java +++ b/telecomm/java/android/telecom/TelecomManager.java @@ -126,6 +126,23 @@ public class TelecomManager { "android.telecom.action.CHANGE_DEFAULT_DIALER"; /** + * Activity action: Opens the settings screen where a user can enable and disable which + * {@link PhoneAccount}s are allows to make and receive calls. Because a user must + * explicitly enable an account before the system will use it, an app may want to send the + * user to this setting after registering a {@link PhoneAccount}. + *

+ * Input: get*Extra field {@link #EXTRA_PHONE_ACCOUNT_DESCRIPTION} contains a string-based + * reference to the {@link PhoneAccountHandle} you want to enable. get*Extra field + * {@link #EXTRA_ENABLE_PHONE_ACCOUNT_VALUE} contains a boolean value indicated whether + * the account should be enabled or disabled. + *

+ * Requires permission: {@link android.Manifest.permission#MODIFY_PHONE_STATE} + * @hide + */ + public static final String ACTION_ENABLE_PHONE_ACCOUNT_SETTING = + "android.telecom.action.ENABLE_PHONE_ACCOUNT_SETTING"; + + /** * Extra value used to provide the package name for {@link #ACTION_CHANGE_DEFAULT_DIALER}. */ public static final String EXTRA_CHANGE_DEFAULT_DIALER_PACKAGE_NAME = @@ -161,6 +178,25 @@ public class TelecomManager { "android.telecom.extra.PHONE_ACCOUNT_HANDLE"; /** + * The extra used with {@link #ACTION_ENABLE_PHONE_ACCOUNT_SETTING} to specify a phone account + * as a string value. The value is of the form: "A;B" where A is the component name of the + * {@link PhoneAccount} (e.g., + * com.android.phone/com.android.services.telephony.TelephonyConnectionService) and B is the + * {@link PhoneAccount} ID. + * @hide + */ + public static final String EXTRA_PHONE_ACCOUNT_DESCRIPTION = + "android.telecom.extra.PHONE_ACCOUNT_DESCRIPTION"; + + /** + * Boolean extra used to specify a value for enabling and disabling a phone account. + * Used with {@link #ACTION_ENABLE_PHONE_ACCOUNT_SETTING}. + * @hide + */ + public static final String EXTRA_ENABLE_PHONE_ACCOUNT_VALUE = + "android.telecom.extra.ENABLE_PHONE_ACCOUNT_VALUE"; + + /** * Optional extra for {@link #ACTION_INCOMING_CALL} containing a {@link Bundle} which contains * metadata about the call. This {@link Bundle} will be returned to the * {@link ConnectionService}. -- 2.11.0