[Feature][T8TSK-136][AT]About synchronizing the upgrade of the at data module

Change-Id: I831939a09d0eff12b5c1e6e374e14da2b778eb3f
diff --git a/framework/lynq-ril-service/src/atci/atci_lynq_data_cmd.cpp b/framework/lynq-ril-service/src/atci/atci_lynq_data_cmd.cpp
index 38c62da..f8fb405 100755
--- a/framework/lynq-ril-service/src/atci/atci_lynq_data_cmd.cpp
+++ b/framework/lynq-ril-service/src/atci/atci_lynq_data_cmd.cpp
@@ -16,6 +16,7 @@
 #include "atci_at_util.h"
 #include "atci_lynq_data_cmd.h"
 #include "atci_common.h"
+#include "lynq_common.h"
 
 #undef LOG_TAG
 #define LOG_TAG "DEMO_ATCI_DATA"
@@ -49,17 +50,17 @@
 
             if (SYS_FAIL == atci_at_to_equal(&cmd))
             {
-              //input error
-              return SYS_FAIL;
-              break;
+                //input error
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
+                return SYS_FAIL;
             }
             RLOGD("[%d][%s] data is[%s]",LINE,FUNC,cmd);
             int state;
 
             if (SYS_FAIL == atci_at_get_nexthexint(&cmd, &state))
             {
-              return SYS_FAIL;
-              break;
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
+                return SYS_FAIL;
             }
 
             RLOGD("state value is %d", state);
@@ -77,9 +78,10 @@
             }
             else
             {
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                 return SYS_FAIL;
             }
-            RLOGD("input req data");
+            
 
             char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
             memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
@@ -96,6 +98,7 @@
             memset(buf,0,sizeof(buf));
             sprintf(buf,"%s","+LAPNACT: (0,1)");
             ATCIResponseNoToken(0,buf,RIL_REQUEST_SETUP_DATA_CALL);
+            break;
         }
         default:
         {
@@ -111,7 +114,7 @@
     int ret;
     int argc = 0;
     char* argv[8] = { 0 };
-    char buf[128];
+    char buf[512];
     char authTypebuf[16] = {0};
     int state = 0;
     int authType = 0;
@@ -133,12 +136,14 @@
             if (SYS_FAIL == atci_at_to_equal(&cmd))
             {
               //input error
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                 return SYS_FAIL;
             }
             RLOGD("[%d][%s] data is[%s]",LINE,FUNC,cmd);
 
             if (SYS_FAIL == atci_at_get_nexthexint(&cmd, &state))
             {
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                 return SYS_FAIL;
             }
             RLOGD("state value is %d", state);
@@ -146,36 +151,43 @@
             {
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &apn))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("apn value is %s", apn);
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &apnTpye))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("apnTpye value is %s", apnTpye);
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &user))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("user value is %s", user);
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &password))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("pwd value is %s", password);
                 if (SYS_FAIL == atci_at_get_nexthexint(&cmd, &authType))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("authType value is %d", authType);
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &apnprotocol))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("apnprotocol value is %s", apnprotocol);
                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &apnRoamProtocol))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("apnRoamProtocol value is %s", apnRoamProtocol);
@@ -191,8 +203,9 @@
             }
             else if(state == 0)
             {
-                 if (SYS_FAIL == atci_at_get_next_key(&cmd, &apnTpye))
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &apnTpye))
                 {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                     return SYS_FAIL;
                 }
                 RLOGD("apnTpye value is %s", apnTpye);
@@ -211,9 +224,10 @@
             }
             else
             {
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_SETUP_DATA_CALL);
                 return SYS_FAIL;
             }
-            RLOGD("input req data");
+            
 
             char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
             memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
@@ -228,6 +242,22 @@
             memset(buf,0,sizeof(buf));
             sprintf(buf,"%s","+ELAPNACT: (0,1),"","","","",(0-3),(\"null\",\"IPV4\",\"IPV6\",\"IPV4V6\"),(\"null\",\"IPV4\",\"IPV6\",\"IPV4V6\")");
             ATCIResponseNoToken(0,buf,RIL_REQUEST_SETUP_DATA_CALL);
