diff options
author | Sooraj Sasindran <sasindran@google.com> | 2020-08-11 10:46:39 -0700 |
---|---|---|
committer | Sooraj Sasindran <sasindran@google.com> | 2020-11-04 10:28:10 -0800 |
commit | 11a66cb26627ec9a0ea19dc5b0934969e51fd315 (patch) | |
tree | 2c8b44f43213cf25cd2969df0b0252ef255cb3e1 /telephony | |
parent | 84afc97ad78e044e62733c87db6234f0f090379d (diff) |
Ability to configure NR dual connectivity
Provide ability to configure EUTRANR dual
connectivity
Bug: 162373679
Test: build
Change-Id: I48f5ef0a5f84157de9feffa8c5aa85d226163068
Diffstat (limited to 'telephony')
3 files changed, 161 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 73244859c336..5f3fd60f7e96 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -13458,6 +13458,149 @@ public class TelephonyManager { } } + /** + * No error. Operation succeeded. + * @hide + */ + @SystemApi + public static final int ENABLE_NR_DUAL_CONNECTIVITY_SUCCESS = 0; + + /** + * NR Dual connectivity enablement is not supported. + * @hide + */ + @SystemApi + public static final int ENABLE_NR_DUAL_CONNECTIVITY_NOT_SUPPORTED = 1; + + /** + * Radio is not available. + * @hide + */ + @SystemApi + public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_NOT_AVAILABLE = 2; + + /** + * Internal Radio error. + * @hide + */ + @SystemApi + public static final int ENABLE_NR_DUAL_CONNECTIVITY_RADIO_ERROR = 3; + + /** + * Currently in invalid state. Not able to process the request. + * @hide + */ + @SystemApi + public static final int ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE = 4; + + /** @hide */ + @Retention(RetentionPolicy.SOURCE) + @IntDef(prefix = {"ENABLE_NR_DUAL_CONNECTIVITY"}, value = { + ENABLE_NR_DUAL_CONNECTIVITY_SUCCESS, + ENABLE_NR_DUAL_CONNECTIVITY_NOT_SUPPORTED, + ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE, + ENABLE_NR_DUAL_CONNECTIVITY_RADIO_NOT_AVAILABLE, + ENABLE_NR_DUAL_CONNECTIVITY_RADIO_ERROR}) + public @interface EnableNrDualConnectivityResult {} + + /** + * Enable NR dual connectivity. Enabled state does not mean dual connectivity + * is active. It means device is allowed to connect to both primary and secondary. + * + * @hide + */ + @SystemApi + public static final int NR_DUAL_CONNECTIVITY_ENABLE = 1; + + /** + * Disable NR dual connectivity. Disabled state does not mean the secondary cell is released. + * Modem will release it only if the current bearer is released to avoid radio link failure. + * @hide + */ + @SystemApi + public static final int NR_DUAL_CONNECTIVITY_DISABLE = 2; + + /** + * Disable NR dual connectivity and force the secondary cell to be released if dual connectivity + * was active. This will result in radio link failure. + * @hide + */ + @SystemApi + public static final int NR_DUAL_CONNECTIVITY_DISABLE_IMMEDIATE = 3; + + /** + * @hide + */ + @IntDef(prefix = { "NR_DUAL_CONNECTIVITY_" }, value = { + NR_DUAL_CONNECTIVITY_ENABLE, + NR_DUAL_CONNECTIVITY_DISABLE, + NR_DUAL_CONNECTIVITY_DISABLE_IMMEDIATE, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface NrDualConnectivityState { + } + + /** + * Enable/Disable E-UTRA-NR Dual Connectivity. + * + * @param nrDualConnectivityState expected NR dual connectivity state + * This can be passed following states + * <ol> + * <li>Enable NR dual connectivity {@link #NR_DUAL_CONNECTIVITY_ENABLE} + * <li>Disable NR dual connectivity {@link #NR_DUAL_CONNECTIVITY_DISABLE} + * <li>Disable NR dual connectivity and force secondary cell to be released + * {@link #NR_DUAL_CONNECTIVITY_DISABLE_IMMEDIATE} + * </ol> + * @return operation result. + * <p>Requires Permission: + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE} + * @throws IllegalStateException if the Telephony process is not currently available. + * @hide + */ + @SystemApi + public @EnableNrDualConnectivityResult int setNrDualConnectivityState( + @NrDualConnectivityState int nrDualConnectivityState) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.setNrDualConnectivityState(getSubId(), nrDualConnectivityState); + } else { + throw new IllegalStateException("telephony service is null."); + } + } catch (RemoteException ex) { + Rlog.e(TAG, "setNrDualConnectivityState RemoteException", ex); + ex.rethrowFromSystemServer(); + } + + return ENABLE_NR_DUAL_CONNECTIVITY_INVALID_STATE; + } + + /** + * Is E-UTRA-NR Dual Connectivity enabled. + * @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. + * <p>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 + public boolean isNrDualConnectivityEnabled() { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isNrDualConnectivityEnabled(getSubId()); + } else { + throw new IllegalStateException("telephony service is null."); + } + } catch (RemoteException ex) { + Rlog.e(TAG, "isNRDualConnectivityEnabled RemoteException", ex); + ex.rethrowFromSystemServer(); + } + return false; + } + private static class DeathRecipient implements IBinder.DeathRecipient { @Override public void binderDied() { diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 79456360c377..a8a491ac7402 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -2216,4 +2216,20 @@ interface ITelephony { * does not exist on the SIM card. */ List<String> getEquivalentHomePlmns(int subId, String callingPackage, String callingFeatureId); + + /** + * Enable/Disable E-UTRA-NR Dual Connectivity + * @return operation result. See TelephonyManager.EnableNrDualConnectivityResult for + * details + * @param subId the id of the subscription + * @param enable enable/disable dual connectivity + */ + int setNrDualConnectivityState(int subId, int nrDualConnectivityState); + + /** + * Is E-UTRA-NR Dual Connectivity enabled + * @param subId the id of the subscription + * @return true if dual connectivity is enabled else false + */ + boolean isNrDualConnectivityEnabled(int subId); } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 4abf784e9c81..d3c27dc4f255 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -513,6 +513,8 @@ public interface RILConstants { int RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS = 210; int RIL_REQUEST_GET_BARRING_INFO = 211; int RIL_REQUEST_ENTER_SIM_DEPERSONALIZATION = 212; + int RIL_REQUEST_ENABLE_NR_DUAL_CONNECTIVITY = 213; + int RIL_REQUEST_IS_NR_DUAL_CONNECTIVITY_ENABLED = 214; int RIL_REQUEST_ALLOCATE_PDU_SESSION_ID = 215; int RIL_REQUEST_RELEASE_PDU_SESSION_ID = 216; int RIL_REQUEST_BEGIN_HANDOVER = 217; |