[Bugfix][API-722]After sleeping once calling lynq_wait_wakeup_event does not return sleep time
Change-Id: I8eb668936d0380f726a14cb8b9bfff9ce63aaf8e
diff --git a/src/lynq/lib/libautosuspend/libautosuspend.c b/src/lynq/lib/libautosuspend/libautosuspend.c
index d39bab1..58412a6 100644
--- a/src/lynq/lib/libautosuspend/libautosuspend.c
+++ b/src/lynq/lib/libautosuspend/libautosuspend.c
@@ -28,6 +28,7 @@
static bool libautosuspend_inited;
+bool feedback_flag = true; //add for after sleeping once calling lynq_wailt_wakeup_event does not return sleep time
// static bool libautosuspend_enabled;
// static pthread_mutex_t get_feedback_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -468,7 +469,16 @@
int *socket_timeout = NULL;
struct time_info_t time_info;
int ret = 0;
-
+ /*add for after sleeping once calling lynq_wailt_wakeup_event does not return sleep time start*/
+ if(feedback_flag == true)
+ {
+ if(libautosuspend_init() != 0)
+ {
+ return -1;
+ }
+ }
+ feedback_flag = false;
+ /*add for after sleeping once calling lynq_wailt_wakeup_event does not return sleep time end*/
memset(&time_info,0,sizeof(struct time_info_t));
if(sleep_start_time == NULL || wakeup_time == NULL )
{