Merge "[Bugfix][T106BUG-54] add this code because p54u02 delete it"
diff --git a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
index ef42c51..2438963 100755
--- a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
+++ b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
@@ -147,8 +147,8 @@
 		mnet_whitelist_add(single_cmd);

 		memset(single_cmd, 0, sizeof(single_cmd));

 	}

-	sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);

-	sc_cfg_save();

+	//sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);jb.qi add for nv wakeup when no network on 20231229

+	//sc_cfg_save();jb.qi add for nv wakeup when no network on 20231229

 	return;

 }

 

@@ -177,8 +177,8 @@
 		mnet_whitelist_del(single_cmd);

 		memset(single_cmd, 0, sizeof(single_cmd));

 	}

-	sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);

-	sc_cfg_save();

+	//sc_cfg_set("customIndCmdList", PsmIndAtCmdPrefix);jb.qi add for nv wakeup when no network on 20231229

+	//sc_cfg_save();jb.qi add for nv wakeup when no network on 20231229

 	return;

 }

 

diff --git a/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c b/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
index b27a915..77fb3b1 100755
--- a/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
+++ b/ap/app/zte_comm/zte_drv_ctrl/usb/zte_drv_usb_ctrl.c
@@ -1820,7 +1820,74 @@
     return 0;

 }

 

+/*jb.qi add for usb wakelock on 20230918 start*/

+#define RPMSG_IOC_MAGIC     'R'

 

+/*ioctl cmd usd by device*/

+#define RPMSG_CREATE_CHANNEL          _IOW(RPMSG_IOC_MAGIC, 1, char *)

+#define RPMSG_GET_DATASIZE       _IOWR(RPMSG_IOC_MAGIC, 2, char *)

+#define RPMSG_SET_INT            _IOW(RPMSG_IOC_MAGIC, 3, char *)

+#define RPMSG_SET_INT_FLAG        _IOW(RPMSG_IOC_MAGIC, 4, char *)

+#define RPMSG_CLEAR_INT_FLAG      _IOW(RPMSG_IOC_MAGIC, 5, char *)

+#define RPMSG_SET_POLL_FLAG       _IOW(RPMSG_IOC_MAGIC, 6, char *)

+#define RPMSG_CLEAR_POLL_FLAG     _IOW(RPMSG_IOC_MAGIC, 7, char *)

+

+#define USB_PLUG_WAKE_CAP_DEV    "/dev/rpmsg50"

+

+int usbplug_fd = -1;

+

+int usbplug_icp_init(void)

+{

+    usbplug_fd = open(USB_PLUG_WAKE_CAP_DEV, O_RDWR);

+

+    if(0 > usbplug_fd){

+        printf("%s: open the channel(%s) error!\n", __func__, USB_PLUG_WAKE_CAP_DEV);

+        return -1;

+    }

+

+    if(0 > ioctl(usbplug_fd, RPMSG_CREATE_CHANNEL, 64)){

+        printf("%s: ioctl RPMSG_CREATE_CHANNEL fail!\n", __func__);

+        close(usbplug_fd);

+        usbplug_fd = -1;

+        return -1;

+    }

+

+    if(0 > ioctl(usbplug_fd, RPMSG_SET_INT_FLAG, NULL)){ //¿¿¿

+        printf("%s: ioctl RPMSG_SET_INT_FLAG fail!\n", __func__);

+        close(usbplug_fd);

+        usbplug_fd = -1;

+        return -1;

+    }

+

+    printf("yanming %s create success!\n",__func__);

+

+    return 0;

+}

+

+int usbplug_rpmsg_send(int value)

+{

+    int write_len = 0;

+    char usbplug_in[20]="usbplug_in";

+    char usbplug_out[20]="usbplug_out";

+

+    printf("usbplug_rpmsg_send value:%d\n",value);

+

+    if(value == 1){

+        write_len = write(usbplug_fd, usbplug_in, sizeof(usbplug_in));

+    }

+

+    if(value == 0){

+        write_len = write(usbplug_fd, usbplug_out, sizeof(usbplug_out));

+    }

+

+    if(write_len <0){

+        printf("usbplug rpmsg write FAIL\n");

+        close(usbplug_fd);

+    }

+

+    return write_len;

+}