+            break;
+        }
+        case AT_READ_MODE:
+        {
+            for(int i = 0;i < apn_count; i ++)
+            {
+                memset(buf,0,sizeof(buf));
+                sprintf(buf,"+ELAPNACT:%s,%s,%d,%s,%s\n", apn_table[i].apn, apn_table[i].apntype ,apn_table[i].pdpstate, apn_table[i].ifaceName, apn_table[i].address);
+                ATCIResponseNoToken(0,buf,RIL_REQUEST_SETUP_DATA_CALL);
+            }
+            if(apn_count == 0)
+            {
+                memset(buf,0,sizeof(buf));
+                ATCIResponseNoToken(0,buf,RIL_REQUEST_SETUP_DATA_CALL);
+            }
+            break;
         }
         default:
         {
@@ -238,8 +268,311 @@
     return SYS_SUCC;
 }
 
+static int insert_apn_char(char *agc, char *id,char *mcc, char *mnc, char *apn, char *apntype, char *user, char *password, char *normalprotocol, char *roamingprotocol, char *carrier)
+{
+    char strtmp[10][64];
+    if (!strcmp(id,"null"))
+    {
+        sprintf(strtmp[0], "id=;");
+    }
+    else
+    {
+        sprintf(strtmp[0], "id=%s;", id);
+    }
+    if (!strcmp(mcc,"null"))
+    {
+        char mcc[8] = {0};
+        if(strlen(mccmnc))
+        {
+            strncpy(mcc, mccmnc, 3);
+            sprintf(strtmp[1], "mcc=%s;", mcc);
+        }
+        else
+        {
+            sprintf(strtmp[2], "mcc=;");
+        }
+    }
+    else
+    {
+        sprintf(strtmp[1], "mcc=%s;", mcc);
+    }
+    if (!strcmp(mnc,"null"))
+    {
+        if(strlen(mccmnc))
+        {
+            sprintf(strtmp[2], "mnc=%s;", mccmnc+3);
+        }
+        else
+        {
+            sprintf(strtmp[2], "mnc=;");
+        }
+    }
+    else
+    {
+        sprintf(strtmp[2], "mnc=%s;", mnc);
+    }
+    if (!strcmp(apn,"null"))
+    {
+        sprintf(strtmp[3], "apn=;");
+    }
+    else
+    {
+        sprintf(strtmp[3], "apn=%s;", apn);
+    }
+    if (!strcmp(apntype,"null"))
+    {
+        sprintf(strtmp[4], "apntype=;");
+    }
+    else
+    {
+        sprintf(strtmp[4], "type=%s;", apntype);
+    }
+    if (!strcmp(user,"null"))
+    {
+        sprintf(strtmp[5], "user=;");
+    }
+    else
+    {
+        sprintf(strtmp[5], "user=%s;", user);
+    }
+    if (!strcmp(password,"null"))
+    {
+        sprintf(strtmp[6], "password=;");
+    }
+    else
+    {
+        sprintf(strtmp[6], "password=%s;", password);
+    }
+    if (!strcmp(normalprotocol,"null"))
+    {
+        sprintf(strtmp[7], "protocol=;");
+    }
+    else
+    {
+        sprintf(strtmp[7], "normalprotocol=%s;", normalprotocol);
+    }
+    if (!strcmp(roamingprotocol,"null"))
+    {
+        sprintf(strtmp[8], "roamingprotocol=;");
+    }
+    else
+    {
+        sprintf(strtmp[8], "roamingprotocol=%s;", roamingprotocol);
+    }
+    if (!strcmp(carrier,"null"))
+    {
+        sprintf(strtmp[9], "carrier=;");
+    }
+    else
+    {
+        sprintf(strtmp[9], "carrier=%s;", carrier);
+    }
+    sprintf(agc, "%s%s%s%s%s%s%s%s%s%s",strtmp[0], strtmp[1], strtmp[2], strtmp[3], strtmp[4], strtmp[5], strtmp[6], strtmp[7], strtmp[8], strtmp[9]);
+    return 0;
+}
+
 int atci_data_modify_apn_hdlr(char *cmd, int op_mode, int target, char *response)
 {
+    char *id  = NULL;
+    char *mcc = NULL;
+    char *mnc = NULL;
+    char *apn = NULL;
+    char *apntype = NULL;
+    char *user = NULL;
+    char *password = NULL;
+    char *normalprotocol = NULL;
+    char *roamingprotocol = NULL;
+    char *carrier = NULL;
+    int state = -1;
+    char apn_info[512];
+    char* argv[3] = { 0 };
+    int argc = 0;
+    switch (op_mode)
+    {
+        case AT_SET_MODE:
+        {
+            RLOGD("input cmd[%s]", cmd);
+            if (SYS_FAIL == atci_at_to_equal(&cmd))
+            {
+                //input error
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                return SYS_FAIL;
+            }
+            RLOGD("[%d][%s] data is[%s]",LINE,FUNC,cmd);
+            if (SYS_FAIL == atci_at_get_nexthexint(&cmd, &state))
+            {
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                return SYS_FAIL;
+            }
+            RLOGD("state value is %d", state);
+            if (SYS_FAIL == atci_at_get_next_key(&cmd, &id))
+            {
+                ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                return SYS_FAIL;
+            }
+            if(state == 0)
+            {
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &mcc))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &mnc))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &apn))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &apntype))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &user))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &password))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &normalprotocol))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &roamingprotocol))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &carrier))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                /*get mccmnc*/
+                lynq_req_mccmnc(666);
+                usleep(500*1000);
+                /*get mccmnc*/
+                insert_apn_char(apn_info, id, mcc, mnc, apn, apntype, user, password, normalprotocol, roamingprotocol, carrier);
+                argv[1] = "0";
+                argv[2] = apn_info;
+                RLOGD("apn_info %s\n", apn_info);
+                atci_data_req_t req;
+                req.request_id = RIL_REQUEST_MODIFY_APN;
+                char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
+                memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
+                RLOGD("request is %s", reqStr);
+                argv[0] = reqStr;
+                argc = 3;
+                sendAtciRequest(req.request_id, reqStr, argc, argv);
+            }
+            else if (state == 1)
+            {
+                sprintf(apn_info, "id=%s", id);
+                argv[1] = "1";
+                argv[2] = apn_info;
+                atci_data_req_t req;
+                req.request_id = RIL_REQUEST_MODIFY_APN;
+                char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
+                memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
+                RLOGD("request is %s", reqStr);
+                argv[0] = reqStr;
+                argc = 3;
+                sendAtciRequest(req.request_id, reqStr, argc, argv);
+            }
+            else if (state == 2)
+            {
+                sprintf(apn_info, "id=%s", id);
+                argv[1] = "2";
+                argv[2] = apn_info;
+                atci_data_req_t req;
+                req.request_id = RIL_REQUEST_MODIFY_APN;
+                char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
+                memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
+                RLOGD("request is %s", reqStr);
+                argv[0] = reqStr;
+                argc = 3;
+                sendAtciRequest(req.request_id, reqStr, argc, argv);
+            }
+            else if (state == 3)
+            {
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &mcc))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &mnc))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &apn))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &apntype))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &user))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &password))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &normalprotocol))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &roamingprotocol))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                if (SYS_FAIL == atci_at_get_next_key(&cmd, &carrier))
+                {
+                    ATCIResponseNoToken(100,NULL,RIL_REQUEST_MODIFY_APN);
+                    return SYS_FAIL;
+                }
+                insert_apn_char(apn_info, id, mcc, mnc, apn, apntype, user, password, normalprotocol, roamingprotocol, carrier);
+                argv[1] = "3";
+                argv[2] = apn_info;
+                atci_data_req_t req;
+                req.request_id = RIL_REQUEST_MODIFY_APN;
+                char reqStr[RIL_REQUEST_STRING_LENGTH] = {0};
+                memcpy(reqStr, request2RILStr(req.request_id),strlen(request2RILStr(req.request_id)) + 1);
+                RLOGD("request is %s", reqStr);
+                argv[0] = reqStr;
+                argc = 3;
+                sendAtciRequest(req.request_id, reqStr, argc, argv);
+            }
+            else
+            {
+                RLOGD("function %s line %d unknow command", __FUNCTION__, __LINE__);
+            }
+            break;
+        }
+        default:
+        {
+            break;
+        }
+       
+    }
     return SYS_SUCC;
 }
 
