From d3b3e00a0547ee0c0ae8a4884512e72bbd153776 Mon Sep 17 00:00:00 2001 From: Sooraj Sasindran Date: Thu, 11 Mar 2021 17:45:14 -0800 Subject: Allow REQUEST_NOT_SUPPORTED for nr dual connectivity config Allow REQUEST_NOT_SUPPORTED for nr dual connectivity configuration and query Bug: 181648176 Test: CTS with presubmit Change-Id: Ib10dcc083d9aae7b905aa008dff05d2975865c71 --- .../java/android/telephony/TelephonyManager.java | 29 ++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'telephony/java') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8244342eee19..364c9be9614a 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -14111,6 +14111,10 @@ public class TelephonyManager { /** * Enable/Disable E-UTRA-NR Dual Connectivity. * + * This api is supported only if + * {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported} + * ({@link TelephonyManager#CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE}) + * returns true. * @param nrDualConnectivityState expected NR dual connectivity state * This can be passed following states *
    @@ -14125,6 +14129,9 @@ public class TelephonyManager { */ @SystemApi @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE) public @EnableNrDualConnectivityResult int setNrDualConnectivityState( @NrDualConnectivityState int nrDualConnectivityState) { try { @@ -14144,15 +14151,21 @@ public class TelephonyManager { /** * Is E-UTRA-NR Dual Connectivity enabled. + * This api is supported only if + * {@link android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported} + * ({@link TelephonyManager#CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE}) + * returns true. * @return true if dual connectivity is enabled else false. Enabled state does not mean dual * connectivity is active. It means the device is allowed to connect to both primary and * secondary cell. - *

    Requires Permission: - * {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE READ_PRIVILEGED_PHONE_STATE} * @throws IllegalStateException if the Telephony process is not currently available. * @hide */ @SystemApi + @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @RequiresFeature( + enforcement = "android.telephony.TelephonyManager#isRadioInterfaceCapabilitySupported", + value = TelephonyManager.CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE) public boolean isNrDualConnectivityEnabled() { try { ITelephony telephony = getITelephony(); @@ -14404,11 +14417,23 @@ public class TelephonyManager { public static final String CAPABILITY_ALLOWED_NETWORK_TYPES_USED = "CAPABILITY_ALLOWED_NETWORK_TYPES_USED"; + /** + * Indicates whether {@link #setNrDualConnectivityState()} and + * {@link #isNrDualConnectivityEnabled()} ()} are available. See comments + * on respective methods for more information. + * + * @hide + */ + @SystemApi + public static final String CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE = + "CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE"; + /** @hide */ @Retention(RetentionPolicy.SOURCE) @StringDef(prefix = "CAPABILITY_", value = { CAPABILITY_SECONDARY_LINK_BANDWIDTH_VISIBLE, CAPABILITY_ALLOWED_NETWORK_TYPES_USED, + CAPABILITY_NR_DUAL_CONNECTIVITY_CONFIGURATION_AVAILABLE }) public @interface RadioInterfaceCapability {} -- cgit v1.2.3