Merge branch 'sdk602patch0626' of https://codeup.aliyun.com/64191456b9581d62e8f81ac0... 717/2 717/head
authorpenglei <1624952103@qq.com>
Mon, 19 Aug 2024 02:18:10 +0000 (10:18 +0800)
committerpenglei <1624952103@qq.com>
Mon, 19 Aug 2024 02:18:10 +0000 (10:18 +0800)
1  2 
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)