From: penglei <1624952103@qq.com> Date: Mon, 19 Aug 2024 02:18:10 +0000 (+0800) Subject: Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0... X-Git-Tag: release_V1.2.70_20241020_135402~638^2~4 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F717%2Fhead;p=mirrors%2FFD230.git Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0/FD230 into sdk602patch0626 --- 6d91b5b5bda15e0dc1f936779efcca0df5e8b0dc diff --cc code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp index 67f9632cc,8356dbfee..041c9286a --- 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 @@@ -1108,33 -1114,23 +1113,44 @@@ void MsgCenterNotifyActivityProc(const void MsgCenterNotifyActivityExtraInfoProc(const Topic topic, Request* req) { unused(topic); + cywee_activity_result_extre_info_t* c_activity_result_extre_info_t = (cywee_activity_result_extre_info_t *) malloc(req->len); + if(c_activity_result_extre_info_t==NULL) + { + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "Memory allocation failure"); + return; + } + + int rets = memcpy_s(c_activity_result_extre_info_t, req->len, (cywee_activity_result_extre_info_t*)req->data, req->len); + if (rets != EOK) + { + free(c_activity_result_extre_info_t); + c_activity_result_extre_info_t = NULL; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "memcpy_s c_activity_result_extre_info_t failed, ret = %d", rets); + return; + } + + /*更新燃脂时间数据*/ + set_fat_time_data(c_activity_result_extre_info_t->ativity_zone_high_duration); + + free(c_activity_result_extre_info_t); + c_activity_result_extre_info_t = NULL; } - + /*运动识别*/ void MsgCenterNotifyArAlertProc(const Topic topic, Request* req) { - unused(topic); - NotificationManager::GetInstance()->ShowNotify(showSedentaryReminderNotify, (uint16_t)topic, true); + uint8_t* motionType=(uint8_t*)req->data; + WEARABLE_LOGI(WEARABLE_LOG_MODULE_APP, "MsgCenterNotifyArAlertProc,motionType = %d !",*motionType); + if(*motionType == 0) //未知运动不弹窗 + { + return; + } + const power_display_svr_api_t *display_api = power_display_svr_get_api(); + if (display_api->get_screen_state() != SCREEN_ON) + { + display_api->turn_on_screen(); + } + MotionRecognitionViewEventListener::GetInstance().SetMotionTypeId(*motionType); + NotificationManager::GetInstance()->ShowNotify(showMotionRecognitionNotify, (uint16_t)topic, true); } void MsgCenterNotifyInactivityProc(const Topic topic, Request *req)