add data call auto reconnect for v2

Change-Id: Ib334d46c343abed5d232ed66c5805322ed675208
diff --git a/mbtk/mbtk_rild_v2/src/main.c b/mbtk/mbtk_rild_v2/src/main.c
index e2020fc..939585f 100755
--- a/mbtk/mbtk_rild_v2/src/main.c
+++ b/mbtk/mbtk_rild_v2/src/main.c
@@ -70,6 +70,8 @@
 mbtk_ril_err_enum sms_pack_req_process(sock_cli_info_t* cli_info, ril_msg_pack_info_t* pack);

 mbtk_ril_err_enum ecall_pack_req_process(sock_cli_info_t* cli_info, ril_msg_pack_info_t* pack);

 

+void data_call_retry(mbtk_ril_net_reg_state_info_t *reg_state);

+

 void data_call_state_change_cb(int cid, bool action, bool auto_change, int reason);

 static int send_pack_to_queue(sock_cli_info_t* cli_info, void* pack);

 

@@ -686,7 +688,8 @@
         mbtk_net_ready();

     }

 

-    urc_msg_distribute(false, RIL_MSG_ID_IND_NET_REG_STATE_CHANGE, &state, sizeof(mbtk_ril_net_reg_state_info_t));

+    // Should restart data call if necessary.

+    urc_msg_distribute(true, RIL_MSG_ID_IND_NET_REG_STATE_CHANGE, &state, sizeof(mbtk_ril_net_reg_state_info_t));

 CGREG_EXIT:

     free(tmp_s);

 }

@@ -799,8 +802,8 @@
 

         LOGD("+CGEV:cid - %d, act - %d, auto_change - %d, reason - %d", cgev_info.cid, cgev_info.action,

             cgev_info.auto_change, cgev_info.reason);

-

         if(cgev_info.cid >= MBTK_APN_CID_MIN && cgev_info.cid <= MBTK_APN_CID_MAX) {

+            data_call_state_change_cb(cgev_info.cid, cgev_info.action, cgev_info.auto_change, cgev_info.reason);

             urc_msg_distribute(false, RIL_MSG_ID_IND_PDP_STATE_CHANGE, &cgev_info, sizeof(mbtk_ril_pdp_state_info_t));

         }

 

@@ -2186,6 +2189,12 @@
             LOGD("Radio state : %d", state->radio_state);

             break;
         }

+        case RIL_MSG_ID_IND_NET_REG_STATE_CHANGE:

+        {

+            mbtk_ril_net_reg_state_info_t *reg_state = (mbtk_ril_net_reg_state_info_t*)msg->data;

+            data_call_retry(reg_state);

+            break;

+        }

         default:
         {
             LOGE("Unknown URC : %d", msg->msg);