+/*jb.qi add for usb wakelock on 20230918 end*/

 /*usbÈȰβåʼþ´¦Àí*/

 int usb_event_proc(unsigned short usb_msg, int usb_event)

 {

@@ -1853,6 +1920,7 @@
         {

             slog(USBCFGMNG_PRINT,SLOG_NORMAL, "[usbCfgMng] usb charger plugin \n");

         }

+	usbplug_rpmsg_send(1);//jb.qi add for usb wakelock on 20230918

         break;

     case MSG_CMD_DRV_USB_REMOVE:

         /*°Î³öʼþ´¦Àí*/

@@ -1870,6 +1938,7 @@
         {

             slog(USBCFGMNG_PRINT,SLOG_NORMAL, "[usbCfgMng] usb charger plugOut \n");

         }

+	usbplug_rpmsg_send(0);//jb.qi add for usb wakelock on 20230918

         break;

     default:

         break;

@@ -2023,6 +2092,15 @@
         slog(USBCFGMNG_PRINT,SLOG_ERR, "[usbCfgMng] warning: readfile %s fail \n", USB_PLUG_FILE_NAME);

         return -1;

     }

+    /*jb.qi add for usb wakelock on 20230918 start*/

+    printf("usbPlugtype:%d\n",usbPlugtype);

+    if(usbPlugtype == 1)

+	sc_cfg_set("usbplug_nv","1");

+   

+    if(usbPlugtype == 0)

+	sc_cfg_set("usbplug_nv","0");

+    usbplug_icp_init();

+    /*jb.qi add for usb wakelock on 20230918 end*/

     usb_usbCfgMngInit(usbPlugtype);

     if (usbPlugtype == 1 && cp_need_udisk == 1)

 		usb_sendUsbOperateRlt(2);

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
index 2f48049..45bfa6b 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/liblynq-qser-autosuspend/liblynq-qser-autosuspend.bb
@@ -4,7 +4,7 @@
 LICENSE = "CLOSED"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=e1696b147d49d491bcb4da1a57173fff"
 
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)}  liblynq-autosuspend liblynq-log at-ctl libsctel"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)}  liblynq-autosuspend liblynq-log liblynq-uci"
 #inherit workonsrc
 WORKONSRC = "${TOPDIR}/../src/lynq/lib/liblynq-qser-autosuspend/"
 FILESEXTRAPATHS_prepend :="${TOPDIR}/../src/lynq/lib/:"
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
index 2a113a1..3f01e93 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/autosuspend_wakeup_count.c
@@ -34,22 +34,22 @@
 //#include <cutils/properties.h>
 #define USER_LOG_TAG "PMS"
 #include <liblog/lynq_deflog.h>
+#include <include/lynq_uci.h>
+
 #include <log/log.h>
 #include <stdlib.h>
 #include "autosuspend_ops.h"
-
-#ifdef MOBILETEK_SUSPEND_CFG
+#include <sc_mnet_whitelist.h>
+#include <sc_at.h>
 #define SYS_POWER_STATE "/sys/power/state"
-#endif
 
-#ifdef MOBILETEK_TARGET_PLATFORM_T106
-#define SYS_POWER_STATE "/sys/power/autosleep"
-#endif
 #define SYS_POWER_WAKEUP_COUNT "/sys/power/wakeup_count"
 #define SYS_POWER_SPM_SUSPEND_CRTL "/sys/power/spm/suspend_ctrl"
 
 #define BASE_SLEEP_TIME 100000
 #define POSSIBLE_MAX_SLEEP_TIME 60000000
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
 
 static int state_fd;
 static int wakeup_count_fd;
@@ -231,22 +231,122 @@
     }       
 
     dlerror(); // Clear any previous dlerror
-    return;            
+    return;
 }
 #endif
 
 #ifdef MOBILETEK_TARGET_PLATFORM_T106
