From 8d5218a19b4bc2e653f3c17d339a7dada1c96696 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BD=AD=E7=A3=8A?= <1624952103@qq.com> Date: Wed, 10 Jul 2024 09:02:05 +0000 Subject: [PATCH] Merge #495 into sdk602patch0626 from refs/changes/495/head MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code review from 彭磊 * refs/changes/495/head: (5 commits squashed) - 修改睡眠模式,小睡模式,久坐提醒为时间段触发。 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 - 优化睡眠状态时间戳接收 Signed-off-by: aliyun6865282430 <1624952103@qq.com> Reviewed-by: snickersun@163.com Merged-by: snickersun@163.com CR-link: https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230/change/495 --- .../service/msg_center/src/msg_center_customer.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 518f6ff4c..3c26e1e50 100644 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -1032,8 +1032,7 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) time(&rawtime); timeinfo = localtime(&rawtime); uapi_get_timestampe_ss(×tamp); - day_timestamp = timestamp - (timeinfo->tm_hour * 60 * 60 + timeinfo->tm_min * 60 + timeinfo->tm_sec); - WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, ", = %d", day_timestamp); + day_timestamp = timestamp - (timeinfo->tm_mday * 24 * 60 * 60 + timeinfo->tm_hour * 60 * 60 + timeinfo->tm_min * 60 + timeinfo->tm_sec); } #endif OHOS::SLEEP_STATE_T state_data = {0}; @@ -1080,17 +1079,17 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) #ifdef FD230 if(state_num < 20) { - sleep_data.sleep_status[state_num].timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; + sleep_data.sleep_status[state_num].timestamp = day_timestamp + cywee_Inactivity_Info->day * 24 * 60 * 60 + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; sleep_data.sleep_status[state_num].stat = cywee_Inactivity_Info->status; state_num ++; } if(cywee_Inactivity_Info->status == 0) //0进入睡眠 1潜睡 2深睡 3清醒 4结束睡眠 6入睡 7出睡最后一笔输出 8未出睡最后一笔输出 12快速动眼 13取消入睡 { - sleep_data.fall_asleep_timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; + sleep_data.fall_asleep_timestamp = day_timestamp + cywee_Inactivity_Info->day * 24 * 60 * 60 + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; } else if(cywee_Inactivity_Info->status == 4) { - sleep_data.wake_up_timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; + sleep_data.wake_up_timestamp = day_timestamp + cywee_Inactivity_Info->day * 24 * 60 * 60 + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; } #endif break; @@ -1100,13 +1099,13 @@ void MsgCenterNotifyInactivityProc(const Topic topic, Request *req) if(cywee_Inactivity_Info->status == 0) //0进入睡眠 1潜睡 2深睡 3清醒 4结束睡眠 6入睡 7出睡最后一笔输出 8未出睡最后一笔输出 12快速动眼 13取消入睡 { #ifdef FD230 - nap_data.fall_asleep_timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; + nap_data.fall_asleep_timestamp = day_timestamp + cywee_Inactivity_Info->day * 24 * 60 * 60 + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; #endif } else if(cywee_Inactivity_Info->status == 14) { #ifdef FD230 - nap_data.wake_up_timestamp = day_timestamp + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; + nap_data.wake_up_timestamp = day_timestamp + cywee_Inactivity_Info->day * 24 * 60 * 60 + cywee_Inactivity_Info->hour * 60 * 60 + cywee_Inactivity_Info->minute * 60; #endif } break; -- 2.17.1