Reset 5G support.

Change-Id: I0d8f3f6962ef7c1e17892afabbcce6c93a2e698d
diff --git a/mbtk/mbtk_rild_v2/src/ril_net.c b/mbtk/mbtk_rild_v2/src/ril_net.c
index 649fd72..3c0ee24 100755
--- a/mbtk/mbtk_rild_v2/src/ril_net.c
+++ b/mbtk/mbtk_rild_v2/src/ril_net.c
@@ -25,19 +25,6 @@
 extern ril_band_info_t band_info;
 void ril_rsp_pack_send(ATPortType_enum port, int fd, int ril_id, int msg_index, const void* data, int data_len);
 
-static bool net_support_check(uint32 net_type, uint32 net_flag)
-{
-#ifdef MBTK_DEV_INFO_VERSION_2
-    return (net_type & net_flag);
-#else
-    if(net_flag == MBTK_NET_SUPPORT_5G) {
-        return FALSE;
-    } else {
-        return TRUE;
-    }
-#endif
-}
-
 /*
 AT+COPS=?
 
@@ -273,48 +260,45 @@
 
     if(band->gsm_band == 0 && band->umts_band == 0
         && band->tdlte_band == 0 && band->fddlte_band == 0 && band->lte_ext_band == 0
+#ifdef MBTK_DEV_INFO_VERSION_2
         && band->nr_3_band == 0 && band->nr_2_band == 0
         && band->nr_1_band == 0 && band->nr_0_band == 0
+#endif
         ) {
         sprintf(cmd, "AT*BAND=%d", band->net_pref);
     } else {
         log_hex("BAND_SUPPORT", &band_info.band_support, sizeof(mbtk_band_info_t));
         log_hex("BAND", band, sizeof(mbtk_band_info_t));
 
-        if(band->gsm_band == 0 && net_support_check(band_info.net_support, MBTK_NET_SUPPORT_2G)) {
+        if(band->gsm_band == 0) {
             band->gsm_band = band_info.band_support.gsm_band;
         }
-        if(band->umts_band == 0 && net_support_check(band_info.net_support, MBTK_NET_SUPPORT_3G)) {
+        if(band->umts_band == 0) {
             band->umts_band = band_info.band_support.umts_band;
         }
-
-        if(net_support_check(band_info.net_support, MBTK_NET_SUPPORT_4G)) {
-            if(band->tdlte_band == 0) {
-                band->tdlte_band = band_info.band_support.tdlte_band;
-            }
-            if(band->fddlte_band == 0) {
-                band->fddlte_band = band_info.band_support.fddlte_band;
-            }
-            if(band->lte_ext_band == 0) {
-                band->lte_ext_band = band_info.band_support.lte_ext_band;
-            }
+        if(band->tdlte_band == 0) {
+            band->tdlte_band = band_info.band_support.tdlte_band;
         }
-
-        if(net_support_check(band_info.net_support, MBTK_NET_SUPPORT_5G)) {
-            if(band->nr_3_band == 0) {
-                band->nr_3_band = band_info.band_support.nr_3_band;
-            }
-            if(band->nr_2_band == 0) {
-                band->nr_2_band = band_info.band_support.nr_2_band;
-            }
-            if(band->nr_1_band == 0) {
-                band->nr_1_band = band_info.band_support.nr_1_band;
-            }
-            if(band->nr_0_band == 0) {
-                band->nr_0_band = band_info.band_support.nr_0_band;
-            }
+        if(band->fddlte_band == 0) {
+            band->fddlte_band = band_info.band_support.fddlte_band;
         }
-
+        if(band->lte_ext_band == 0) {
+            band->lte_ext_band = band_info.band_support.lte_ext_band;
+        }
+#ifdef MBTK_DEV_INFO_VERSION_2
+        if(band->nr_3_band == 0) {
+            band->nr_3_band = band_info.band_support.nr_3_band;
+        }
+        if(band->nr_2_band == 0) {
+            band->nr_2_band = band_info.band_support.nr_2_band;
+        }
+        if(band->nr_1_band == 0) {
+            band->nr_1_band = band_info.band_support.nr_1_band;
+        }
+        if(band->nr_0_band == 0) {
+            band->nr_0_band = band_info.band_support.nr_0_band;
+        }
+#endif
         if((band->gsm_band & band_info.band_support.gsm_band) != band->gsm_band) {
             LOG("GSM band error.");
             goto exit;
@@ -339,6 +323,7 @@
             LOG("EXT_LTE band error.");
             goto exit;
         }
+#ifdef MBTK_DEV_INFO_VERSION_2
         if((band->nr_3_band & band_info.band_support.nr_3_band) != band->nr_3_band) {
             LOG("nr_3_band band error.");
             goto exit;
@@ -358,6 +343,7 @@
             LOG("nr_0_band band error.");
             goto exit;
         }
+#endif
         if(band->net_pref == 0xFF) { // No change net_pref.
             int tmp_int;
             err = at_send_command_singleline(port, "AT*BAND?", "*BAND:", &response);
@@ -384,6 +370,7 @@
 
             at_response_free(response);
         }
+#ifdef MBTK_DEV_INFO_VERSION_2
         // Only support 4G/5G
         if(band_info.net_support & MBTK_NET_SUPPORT_5G) {
             // AT*band=19,0,0,482,134742231,0,24576,256,134217877,0
@@ -401,6 +388,13 @@
                 sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band);
             }
         }
+#else
+        if(band->lte_ext_band > 0) {
+            sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d,,,,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band, band->lte_ext_band);
+        } else {
+            sprintf(cmd, "AT*BAND=%d,%d,%d,%d,%d", band->net_pref, band->gsm_band, band->umts_band, band->tdlte_band, band->fddlte_band);
+        }
+#endif
     }
     err = at_send_command(port, cmd, &response);
 
@@ -543,6 +537,7 @@
     }
     band->fddlte_band = (uint32)tmp_int;
 
+#ifdef MBTK_DEV_INFO_VERSION_2
     if(band_info.net_support & MBTK_NET_SUPPORT_5G)
     {
         err = at_tok_nextint(&line, &tmp_int);
@@ -573,6 +568,7 @@
         }
         band->nr_0_band = (uint32)tmp_int;
     }
+#endif
 
     // roamingConfig
     err = at_tok_nextint(&line, &tmp_int);
@@ -718,31 +714,6 @@
     }
     signal->rsrp = (uint8)tmp_int;
 
-    if(at_tok_hasmore(&line)) {
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-        signal->ss_rsrq = (uint8)tmp_int;
-    }
-    if(at_tok_hasmore(&line)) {
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-        signal->ss_rsrp = (uint8)tmp_int;
-    }
-    if(at_tok_hasmore(&line)) {
-        err = at_tok_nextint(&line, &tmp_int);
-        if (err < 0)
-        {
-            goto exit;
-        }
-        signal->ss_sinr = (uint8)tmp_int;
-    }
-
     at_response_free(response);
     err = at_send_command_singleline(port, "AT+COPS?", "+COPS:", &response);
     if (err < 0 || response->success == 0 || !response->p_intermediates){
@@ -930,56 +901,6 @@
             goto exit;
         }
         reg->type = (uint8)tmp_int;
-    } else if(reg->data_state == 0 && (band_info.net_support & MBTK_NET_SUPPORT_5G)) {
-        at_response_free(response);
-        err = at_send_command_multiline(port, "AT+C5GREG?", "+C5GREG:", &response);
-        if (err < 0 || response->success == 0 || !response->p_intermediates){
-            if(cme_err) {
-                *cme_err = at_get_cme_error(response);
-            }
-            goto exit;
-        }
-
-        line = response->p_intermediates->line;
-        err = at_tok_start(&line);
-        if (err < 0)
-        {
-            goto exit;
-        }
-        err = at_tok_nextint(&line, &tmp_int); // n
-        if (err < 0)
-        {
-            goto exit;
-        }
-        err = at_tok_nextint(&line, &tmp_int);// stat
-        if (err < 0)
-        {
-            goto exit;
-        }
-        reg->data_state = (uint8)tmp_int;
-
-        if(/*reg->lac == 0 && */at_tok_hasmore(&line)) {
-            err = at_tok_nextstr(&line, &tmp_str); // lac
-            if (err < 0)
-            {
-                goto exit;
-            }
-            reg->lac = strtol(tmp_str, NULL, 16);
-
-            err = at_tok_nextstr(&line, &tmp_str); // ci
-            if (err < 0)
-            {
-                goto exit;
-            }
-            reg->ci = strtol(tmp_str, NULL, 16);
-
-            err = at_tok_nextint(&line, &tmp_int);// AcT
-            if (err < 0)
-            {
-                goto exit;
-            }
-            reg->type = (uint8)tmp_int;
-        }
     }
     at_response_free(response);
 
@@ -1596,7 +1517,7 @@
                             ril_rsp_pack_send(cli_info->port, cli_info->fd, pack->msg_id, pack->msg_index, &band, sizeof(mbtk_band_info_t));
                         }
                     } else { // Get support bands.
-                        ril_rsp_pack_send(cli_info->port, cli_info->fd, pack->msg_id, pack->msg_index, &band_info.band_support, sizeof(mbtk_band_info_t));
+                        ril_rsp_pack_send(cli_info->port, cli_info->fd, pack->msg_id, pack->msg_index, &band_info.band_support , sizeof(mbtk_band_info_t));
                     }
                 } else { // Set current bands.
                     mbtk_band_info_t* band = (mbtk_band_info_t*)pack->data;
@@ -1694,7 +1615,6 @@
                 else
                 {
                     LOG("req_cell_info_get() success,cell number: %d", cell_info.cell_list.num);
-                    LOGD("data_len = %d", sizeof(mbtk_cell_info_array_t));
                     ril_rsp_pack_send(cli_info->port, cli_info->fd, pack->msg_id, pack->msg_index, &cell_info.cell_list, sizeof(mbtk_cell_info_array_t));
                 }
             }