+int t106_set_blacklist(int blacklist_state)
+{
+    int ret;
+    char rsp[128];
+    char cmdstr[256];
+    if(blacklist_state == 0)
+    {
+        strcpy(cmdstr, "AT+SHELL=echo \"+CREG:+CGREG:+CEREG:^MODE:\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+    }
+    else
+    {
+        strcpy(cmdstr, "AT+SHELL=echo \"\" > /sys/module/at_io/parameters/at_psm_filter\r\n");
+    }
+    printf("cmd:%s\n",cmdstr);
+    ret = sc_at_send(1,cmdstr,rsp,sizeof(rsp));
+    printf("sc_at_send result:%d %s\n",ret,rsp);
+    return ret;
+
+}
+int t106_set_whitelist(void)
+{
+    char tmp[8];
+    int ret;
+    lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "whitelist_state", tmp);
+    if(strlen(tmp) != 4)
+    {
+        RLOGD("the whitelist len is error\n");
+        return 0;
+    }
+    if(tmp[0] == '1')
+    {
+        ret = sc_mnet_whitelist_add(1);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 1 fail\n");
+            return ret;
+        }
+        ret = sc_mnet_whitelist_add(5);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 5 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[1] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(2);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 2 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[2] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(3);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 3 fail\n");
+            return ret;
+        }
+    }
+    if(tmp[3] == '1')
+    {
+        ret =  sc_mnet_whitelist_add(4);
+        if(ret)
+        {
+            RLOGD("sc_mnet_whitelist_add 4 fail\n");
+            return ret;
+        }
+    }
+
+    return 0;
+
+}
 int t106_early_suspend(void)
 {
+    int ret;
     RLOGD("t106_early_suspend start\n");
     system("zlog_nvctrl -m 1");
+    ret = t106_set_whitelist();
+    if(ret)
+    {
+        RLOGD("t106_set_whitelist ret=%d\n", ret);
+        return ret;
+    }
+    ret = t106_set_blacklist(0);
+    if(ret)
+    {
+        RLOGD("t106_set_blacklist ret=%d\n", ret);
+        return ret;
+    }
     return 0;
 }
 
 void t106_early_resume(void)
 {
+    int ret;
     RLOGD("t106_early_resume start\n");
+    ret = t106_set_blacklist(1);
+    if(ret)
+    {
+        RLOGD("t106_set_whitelist ret=%d\n", ret);
+    }
+    ret = sc_mnet_whitelist_clear();
+    if(ret)
+    {
+        RLOGD("sc_mnet_whitelist_clear ret=%d\n", ret);
+    }
     system("zlog_nvctrl -m 0");
+
     return NULL;
 }
 #endif
@@ -584,6 +684,15 @@
         ALOGI("Error creating semaphore: %s\n", buf);
         goto err_sem_init;
     }
+    if(sc_at_init(1)){
+        ALOGD("sc_at_init failed.\n");
+        return NULL;
+    }
+    if(sc_mnet_whitelist_init() != 0)
+    {
+        ALOGD("sc_mnet_whitelist_init failed.\n");
+        return NULL;
+    }
     ret = pthread_create(&suspend_thread, NULL, suspend_thread_func, NULL);
     if (ret) {
         strerror_r(ret, buf, sizeof(buf));
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
index 0441d43..a2eba39 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/files/makefile
@@ -47,6 +47,10 @@
     -llynq-uci \
     -llog \
     -lbsp \
+    -lsctel \
+    -latutils \
+    -latreg \
+    
 
 
 SOURCES = $(wildcard *.c )
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
index 23076f4..96c90de 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-autosuspend/lynq-autosuspend.bb
@@ -22,7 +22,7 @@
 LOCAL_C_INCLUDES = "-I. "
 
 DEPENDS = "liblynq-log liblynq-uci"
-DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp"
+DEPENDS += "${@bb.utils.contains('TARGET_PLATFORM', 'mt2735', 'audio-mixer-ctrl streamer1.0', '', d)} liblynq-log liblynq-uci libbsp libsctel libatutils libatreg"
 LOCAL_LIBS = "-L. -ldl -lstdc++ -lpthread -llog"
 SOURCES = "$(wildcard *.c )"
 
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
index 2c4f1e0..84a727b 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-fota-backup/files/lynq-fota-backup.cpp
@@ -48,16 +48,21 @@
         return -1;

 

     }

