From 41c232c7bc9e409426317b97c48142d789f1af84 Mon Sep 17 00:00:00 2001 From: Brad Ebinger Date: Wed, 22 Jan 2020 16:09:57 -0800 Subject: Add IMS_RCS_UCE_ENABLED column to SimInfo database Add the ability for the user to turn on/off UCE in settings. Bug: 148167203 Test: atest CtsTelephonyTestCases:RcsUceAdapterTest Merged-In: Ic53a9ef32343bfa4d96c2cf7fc0f0791265d2bd1 Change-Id: Ic53a9ef32343bfa4d96c2cf7fc0f0791265d2bd1 --- api/system-current.txt | 24 ++++++++++++++++++++++ api/test-current.txt | 23 +++++++++++++++++++++ core/java/android/provider/Telephony.java | 6 ++++++ .../android/telephony/SubscriptionManager.java | 7 +++++++ .../java/android/telephony/ims/RcsUceAdapter.java | 11 +++++++++- 5 files changed, 70 insertions(+), 1 deletion(-) diff --git a/api/system-current.txt b/api/system-current.txt index 2f7dd202732d..763e3b405dd3 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -7212,6 +7212,7 @@ package android.provider { field public static final String HPLMNS = "hplmns"; field public static final String ICC_ID = "icc_id"; field public static final String IMSI = "imsi"; + field public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled"; field public static final String ISO_COUNTRY_CODE = "iso_country_code"; field public static final String IS_EMBEDDED = "is_embedded"; field public static final String IS_OPPORTUNISTIC = "is_opportunistic"; @@ -10576,6 +10577,29 @@ package android.telephony.ims { method @NonNull public android.telephony.ims.RcsContactUceCapability build(); } + public class RcsUceAdapter { + method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException; + method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException; + field public static final int ERROR_ALREADY_IN_QUEUE = 13; // 0xd + field public static final int ERROR_FORBIDDEN = 6; // 0x6 + field public static final int ERROR_GENERIC_FAILURE = 1; // 0x1 + field public static final int ERROR_INSUFFICIENT_MEMORY = 11; // 0xb + field public static final int ERROR_LOST_NETWORK = 12; // 0xc + field public static final int ERROR_NOT_AUTHORIZED = 5; // 0x5 + field public static final int ERROR_NOT_AVAILABLE = 3; // 0x3 + field public static final int ERROR_NOT_ENABLED = 2; // 0x2 + field public static final int ERROR_NOT_FOUND = 7; // 0x7 + field public static final int ERROR_NOT_REGISTERED = 4; // 0x4 + field public static final int ERROR_REQUEST_TIMEOUT = 10; // 0xa + field public static final int ERROR_REQUEST_TOO_LARGE = 8; // 0x8 + field public static final int PUBLISH_STATE_200_OK = 1; // 0x1 + field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2 + field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6 + field public static final int PUBLISH_STATE_RCS_PROVISION_ERROR = 4; // 0x4 + field public static final int PUBLISH_STATE_REQUEST_TIMEOUT = 5; // 0x5 + field public static final int PUBLISH_STATE_VOLTE_PROVISION_ERROR = 3; // 0x3 + } + } package android.telephony.ims.feature { diff --git a/api/test-current.txt b/api/test-current.txt index f79c8eefe642..87dde23647eb 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3765,6 +3765,29 @@ package android.telephony.ims { method public void onProvisioningStringChanged(int, @NonNull String); } + public class RcsUceAdapter { + method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public boolean isUceSettingEnabled() throws android.telephony.ims.ImsException; + method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUceSettingEnabled(boolean) throws android.telephony.ims.ImsException; + field public static final int ERROR_ALREADY_IN_QUEUE = 13; // 0xd + field public static final int ERROR_FORBIDDEN = 6; // 0x6 + field public static final int ERROR_GENERIC_FAILURE = 1; // 0x1 + field public static final int ERROR_INSUFFICIENT_MEMORY = 11; // 0xb + field public static final int ERROR_LOST_NETWORK = 12; // 0xc + field public static final int ERROR_NOT_AUTHORIZED = 5; // 0x5 + field public static final int ERROR_NOT_AVAILABLE = 3; // 0x3 + field public static final int ERROR_NOT_ENABLED = 2; // 0x2 + field public static final int ERROR_NOT_FOUND = 7; // 0x7 + field public static final int ERROR_NOT_REGISTERED = 4; // 0x4 + field public static final int ERROR_REQUEST_TIMEOUT = 10; // 0xa + field public static final int ERROR_REQUEST_TOO_LARGE = 8; // 0x8 + field public static final int PUBLISH_STATE_200_OK = 1; // 0x1 + field public static final int PUBLISH_STATE_NOT_PUBLISHED = 2; // 0x2 + field public static final int PUBLISH_STATE_OTHER_ERROR = 6; // 0x6 + field public static final int PUBLISH_STATE_RCS_PROVISION_ERROR = 4; // 0x4 + field public static final int PUBLISH_STATE_REQUEST_TIMEOUT = 5; // 0x5 + field public static final int PUBLISH_STATE_VOLTE_PROVISION_ERROR = 3; // 0x3 + } + } package android.telephony.ims.feature { diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java index ca07c8916ace..1611d28b1be2 100644 --- a/core/java/android/provider/Telephony.java +++ b/core/java/android/provider/Telephony.java @@ -5251,6 +5251,12 @@ public final class Telephony { /** TelephonyProvider column name for enable Wifi calling in roaming */ public static final String WFC_IMS_ROAMING_ENABLED = "wfc_ims_roaming_enabled"; + /** + * Determines if the user has enabled IMS RCS User Capability Exchange (UCE) for this + * subscription. + */ + public static final String IMS_RCS_UCE_ENABLED = "ims_rcs_uce_enabled"; + /** * TelephonyProvider column name for whether a subscription is opportunistic, that is, * whether the network it connects to is limited in functionality or coverage. diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 8adf947ec74b..ea95aacc3184 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -676,6 +676,13 @@ public class SubscriptionManager { */ public static final String WFC_IMS_ROAMING_ENABLED = SimInfo.WFC_IMS_ROAMING_ENABLED; + /** + * Determines if the user has enabled IMS RCS User Capability Exchange (UCE) for this + * subscription. + * @hide + */ + public static final String IMS_RCS_UCE_ENABLED = SimInfo.IMS_RCS_UCE_ENABLED; + /** * TelephonyProvider column name for whether a subscription is opportunistic, that is, * whether the network it connects to is limited in functionality or coverage. diff --git a/telephony/java/android/telephony/ims/RcsUceAdapter.java b/telephony/java/android/telephony/ims/RcsUceAdapter.java index b47bcb9b119b..e67a70f4abd7 100644 --- a/telephony/java/android/telephony/ims/RcsUceAdapter.java +++ b/telephony/java/android/telephony/ims/RcsUceAdapter.java @@ -21,6 +21,8 @@ import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.RequiresPermission; +import android.annotation.SystemApi; +import android.annotation.TestApi; import android.content.Context; import android.net.Uri; import android.os.Binder; @@ -29,6 +31,7 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.telephony.ims.aidl.IImsRcsController; import android.telephony.ims.aidl.IRcsUceControllerCallback; +import android.telephony.ims.feature.RcsFeature; import android.util.Log; import java.lang.annotation.Retention; @@ -42,6 +45,8 @@ import java.util.concurrent.Executor; * @see ImsRcsManager#getUceAdapter() for information on creating an instance of this class. * @hide */ +@SystemApi +@TestApi public class RcsUceAdapter { private static final String TAG = "RcsUceAdapter"; @@ -170,6 +175,7 @@ public class RcsUceAdapter { * Provides a one-time callback for the response to a UCE request. After this callback is called * by the framework, the reference to this callback will be discarded on the service side. * @see #requestCapabilities(Executor, List, CapabilitiesCallback) + * @hide */ public static class CapabilitiesCallback { @@ -197,6 +203,7 @@ public class RcsUceAdapter { /** * Not to be instantiated directly, use * {@link ImsRcsManager#getUceAdapter()} to instantiate this manager class. + * @hide */ RcsUceAdapter(int subId) { mSubId = subId; @@ -220,6 +227,7 @@ public class RcsUceAdapter { * {@link RcsUceAdapter} is valid, but the ImsService associated with the subscription is not * available. This can happen if the ImsService has crashed, for example, or if the subscription * becomes inactive. See {@link ImsException#getCode()} for more information on the error codes. + * @hide */ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void requestCapabilities(@CallbackExecutor Executor executor, @@ -275,6 +283,7 @@ public class RcsUceAdapter { * {@link RcsUceAdapter} is valid, but the ImsService associated with the subscription is not * available. This can happen if the ImsService has crashed, for example, or if the subscription * becomes inactive. See {@link ImsException#getCode()} for more information on the error codes. + * @hide */ @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public @PublishState int getUcePublishState() throws ImsException { @@ -299,7 +308,7 @@ public class RcsUceAdapter { * for the associated subscription. * * @return true if the user’s setting for UCE is enabled, false otherwise. If false, - * {@link ImsRcsManager#isCapable(int)} will return false for + * {@link ImsRcsManager#isCapable(int, int)} will return false for * {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_OPTIONS_UCE} and * {@link RcsFeature.RcsImsCapabilities#CAPABILITY_TYPE_PRESENCE_UCE} * @see #setUceSettingEnabled(boolean) -- cgit v1.2.3-59-g8ed1b