diff --git a/framework/lynq-ril-service/src/atci/atci_util.cpp b/framework/lynq-ril-service/src/atci/atci_util.cpp
index 137d4a9..0cc6d9a 100755
--- a/framework/lynq-ril-service/src/atci/atci_util.cpp
+++ b/framework/lynq-ril-service/src/atci/atci_util.cpp
@@ -80,6 +80,10 @@
     return "RIL_REQUEST_DEACTIVATE_DATA_CALL";
   case RIL_REQUEST_SETUP_DATA_CALL:
     return "RIL_REQUEST_SETUP_DATA_CALL";
+  case RIL_REQUEST_MODIFY_APN:
+    return "RIL_REQUEST_MODIFY_APN";
+  case RIL_REQUEST_OPERATOR:
+    return "RIL_REQUEST_OPERATOR";
   default:
     return "unknown define";
   }
diff --git a/framework/lynq-ril-service/src/data/data_gdbus.cpp b/framework/lynq-ril-service/src/data/data_gdbus.cpp
index 03b43dd..10dd452 100755
--- a/framework/lynq-ril-service/src/data/data_gdbus.cpp
+++ b/framework/lynq-ril-service/src/data/data_gdbus.cpp
@@ -48,6 +48,10 @@
 #include "lynq_common.h"
 #include "lynq_interface.h"
 #include <binder/Parcel.h>