-

-    //read fota upgrade flag, 0 :upgrade failed, 1:upgrade success

+    

     fread(&sync_flag,sizeof(int),1,fp);

-

+    

     if(sync_flag == FOTA_SYNC_FLAG)

     {

-        printf("upgrade flag is success ");

-        return 0;

+        ret = lynq_sync_system();

+        if(ret != 0)

+        {

+            printf("sync faild\n");

+            fclose(fp);

+        }

+       system("rm -rf /mnt/userdata/.back_up_flag");

+        

     }

-    else if(sync_flag != FOTA_SYNC_FLAG) 

+    else if(sync_flag != FOTA_SYNC_FLAG)

     {

         ret = lynq_fota_get_addr_value(tmp_addr);

         if(ret != 0)

@@ -81,8 +86,7 @@
         }

         

     }

-    

-

+   

     return 0;

 

 }

diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
index 4437af4..fbaa297 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-autosuspend-demo/files/lynq-qser-autosuspend-demo.cpp
@@ -29,12 +29,11 @@
     printf("-al [wakelock num]  --qser_wakelock_lock \n");
     printf("-rl [wakelock num]  --qser_wakelock_unlock \n");
     printf("-dl [wakelock num]  --qser_wakelock_destroy\n");
+    printf("-ws [whitelist num] --qser_whitelist_set\n");
+    printf("-wg                 --qser_whitelist_get\n");
     printf("-ccl                --check created locks\n");
     printf("-cll                --check lockup locks\n");
-    printf("-wla [id]           --qser_whitelist_add\n");
-    printf("-wld [id]           --qser_whitelist_del\n");
-    printf("-wlg                --qser_whitelist_get\n");
-    printf("-wlc                --qser_whitelist_clear\n");
+    printf("-cws                --check wakeup sources\n");
     printf("Please input an cmd:");
 }
 
@@ -90,9 +89,12 @@
     int num;
     int ret;
     int len;
-    char cmd[16];
+    FILE *fp;
+    char buf[256];
+    char cmd[64];
     char *cmd2;
     char *cmd1;
+    char tmp[8];
     qser_pm_cfg_t *qser_lpm_cfg = NULL;
     qser_lpm_cfg = (qser_pm_cfg_t *)malloc(sizeof(qser_pm_cfg_t));
     qser_lpm_cfg->wakeupin.wakeupin_pin = 50;
@@ -137,6 +139,7 @@
             if(cmd2 == NULL)
             {
                 printf("name is null\n");
+                continue;
             }
             len = strlen(cmd2);
             printf("len =%d\n", len);
@@ -157,6 +160,7 @@
              if(cmd2 == NULL)
             {
                 printf("fd is null\n");
+                continue;
             }
             num = atoi(cmd2);
             ret = qser_wakelock_lock(num);
@@ -176,6 +180,7 @@
             if(cmd2 == NULL)
             {
                 printf("fd is null\n");
+                continue;
             }
             num = atoi(cmd2);
             ret = qser_wakelock_unlock(num);
@@ -194,6 +199,7 @@
             if(cmd2 == NULL)
             {
                 printf("fd is null\n");
+                continue;
             }
             num = atoi(cmd2);
             ret = qser_wakelock_destroy(num);
@@ -207,6 +213,38 @@
                 printf("wakelock destroy success\n");
             }
         }
