[datacall]Bug 85777 qser_apn_del

Change-Id: I3013d46fdf8ee42bb320f267667f90f4184ae840
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 47c5ba7..5fca1ea
--- a/mbtk/mbtk_rild/src/mbtk_info_server.c
+++ b/mbtk/mbtk_rild/src/mbtk_info_server.c
@@ -3417,6 +3417,25 @@
     return err;
 }
 
+static int req_apn_del(char *data, int *cme_err)
+{
+    ATResponse *response = NULL;
+    char cmd[64]={0};
+    sprintf(cmd, "AT+CGDCONT=%s", data);
+    int err = at_send_command(cmd, &response);
+    if (err < 0 || response->success == 0){
+        if(cme_err) {
+            *cme_err = at_get_cme_error(response);
+        }
+        goto exit;
+    }
+
+exit:
+    at_response_free(response);
+    return err;
+}
+
+
 int wait_cgact_complete(int timeout)
 {
     int count = timeout * 10; // timeout * 1000 / 100
@@ -4959,6 +4978,34 @@
                 }
                 break;
             }
+            case MBTK_INFO_ID_NET_APN_DEL_REQ:   
+            {
+                if(pack->data_len == 0 || pack->data == NULL)  
+                {
+                    err = MBTK_INFO_ERR_UNSUPPORTED;
+                    LOG("Unsupported delete apn .");
+                }
+                else     
+                {
+                    char profile[2];
+                    memset(profile, 0, 2);
+                    memcpy(profile, pack->data, pack->data_len);
+                    if(req_apn_del(profile, &cme_err) || cme_err != MBTK_INFO_ERR_CME_NON)
+                    {
+                        if(cme_err != MBTK_INFO_ERR_CME_NON) {
+                            err = MBTK_INFO_ERR_CME + cme_err;
+                        } else {
+                            err = MBTK_INFO_ERR_UNKNOWN;
+                        }
+                        LOG("Delete apn fail.");
+                    }
+                    else
+                    {
+                        pack_rsp_send(cli_info->fd, MBTK_INFO_ID_NET_APN_DEL_RSP, NULL, 0);
+                    }
+                }
+                break;
+            }
             case MBTK_INFO_ID_NET_DATA_CALL_REQ:
             {
                 if(pack->data_len == 0 || pack->data == NULL)