Merge "[Feature][T106]version update to T106CN-ZS03.V2.01.01.02P54U02.AP.10.03_CAP.10.03"
diff --git a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
index a8470b2..8206074 100755
--- a/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
+++ b/cap/zx297520v3/sources/meta-zxic/recipes-kernel/linux/files/zx297520v3/linux-5_10-vehicle_dc_ref-normal-defconfig
@@ -1395,6 +1395,9 @@
 # CONFIG_NET_VENDOR_XILINX is not set
 CONFIG_NET_VENDOR_ZTE=y
 CONFIG_ZX29_GMAC=y
+# zw.wang modify for T106BUG-423 20240118 start
+CONFIG_BOOT_WITHOUT_LOCK=y
+# zw.wang modify for T106BUG-423 20240118  end
 CONFIG_PHYLIB=y
 CONFIG_SWPHY=y
 CONFIG_FIXED_PHY=y
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
index b497527..105d347 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-data/lynq_data.cpp
@@ -1594,7 +1594,7 @@
         return -1;
     }
 
-    if(user == NULL || strcmp(user, "NULL") == 0)
+    if(user == NULL || strcmp(user, "NULL") == 0 || strlen(user) == 0)
     {
         argv[1] = NULL;
     }
@@ -1603,7 +1603,7 @@
         argv[1] = user;
     }
 
-    if(password == NULL || strcmp(password, "NULL") == 0)
+    if(password == NULL || strcmp(password, "NULL") == 0 || strlen(password) == 0)
     {
         argv[2] = NULL;
     }
@@ -1612,7 +1612,7 @@
         argv[2] = password;
     }
 
-    if(authType == NULL || strcmp(authType, "NULL") == 0)
+    if(authType == NULL || strcmp(authType, "NULL") == 0 || strlen(authType) == 0)
     {
         argv[3] = NULL;
     }
@@ -1620,7 +1620,7 @@
     {
         argv[3] = authType;
     }
-    if(normalProtocol==NULL)
+    if(normalProtocol==NULL|| strlen(normalProtocol) == 0)
     {
         argv[4] = "IPV4V6";
     }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-network/lynq_network.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-network/lynq_network.cpp
index 6a1b35b..a32e119 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-network/lynq_network.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-network/lynq_network.cpp
@@ -1605,7 +1605,7 @@
         return LYNQ_E_CONFLICT;

     }

     LYDBGLOG("start get urc info");

-    if(handle != RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED &&handle != RIL_UNSOL_SIGNAL_STRENGTH)

+    if(is_support_urc(handle)==false)

     {

         LYINFLOG("invalid handle!!!");

         return LYNQ_E_PARAMETER_ANONALY;

@@ -1617,14 +1617,7 @@
         return LYNQ_E_PARAMETER_ANONALY;

     }

     switch(handle)

-    {

-        case RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED: //1002

-        {

-            LYDBGLOG("get state update to VOICE");

-            *slot_id = s_module_urc_slot_id;

-            LYINFLOG("slot_id = %d",s_module_urc_slot_id);

-            break;

-        }

+    {        

         case RIL_UNSOL_SIGNAL_STRENGTH: //1009

         {

             LYDBGLOG("get state update to signal info");

@@ -1648,6 +1641,11 @@
             solSigStren->csiSinr = s_network_urc_solSigStren.csiSinr;

             break;

         }

+        default:

+        {

+            *slot_id = s_module_urc_slot_id;

+            LYINFLOG("slot_id = %d",s_module_urc_slot_id);

+        }        

     }

     return RESULT_OK;   

 }

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
index fb7494a..a4e452e 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-data/lynq-qser-data.cpp
@@ -850,6 +850,8 @@
     }
     //check apn_type
     check_node = modify_node;
+    bzero(temp_buff,12);
+    snprintf(temp_buff,sizeof(temp_buff),"%d",(unsigned int)apn->profile_idx);
     while (check_node != NULL)
     {
         if (xmlGetProp(check_node, "profile_idx") == NULL)  //Null Node
@@ -859,6 +861,11 @@
         }
         else if(strcmp((char *)xmlGetProp(check_node, "apn_type"), apn->apn_type) == 0)
         {
+            if(strcmp((char *)xmlGetProp(check_node, "profile_idx"), temp_buff) == 0)
+            {
+                check_node = check_node->next;
+                continue;
+            }
             LYERRLOG("apntype already exists\n");
             goto FAILED;
         }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