+        else if(strcmp(cmd1, "-ws") == 0)
+        {
+            if(cmd2 == NULL)
+            {
+                printf("num is null\n");
+                continue;
+            }
+            delete_enter(cmd2);
+            ret = qser_whitelist_set(cmd2);
+            if(ret != 0)
+            {
+                printf("qser_whitlist_set fail\n");
+                printf("ret=%d\n", ret);
+            }
+            else
+            {
+                printf("qser_whitlist_set success\n");
+            }
+        }
+        else if(strcmp(cmd1, "-wg") == 0)
+        {
+            ret = qser_whitelist_get(tmp);
+            if(ret != 0)
+            {
+                printf("qser_whitlist_set fail\n");
+            }
+            else
+            {
+                printf("qser_whitlist_set success\n");
+                printf("ret=%d, whilelist state is %s\n", ret, tmp);
+            }
+        }
         else if(strcmp(cmd1,"-ccl") == 0)
         {
             int ret;
@@ -230,38 +268,16 @@
                 printf("check created lock fail\n");
             }
         }
-        else if(strcmp(cmd1,"-wla") == 0)
+        else if(strcmp(cmd1,"-cws") == 0)
         {
-            num = atoi(cmd2);
-            ret = qser_whitelist_add(num);
-            if(ret != 0)
+            printf("start check active wakeup_sources  !!!\n");
+            memset(buf,0,sizeof(buf));
+            fp = popen("cat /sys/kernel/debug/wakeup_sources|sed -e 's/\"^ \"/\"unnamed\"/g' | awk '{print $6 \"\t\" $1}'| grep -v \"^0\" |sort -n \n","r");
+            while(fgets(buf, 255, fp) != NULL)
             {
-                printf("mnet_whitelist_add ret %d.\n", ret);
+                printf("%s", buf);
             }
-
-        }
-        else if(strcmp(cmd1,"-wld") == 0)
-        {
-            num = atoi(cmd2);
-            ret = qser_whitelist_del(num);
-            if(ret != 0)
-            {
-                printf("mnet_whitelist_del ret %d.\n", ret);
-            }
-        }
-        else if(strcmp(cmd1,"-wlg") == 0)
-        {
-            char* whitelist;
-            qser_whitelist_get(whitelist);
-            printf("mnet_whitelist_get :%s\n",whitelist);
-        }
-        else if(strcmp(cmd1,"-wlc") == 0)
-        {
-            ret = qser_whitelist_clear();
-            if(ret != 0)
-            {
-                printf("mnet_whitelist_clear ret %d.\n", ret);
-            }
+            pclose(fp);
         }
         else if(strcmp(cmd1, "-d") == 0)
         {
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
index 2e0f71f..0bca3bb 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/poweralarm-demo/files/poweralarm-demo.cpp
@@ -8,7 +8,7 @@
 

 

 #define INIT_SUCCESS    0

-

+#define RTC_DEINIT    -1

 typedef struct

 {

     int  cmdIdx;

@@ -285,6 +285,10 @@
                             printf("lynq rtc service deinit failed \n");

                             return -1;

                         }

+                        else

+                        {

+                            init_flag = RTC_DEINIT;

+                        }

                     }

                     break;

                 }

diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
index dc769e1..5d3966a 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/include/lynq-qser-autosuspend.h
@@ -64,10 +64,9 @@
 int qser_wakelock_unlock(int fd);
 int qser_wakelock_destroy(int fd);
 
-int qser_whitelist_add(int id);
-int qser_whitelist_del(int id);
-int qser_whitelist_get(char* whitelist);
-int qser_whitelist_clear(void);
+int qser_whitelist_set(char *whitelist);
+int qser_whitelist_get(char *whitelist);
+
 
 #ifdef __cplusplus
 }
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
index 204660a..ea9b381 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/lynq-qser-autosuspend.cpp
@@ -12,7 +12,7 @@
 #include <lynq_autosuspend.h>
 #include "lynq-qser-autosuspend.h"
 #include "liblog/lynq_deflog.h"
-#include "sc_mnet_whitelist.h"
+#include <include/lynq_uci.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -26,6 +26,9 @@
 
 #define USER_LOG_TAG "LYNQ_QSER_AUTOSUSPEND"
 #define FILE_LOCK_TABLE "/tmp/.lock_table"
