Merge "Phone Info UI shows network type list which depends on RAT supported" into qt-qpr1-dev
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 8d78a87..249db58 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -100,7 +100,34 @@
 public class RadioInfo extends Activity {
     private static final String TAG = "RadioInfo";
 
-    private static final String[] mPreferredNetworkLabels = {
+    private static final String[] PREFERRED_NETWORK_LABELS_MAX_LTE = {
+            "GSM/WCDMA preferred",
+            "GSM only",
+            "WCDMA only",
+            "GSM/WCDMA auto (PRL)",
+            "CDMA/EvDo auto (PRL)",
+            "CDMA only",
+            "EvDo only",
+            "CDMA/EvDo/GSM/WCDMA (PRL)",
+            "CDMA + LTE/EvDo (PRL)",
+            "GSM/WCDMA/LTE (PRL)",
+            "LTE/CDMA/EvDo/GSM/WCDMA (PRL)",
+            "LTE only",
+            "LTE/WCDMA",
+            "TDSCDMA only",
+            "TDSCDMA/WCDMA",
+            "LTE/TDSCDMA",
+            "TDSCDMA/GSM",
+            "LTE/TDSCDMA/GSM",
+            "TDSCDMA/GSM/WCDMA",
+            "LTE/TDSCDMA/WCDMA",
+            "LTE/TDSCDMA/GSM/WCDMA",
+            "TDSCDMA/CDMA/EvDo/GSM/WCDMA ",
+            "LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA",
+            "Unknown"
+    };
+
+    private static final String[] PREFERRED_NETWORK_LABELS = {
             "GSM/WCDMA preferred",
             "GSM only",
             "WCDMA only",
@@ -126,7 +153,7 @@
             "LTE/TDSCDMA/CDMA/EvDo/GSM/WCDMA",
             "NR only",
             "NR/LTE",
-            "NR/LTE/CDME/EvDo",
+            "NR/LTE/CDMA/EvDo",
             "NR/LTE/GSM/WCDMA",
             "NR/LTE/CDMA/EvDo/GSM/WCDMA",
             "NR/LTE/WCDMA",
@@ -263,6 +290,8 @@
     private int mCellInfoRefreshRateIndex;
     private int mSelectedPhoneIndex;
 
+    private String[] mPreferredNetworkLabels;
+
     private final NetworkRequest mDefaultNetworkRequest = new NetworkRequest.Builder()
             .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
             .addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
@@ -482,6 +511,10 @@
 
         mPhyChanConfig = (TextView) findViewById(R.id.phy_chan_config);
 
+        final long supportedRadioBitmask = mTelephonyManager.getSupportedRadioAccessFamily();
+        mPreferredNetworkLabels =
+                ((TelephonyManager.NETWORK_TYPE_BITMASK_NR & supportedRadioBitmask) > 0)
+                        ? PREFERRED_NETWORK_LABELS : PREFERRED_NETWORK_LABELS_MAX_LTE;
         preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType);
         ArrayAdapter<String> preferredNetworkTypeAdapter = new ArrayAdapter<String> (this,
                 android.R.layout.simple_spinner_item, mPreferredNetworkLabels);