+#include "ATCI.h"
+#ifdef LED_SUPPORT
+#include "led.h"
+#endif
 using android::Parcel;
 
 /*Warren add for t800 ril service 2021/12/25 end*/
@@ -90,11 +94,11 @@
 {
     if(pdnState==PDN_CONNECTED)
     {
-        lynq_output_info("+LAPNST:%s,%s,%d,%s,%s\n",apn,apntype,pdnState,ifname,addresses);
+        printf("+LAPNST:%s,%s,%d,%s,%s\n",apn,apntype,pdnState,ifname,addresses);
     }
     else
     {
-        lynq_output_info("+LAPNST:%s,%s,%d\n",apn,apntype,pdnState);
+        printf("+LAPNST:%s,%s,%d\n",apn,apntype,pdnState);
     }
     return 0;
 }
@@ -121,7 +125,7 @@
             for(int i = 0;i < LYNQ_APN_CHANNEL_MAX;i++)
             {
                 #if DEBUG
-                lynq_output_info("line %d [PDN_DISCONNECTED]apn_table[%d],apntype:%s,apnstatus:%d,,,urc_response->apnName:%s\n",__LINE__, i,apn_table[i].apntype,apn_table[i].apnstatus,urc_response->apnType);
+                printf("line %d [PDN_DISCONNECTED]apn_table[%d],apntype:%s,apnstatus:%d,,,urc_response->apnName:%s\n",__LINE__, i,apn_table[i].apntype,apn_table[i].apnstatus,urc_response->apnType);
                 #endif
                 RLOGD("[PDN_DISCONNECTED]apn_table[%d],apntype:%s,apnstatus:%d,,,urc_response->apnName:%s\n",i,apn_table[i].apntype,apn_table[i].apnstatus,urc_response->apnType);
                 if((strcmp(apn_table[i].apntype,urc_response->apnType)==0)&&(apn_table[i].apnstatus==0))
@@ -132,7 +136,7 @@
                     apn_table[i].netId = 0;
                     apn_table[i].pdpstate = PDN_DISCONNECTED;
                     apn_count--;
-                    lynq_output_info("\nOK\n");
+                    printf("\nOK\n");
                     p.writeInt32 (1);
                     p.writeInt32 (LYNQ_URC_DATA_CALL_STATUS_IND);
                     p.writeInt32 (0);//temporary plan
@@ -164,7 +168,7 @@
                 memcpy(apn_table[apn_count].address,urc_response->addresses,strlen(urc_response->addresses)+1);
                 apn_table[apn_count].pdpstate = urc_response->pdnState;
                 #if DEBUG
-                lynq_output_info("line %d apn_table[%d].apn:%s,apntype:%s,,,urc_response->apnName:%s,urc_response->apntype:%s\n",__LINE__,apn_count,apn_table[apn_count].apn,apn_table[apn_count].apntype,urc_response->apnName,urc_response->apnType);
+                printf("line %d apn_table[%d].apn:%s,apntype:%s,,,urc_response->apnName:%s,urc_response->apntype:%s\n",__LINE__,apn_count,apn_table[apn_count].apn,apn_table[apn_count].apntype,urc_response->apnName,urc_response->apnType);
                 #endif
                 RLOGD("apn_table[%d].apn:%s,apntype:%s,,,urc_response->apnName:%s,urc_response->apntype:%s\n",apn_count,apn_table[apn_count].apn,apn_table[apn_count].apntype,urc_response->apnName,urc_response->apnType);
                 apn_table[apn_count].apnstatus=1;
@@ -186,20 +190,20 @@
                 for(int i = 0;i < LYNQ_APN_CHANNEL_MAX;i++)//means apn state changed,need update
                 {
                     #if DEBUG
-                    lynq_output_info("line %d for apn_table[%d].apn:%s,,,,urc_response->apnName:%s\n",__LINE__,i,apn_table[i].apn,urc_response->apnName);
+                    printf("line %d for apn_table[%d].apn:%s,,,,urc_response->apnName:%s\n",__LINE__,i,apn_table[i].apn,urc_response->apnName);
                     #endif
                     RLOGD("for apn_table[%d].apn:%s,,,,urc_response->apnName:%s\n",i,apn_table[i].apn,urc_response->apnName);
                     if(strcmp(apn_table[i].apn,urc_response->apnName)==0)
                     {
                         #if DEBUG
-                        lynq_output_info("line %d This apn has been created update???!!!\n",__LINE__);
+                        printf("line %d This apn has been created update???!!!\n",__LINE__);
                         #endif
                         RLOGD("This apn has been created!!!");
                         apnHasCreated = TRUE;
                         if(apn_table[i].netId!=urc_response->netId)
                         {
                             #if DEBUG
-                            lynq_output_info("update???\n");
+                            printf("update???\n");
                             #endif
                             apn_table[i].netId = urc_response->netId;
                             apn_table[i].pdpstate = urc_response->pdnState;
@@ -239,7 +243,7 @@
                     if(getLable)
                     {
                         #if DEBUG
-                        lynq_output_info("line %d Multiple APNs are established\n", __LINE__);
+                        printf("line %d Multiple APNs are established\n", __LINE__);
                         #endif
                         RLOGD("[getLable]:label==%d\n",lable);
                         memcpy(apn_table[lable].apn,urc_response->apnName,strlen(urc_response->apnName)+1);
@@ -280,7 +284,7 @@
             for(i;i < LYNQ_APN_CHANNEL_MAX;i++)
             {
                 #if DEBUG
-                lynq_output_info("line %d don't know\n", __LINE__);
+                printf("line %d don't know\n", __LINE__);
                 #endif
                 RLOGD("[cid<0]apn_table[%d].apntype:%s,,,,urc_response->apntype:%s\n",i,apn_table[i].apntype,urc_response->apnType);
                 if(strcmp(apn_table[i].apntype,urc_response->apnType)==0)
@@ -293,7 +297,7 @@
             if(apnHasCreated)
             {
                 #if DEBUG
-                lynq_output_info("line %d don't know\n", __LINE__);
+                printf("line %d don't know\n", __LINE__);
                 #endif
                 apn_table[i].pdpstate = urc_response->pdnState;
                 char ptr[1] = "";
@@ -438,9 +442,11 @@
     RLOGD("modifyApnDB_method_cb reason %s", ((reason == NULL)? "":reason));
     printf("modify apn db success, return message: %s\n", ((reason == NULL)? "":reason));
     //printf("modifyApnDB_method_cb reason %s\n", ((reason == NULL)? "":reason));
-    /*lei add for at+lmdapn*/
-    lynq_output_info("+LEAPNMOD:%s\n", ((reason == NULL)? "":reason));
-    /*lei add for at+lmdapn*/
+    /*lei add for AT+LEAPNMOD*/
+    char apn_buf[1024];
+    sprintf(apn_buf, "+LEAPNMOD:%s", ((reason == NULL)? "":reason));
+    ATCIResponseNoToken(0, apn_buf, 666);//tmp plan
+    /*lei add for AT+LEAPNMOD*/
     g_variant_unref(result);
     lynq_data_modify_apn(reason,LYNQ_URC_MODIFY_APNDB);
 }
diff --git a/framework/lynq-ril-service/src/lynq_common.cpp b/framework/lynq-ril-service/src/lynq_common.cpp
index 72092cc..418fe86 100755
--- a/framework/lynq-ril-service/src/lynq_common.cpp
+++ b/framework/lynq-ril-service/src/lynq_common.cpp
@@ -620,7 +620,7 @@
     return 0;
 }
 
-static void lynq_req_mccmnc(int uToken)
+void lynq_req_mccmnc(int uToken)
 {
     char *new_argv[10] = {};
     new_argv[0] = "RIL_REQUEST_OPERATOR";
diff --git a/framework/lynq-ril-service/src/lynq_common.h b/framework/lynq-ril-service/src/lynq_common.h
index 061bff7..ec1e9e2 100755
--- a/framework/lynq-ril-service/src/lynq_common.h
+++ b/framework/lynq-ril-service/src/lynq_common.h
@@ -104,7 +104,7 @@
 int transferAtToRequest(char *cmd);
 //argv[2]:0 send,1 list,2 get
 int lynqParseUsbCommand(const char* cmd,char *argv[],char test[],char* parser_buf,int maxArgc);
-
+void lynq_req_mccmnc(int uToken);
 int routeCmd(int request);
 
 int CGMI(int argc,char*argv[],char *rilReq, int uToken);
diff --git a/framework/lynq-ril-service/src/ril.cpp b/framework/lynq-ril-service/src/ril.cpp
index ffd80d8..12a9c99 100755
--- a/framework/lynq-ril-service/src/ril.cpp
+++ b/framework/lynq-ril-service/src/ril.cpp
@@ -6889,14 +6889,19 @@
     } else {
         pRI->pCI = find_mtk_command(request);
     }
+    /*lei modify for Some requests that are not in the ril_commands.h and mtk_ril_commands.h but in commands.h*/
+    COMMAND *command = find_command(reqString);
     if(pRI->pCI == NULL){
-        RLOGE("pCI command not found!");
-        if(pRI) {
-            free(pRI);
+        if(command == NULL)
+        {
+            RLOGE("pCI command & command not found!");
+            if(pRI) {
+                free(pRI);
+            }
+            return;
         }
-        return;
     }
-
+    /*lei modify for Some requests that are not in the ril_commands.h and mtk_ril_commands.h but in commands.h*/
     if(utils::is_suppport_dsss()){
         pRI->socket_id = (RIL_SOCKET_ID)Phone_utils::get_enable_sim_for_dsss();
     }
@@ -6907,8 +6912,8 @@
 
     pRI->p_next = NULL;
 
-    COMMAND *command = find_command(reqString);
-
+    
+    RLOGD("function %s line %d reqString %s", __FUNCTION__, __LINE__, reqString);
     if(command == NULL) {
         RLOGE("ATCI request command find error!");
         if(pRI) {