[Bugfix][T106][bug-view-617,619]Fix the bug of default bear active/deactive

Only Configure: Yes
Affected branch: all
Affected module: data
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: Id7e5c8af40d99152ae4fb89e410cbb091f562699
diff --git a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/data/data.cpp b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/data/data.cpp
index c6f39fd..d9f9858 100755
--- a/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/data/data.cpp
+++ b/cap/zx297520v3/src/lynq/framework/lynq-ril-service/src/data/data.cpp
@@ -1736,16 +1736,16 @@
             {
                 if(p_cur[i].ifname == NULL)
                 {
-                    RLOGD("ERROR:p_cur[i].ifname is NULL!");
+                    RLOGE("ERROR:p_cur[i].ifname is NULL!");
                     return;
                 }
                 if(p_cur[i].addresses == NULL)
                 {
-                    RLOGD("ERROR:p_cur[i].addresses is NULL!");
+                    RLOGE("ERROR:p_cur[i].addresses is NULL!");
                     return;
                 }
-                RLOGD("lynq_apn_cid_table[j].cid %d and p_cur[i].cid %d", lynq_apn_cid_table[j].cid, p_cur[i].cid);
-                if(lynq_apn_cid_table[j].cid == p_cur[i].cid && lynq_apn_cid_table[j].dialing != 1)
+                RLOGD("lynq_apn_cid_table[j].cid %d and p_cur[i].cid %d, p_cur[i].active %d", lynq_apn_cid_table[j].cid, p_cur[i].cid, p_cur[i].active);
+                if(lynq_apn_cid_table[j].cid == p_cur[i].cid && lynq_apn_cid_table[j].dialing != 1 && p_cur[i].active > 0)
                 {
                     RLOGD("need update");
                     lynq_apn_cid_table[j].dialing = 0;
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
index ba4aaf3..7f08363 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/sdk/ril/reference-ril/ril_ps.c
@@ -443,6 +443,21 @@
 			memset(nv_buf, 0, sizeof(nv_buf));

 			sc_cfg_get("mtu", nv_buf, sizeof(nv_buf));

 			responses[i].mtu = atoi(nv_buf);

+//LYNQ_MODIFY_ZXW_BUG619_CR20250214BF7D062A_XF.Li_20250220_START

+			if (i == 0)

+			{

+				memset(ip_addr_buf, 0, sizeof(ip_addr_buf));

+				memset(ip_addr_buf1, 0, sizeof(ip_addr_buf1));

+				sc_cfg_get("wan1_ip", ip_addr_buf, sizeof(ip_addr_buf) - 1);

+				sc_cfg_get("wan1_ipv6_ip", ip_addr_buf1, sizeof(ip_addr_buf1) - 1);

+				if((0 == strncmp(ip_addr_buf, "", NV_IP_LEN) ||0 == strncmp(ip_addr_buf, "0.0.0.0", NV_IP_LEN))

+				&& ((0 == strncmp(ip_addr_buf1, "", NV_IP_LEN))||(0 == strncmp(ip_addr_buf1, "::", NV_IP_LEN))))

+				{

+					responses[i].active = 0;

+					RLOGE("default bear ZPDPACT deactive");

+				}

+			}

+//LYNQ_MODIFY_ZXW_BUG619_CR20250214BF7D062A_XF.Li_20250220_END

 		}

 	}

 

@@ -950,8 +965,9 @@
 	cmd = atstr + strlen(atstr);

 #ifdef ZXIC_ATCHN_RPMSG_MODE		

 	/*act_typeΪ¼¤»î×éÍøÀàÐÍ£¬0ΪAPºË±¾µØ²¦ºÅ,1ΪCAPºË±¾µØ²¦ºÅ,2ΪĬÈϲ¦ºÅ,Æô¶¯Ä¬ÈÏ·ÓÉ,É豸ËùÓÐÓ¦Óö¼¿ÉÒÔÖ±½ÓÉÏÍø,Ö»Äܲ¥Ò»Â·;*/

-	snprintf(cmd, sizeof(atstr) - strlen(atstr) - 1, ",,,%d\r\n", act_type);

-

+	//LYNQ_MODIFY_ZXW_BUG617_CR20250214BF7D062A_XF.Li_20250220_START

+	snprintf(cmd, sizeof(atstr) - strlen(atstr) - 1, ",,1,%d\r\n", act_type);

+	//LYNQ_MODIFY_ZXW_BUG617_CR20250214BF7D062A_XF.Li_20250220_END

 	memset(str, 0, sizeof(str));

 	if(0 != get_modem_info(atstr, "%s", (void **)p)) {

 		goto error;

@@ -968,9 +984,9 @@
 	}

 #else

 	/*act_typeΪ\BC\A4\BB\EE\D7\E9\CD\F8\C0\E0\D0ͣ\AC0ΪAP\BA˱\BE\B5ز\A6\BA\C5,1ΪCAP\BA˱\BE\B5ز\A6\BA\C5,2ΪĬ\C8ϲ\A6\BA\C5,\C6\F4\B6\AFĬ\C8\CF·\D3\C9,\C9豸\CB\F9\D3\D0Ӧ\D3ö\BC\BF\C9\D2\D4ֱ\BD\D3\C9\CF\CD\F8,ֻ\C4ܲ\A5һ·;*/

-	//xf.li@20240111 modify for T106BUG-480 start

+	//LYNQ_MODIFY_ZXW_BUG617_CR20250214BF7D062A_XF.Li_20250220_START

 	snprintf(cmd, sizeof(atstr) - strlen(atstr) - 1, ",,1,%d", act_type);

-	//xf.li@20240111 modify for T106BUG-480 end

+	//LYNQ_MODIFY_ZXW_BUG617_CR20250214BF7D062A_XF.Li_20250220_END

 	err = at_send_command_singleline_timeout(atstr, "+ZPDPACT:", &p_response, TIMEOUT_ZPDPACT);

 	if (err < 0 || (p_response->success == 0)) {

 		RLOGE("requestSetupDataCall err:%d", err);