[datacall]Bug 85777 qser_apn_del 2

Change-Id: Ifb358ce8f8de599cae3a54d478d315e2fa7c64db
diff --git a/mbtk/include/mbtk/mbtk_info_api.h b/mbtk/include/mbtk/mbtk_info_api.h
old mode 100755
new mode 100644
index 7af2d75..caa762a
--- a/mbtk/include/mbtk/mbtk_info_api.h
+++ b/mbtk/include/mbtk/mbtk_info_api.h
@@ -612,6 +612,11 @@
                     const void *user_name, const void *user_pass, const void *auth);
 
 /*
+* Delete apn.
+*/
+int mbtk_apn_del(mbtk_info_handle_t* handle, unsigned char profile_idx);
+
+/*
 * Start data call.
 */
 int mbtk_data_call_start(mbtk_info_handle_t* handle, int cid, int auto_conn_interval, bool boot_conn, int timeout);
diff --git a/mbtk/libmbtk_ril/mbtk_info_api.c b/mbtk/libmbtk_ril/mbtk_info_api.c
old mode 100755
new mode 100644
index e987275..a78fbfa
--- a/mbtk/libmbtk_ril/mbtk_info_api.c
+++ b/mbtk/libmbtk_ril/mbtk_info_api.c
@@ -1223,18 +1223,16 @@
 
 int mbtk_apn_del(mbtk_info_handle_t* handle, unsigned char profile_idx)
 {
-    char profile[2];
-    memset(profile, 0, 2);
-    sprintf(profile, "%s", profile_idx);
     if(handle == NULL)
     {
         LOGE("ARG error.");
         return -1;
     }
-    
-    if(info_item_process(handle, MBTK_INFO_ID_NET_APN_DEL_REQ, profile, strlen(profile), NULL) >= 0) 
+
+    profile_idx++;
+    if(info_item_process(handle, MBTK_INFO_ID_NET_APN_DEL_REQ, &profile_idx, sizeof(profile_idx), NULL) >= 0) 
     {
-        LOG("profile_idx Number : %s", profile);
+        LOG("profile_idx Number : %d", profile_idx);
         return 0;
     } 
     else 
diff --git a/mbtk/mbtk_rild/src/mbtk_info_server.c b/mbtk/mbtk_rild/src/mbtk_info_server.c
old mode 100755
new mode 100644
index 5a2e721..de7721c
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -3419,11 +3419,11 @@
     return err;
 }
 
-static int req_apn_del(char *data, int *cme_err)
+static int req_apn_del(int data, int *cme_err)
 {
     ATResponse *response = NULL;
     char cmd[64]={0};
-    sprintf(cmd, "AT+CGDCONT=%s", data);
+    sprintf(cmd, "AT+CGDCONT=%d", data);
     int err = at_send_command(cmd, &response);
     if (err < 0 || response->success == 0){
         if(cme_err) {
@@ -4989,9 +4989,7 @@
                 }
                 else     
                 {
-                    char profile[2];
-                    memset(profile, 0, 2);
-                    memcpy(profile, pack->data, pack->data_len);
+                    int profile = pack->data[0];
                     if(req_apn_del(profile, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
                     {
                         if(cme_err != MBTK_INFO_ERR_CME_NON) {