index d508438..90a5521 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-gnss/src/mbtk_gnss.cpp
@@ -474,6 +474,7 @@
 {
     int ret = 0;
     int i = 0;
+    int location = 17;
     static struct mopen_location_info_t mopen_location_info;
     static int64_t tmp_time = 0;
     mopen_gnss_nmea_info_t nmea_info;
@@ -513,7 +514,9 @@
     //set system time.
     if (g_gnss_sync_enable_flag == 1 && g_gnss_sync_done == 0)
     {
-        if( strncmp(data+3,NMEA_RMC,strlen(NMEA_RMC)) == 0 && data[17] == 'A')
+        
+        location = (gpio21_value == 0?17:18);
+        if(strncmp(data+3,NMEA_RMC,strlen(NMEA_RMC)) == 0 && data[location] == 'A')
         {
             if (update_system_time(nmea_info.timestamp) == 0)
             {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
index 8aaf524..75ad0a0 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/include/telephony/ril.h
@@ -145,6 +145,17 @@
     RIL_E_POWER_ON_UIM_NOT_READY = 7000,
     // Power on end
     //MTK end
+    RIL_E_SIM_PIN = 9200,
+
+    RIL_E_SIM_PUK,
+
+    RIL_E_SIM_LOCKED,
+
+    RIL_E_SIM_INIT_FAILED,
+
+    RIL_E_SIM_GLOBAL_PIN,
+
+    RIL_E_SIM_GLOBAL_PUK,
 } RIL_Errno;
 
 typedef enum {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
index 8aaf524..75ad0a0 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril.h
@@ -145,6 +145,17 @@
     RIL_E_POWER_ON_UIM_NOT_READY = 7000,
     // Power on end
     //MTK end
+    RIL_E_SIM_PIN = 9200,
+
+    RIL_E_SIM_PUK,
+
+    RIL_E_SIM_LOCKED,
+
+    RIL_E_SIM_INIT_FAILED,
+
+    RIL_E_SIM_GLOBAL_PIN,
+
+    RIL_E_SIM_GLOBAL_PUK,
 } RIL_Errno;
 
 typedef enum {
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
index 3c67eff..bcc55ea 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_sim.c
@@ -1140,9 +1140,16 @@
 			goto exit;
 
 		case 11: //need pin
+			RIL_onRequestComplete(token, RIL_E_SIM_PIN, NULL, 0);
+			goto error;
 		case 12: //need puk
+			RIL_onRequestComplete(token, RIL_E_SIM_PIN, NULL, 0);
+			goto error;
 		case 13: //sim locked
+			RIL_onRequestComplete(token, RIL_E_SIM_LOCKED, NULL, 0);
+			goto error;
 		case 15: //init fail
+			RIL_onRequestComplete(token, RIL_E_SIM_INIT_FAILED, NULL, 0);
 			goto error;
 
 		case 30: //init sucess
@@ -1151,7 +1158,11 @@
 			goto exit;
 
 		case 260: //need global pin
+			RIL_onRequestComplete(token, RIL_E_SIM_GLOBAL_PIN, NULL, 0);
+			goto error;
 		case 261: //need global puk
+			RIL_onRequestComplete(token, RIL_E_SIM_GLOBAL_PUK, NULL, 0);
+			goto error;
 		default:
 			goto error;
 		}
@@ -1159,8 +1170,8 @@
 	}
 
 error:
-	RLOGD("ril_request_radio_reset: failed!");
-	RIL_onRequestComplete(token, RIL_E_GENERIC_FAILURE, NULL, 0);
+	RLOGD("ril_request_simcard_reset: failed!");
+	//RIL_onRequestComplete(token, RIL_E_GENERIC_FAILURE, NULL, 0);
 	updateRadioState();//if at error, we must update radio state
 exit:
 	at_response_free(response);