[Feature][ZXW-189][AUTOSUSPEND]add suspend white list api
Only Configure: Yes
Affected branch: master
Affected module: suspend
Is it affected on both ZXIC and MTK:only ZXIC
Self-test: Yes
Doc Update:Yes
Change-Id: I36eb19b73df1dbb8d879e864b5740e09626d72d6
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 04b2ad0..e82e2c0 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
@@ -11,6 +11,7 @@
#include <lynq_autosuspend.h>
#include "lynq-qser-autosuspend.h"
#include "liblog/lynq_deflog.h"
+#include "sc_mnet_whitelist.h"
#ifdef __cplusplus
extern "C" {
@@ -351,10 +352,84 @@
return ret;
}
- ret = delete_lock(fd);
+ ret = delete_lock(fd);
return ret;
}
+int qser_whitelist_add(int id)
+{
+ int ret;
+ if(sc_mnet_whitelist_init() != 0)
+ {
+ LYINFLOG("sc_mnet_whitelist_init failed.\n");
+ return -1;
+ }
+
+ ret = sc_mnet_whitelist_add(id);
+ LYINFLOG("sc_mnet_whitelist_add ret %d.\n", ret);
+
+ sc_mnet_whitelist_deinit();
+ return ret;
+
+}
+
+int qser_whitelist_del(int id)
+{
+ 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();
+ 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