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)