Fix auto data call for ril v2
Change-Id: I582bfd230b9d8914b8376f76c46d2d9930e1d274
diff --git a/mbtk/mbtk_rild_v2/inc/ril_info.h b/mbtk/mbtk_rild_v2/inc/ril_info.h
index 6dcf807..9db80c6 100755
--- a/mbtk/mbtk_rild_v2/inc/ril_info.h
+++ b/mbtk/mbtk_rild_v2/inc/ril_info.h
@@ -117,6 +117,7 @@
typedef struct {
bool valid;
+ bool manual_call;
mbtk_apn_info_t apn_info;
ril_act_state_enum act_state;
} ril_data_call_info_t;
diff --git a/mbtk/mbtk_rild_v2/src/ril_data_call.c b/mbtk/mbtk_rild_v2/src/ril_data_call.c
index bdf483b..c4b5a78 100755
--- a/mbtk/mbtk_rild_v2/src/ril_data_call.c
+++ b/mbtk/mbtk_rild_v2/src/ril_data_call.c
@@ -15,7 +15,7 @@
-------- -------- -------------------------------------------------------
2024/10/10 LiuBin Initial version
2024/11/13 LiuBin Add auto data call while network changed.
- Fix apn change for same name.
+2024/12/31 LiuBin Fix apn change for same name.
Disable deactivate default APN.
@@ -343,6 +343,7 @@
// Update apn info in buffer.
int cid = apns.apns[i].cid;
info_list[cid - 1].valid = true;
+ info_list[cid - 1].manual_call = false;
// info_list[cid - 1].act_state = RIL_ACT_STATE_DISCONNECTED;
memcpy(&(info_list[cid - 1].apn_info), &(apns.apns[i]), sizeof(mbtk_apn_info_t));
@@ -901,7 +902,7 @@
LOGV("cid - %d, valid - %d, act_state - %d", cid, info_list[cid - 1].valid,
info_list[cid - 1].act_state);
if(info_list[cid - 1].valid &&
- (info_list[cid - 1].act_state == RIL_ACT_STATE_CONNECTED_RETRY
+ ((info_list[cid - 1].manual_call && info_list[cid - 1].act_state == RIL_ACT_STATE_CONNECTED_RETRY)
|| info_list[cid - 1].apn_info.auto_boot_call)) { // Auto data call when boot.
memset(&pdp_info, 0, sizeof(mbtk_ril_pdp_state_info_t));
pdp_info.action = TRUE;
@@ -1194,6 +1195,7 @@
goto exit;
}
+ info_list[cid - 1].manual_call = true;
exit:
at_response_free(response);
return err;
@@ -1230,6 +1232,7 @@
goto exit;
}
+ info_list[cid - 1].manual_call = false;
exit:
at_response_free(response);
return err;