Add NETWORK_TYPE_NR to Telephony framework

Add NETWORK_CLASS_5_G to TelephonyManager
Add NR to ServiceState

Bug: 135421985
Test: atest FrameworksTelephonyTests
Change-Id: Iaed46354400c7a1ce410eebc246892d7edf448dc
This commit is contained in:
Sarah Chin
2019-10-03 12:18:54 -07:00
parent a55998b536
commit 080b210f0e
2 changed files with 12 additions and 2 deletions

View File

@@ -963,6 +963,9 @@ public class ServiceState implements Parcelable {
case RIL_RADIO_TECHNOLOGY_LTE_CA:
rtString = "LTE_CA";
break;
case RIL_RADIO_TECHNOLOGY_NR:
rtString = "LTE_NR";
break;
default:
rtString = "Unexpected";
Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt);
@@ -1529,6 +1532,7 @@ public class ServiceState implements Parcelable {
return AccessNetworkType.CDMA2000;
case RIL_RADIO_TECHNOLOGY_LTE:
case RIL_RADIO_TECHNOLOGY_LTE_CA:
case RIL_RADIO_TECHNOLOGY_NR:
return AccessNetworkType.EUTRAN;
case RIL_RADIO_TECHNOLOGY_IWLAN:
return AccessNetworkType.IWLAN;
@@ -1577,6 +1581,8 @@ public class ServiceState implements Parcelable {
return ServiceState.RIL_RADIO_TECHNOLOGY_IWLAN;
case TelephonyManager.NETWORK_TYPE_LTE_CA:
return ServiceState.RIL_RADIO_TECHNOLOGY_LTE_CA;
case TelephonyManager.NETWORK_TYPE_NR:
return ServiceState.RIL_RADIO_TECHNOLOGY_NR;
default:
return ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
}
@@ -1667,7 +1673,8 @@ public class ServiceState implements Parcelable {
|| radioTechnology == RIL_RADIO_TECHNOLOGY_GSM
|| radioTechnology == RIL_RADIO_TECHNOLOGY_TD_SCDMA
|| radioTechnology == RIL_RADIO_TECHNOLOGY_IWLAN
|| radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA;
|| radioTechnology == RIL_RADIO_TECHNOLOGY_LTE_CA
|| radioTechnology == RIL_RADIO_TECHNOLOGY_NR;
}

View File

@@ -70,7 +70,6 @@ import android.telephony.Annotation.NetworkType;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SimActivationState;
import android.telephony.VisualVoicemailService.VisualVoicemailTask;
import android.telephony.data.ApnSetting;
import android.telephony.emergency.EmergencyNumber;
import android.telephony.emergency.EmergencyNumber.EmergencyServiceCategories;
import android.telephony.ims.ImsMmTelManager;
@@ -2717,6 +2716,8 @@ public class TelephonyManager {
/** Class of broadly defined "4G" networks. {@hide} */
@UnsupportedAppUsage
public static final int NETWORK_CLASS_4_G = 3;
/** Class of broadly defined "5G" networks. {@hide} */
public static final int NETWORK_CLASS_5_G = 4;
/**
* Return general class of network type, such as "3G" or "4G". In cases
@@ -2749,6 +2750,8 @@ public class TelephonyManager {
case NETWORK_TYPE_IWLAN:
case NETWORK_TYPE_LTE_CA:
return NETWORK_CLASS_4_G;
case NETWORK_TYPE_NR:
return NETWORK_CLASS_5_G;
default:
return NETWORK_CLASS_UNKNOWN;
}