+#define LOG_UCI_MODULE "lynq_autosuspend"
+#define LOG_UCI_FILE "lynq_uci"
+
 #define UEVENT_MSG_LEN 128
 
 int device_fd;
@@ -445,80 +448,35 @@
     return ret;
 }
 
-int qser_whitelist_add(int id)
+int qser_whitelist_set(char *whitelist)
 {
     int ret;
-    if(sc_mnet_whitelist_init() != 0)
+    char cmd[64];
+    if(strlen(whitelist) != 4)
     {
-        LYINFLOG("sc_mnet_whitelist_init failed.\n");
+        LYINFLOG("string len is error\n");
         return -1;
     }
-
-    ret =  sc_mnet_whitelist_add(id);
-    LYINFLOG("sc_mnet_whitelist_add ret %d.\n", ret);
-
-    sc_mnet_whitelist_deinit();
+    sprintf(cmd, "uci set lynq_uci.lynq_autosuspend.whitelist_state='%s'", whitelist);
+    ret = system(cmd);
+    system("uci commit");
+    if(ret != 0)
+    {
+        LYINFLOG("qser_whitlist_set fail");
+    }
     return ret;
 
 }
 
-int qser_whitelist_del(int id)
+int qser_whitelist_get(char *whitelist)
 {
     int ret;
-    if(sc_mnet_whitelist_init() != 0)
-    {
-        LYINFLOG("sc_mnet_whitelist_init failed.\n");
-        return -1;
-    }
-
-    ret =  sc_mnet_whitelist_del(id);
-    LYINFLOG("qser_whitelist_del ret %d.\n", ret);
-
-    sc_mnet_whitelist_deinit();
+    ret = lynq_get_value(LOG_UCI_FILE, LOG_UCI_MODULE, "whitelist_state", whitelist);
+    LYERRLOG("ret =%d, whitelist_state is %s\n", ret, whitelist);
     return ret;
 
 }
 
-int qser_whitelist_get(char* whitelist)
-{
-    int ret;
-    if(sc_mnet_whitelist_init() != 0)
-    {
-        LYINFLOG("sc_mnet_whitelist_init failed.\n");
-        return -1;
-    }
-
-    whitelist = sc_mnet_whitelist_get();
-    if(NULL != whitelist)
-    {
-        LYINFLOG("sc_mnet_whitelist_get :%s\n",whitelist);
-        ret = 0;
-    }
-    else
-    {
-        LYINFLOG("sc_mnet_whitelist_get empty\n");
-        ret = -1;
-    }
-    sc_mnet_whitelist_deinit();
-    return ret;
-}
-
-int qser_whitelist_clear(void)
-{
-    int ret;
-    if(sc_mnet_whitelist_init() != 0)
-    {
-        LYINFLOG("sc_mnet_whitelist_init failed.\n");
-        return -1;
-    }
-    ret = sc_mnet_whitelist_clear();
-    LYINFLOG("sc_mnet_whitelist_clear ret %d\n", ret);
-    sc_mnet_whitelist_deinit();
-    return ret;
-
-}
-
-
 DEFINE_LYNQ_LIB_LOG(LYNQ_QSER_AUTOSUSPEND)
 
 #ifdef __cplusplus
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
index 4027a6d..a6ded06 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-qser-autosuspend/makefile
@@ -31,7 +31,7 @@
     -lpthread \
     -llynq-autosuspend \
     -llynq-log \
-    -lsctel \
+    -llynq-uci \
 
 
 SOURCES = $(wildcard *.cpp)
diff --git a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
index 569b224..7193768 100755
--- a/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
+++ b/cap/zx297520v3/src/lynq/lib/liblynq-uci/lynq_uci.config
@@ -14,7 +14,8 @@
 config  lynq_autosuspend  'lynq_autosuspend'

         option auto_enable '0'

         option debug '1'

-

+        option whitelist_state '0000'

+        

 config debug_mode 'debug_mode'

        option sysinfo_debug_status '1'

        option check_file_size '228'