From: luozheng <1732036298@qq.com> Date: Tue, 17 Mar 2026 01:42:10 +0000 (+0800) Subject: 修复app设置运动目标失效bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=refs%2Fchanges%2F3278%2F1;p=mirrors%2FFD230.git 修复app设置运动目标失效bug --- diff --git a/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notification.h b/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notification.h index 84518a114..b526d2c09 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notification.h +++ b/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notification.h @@ -7,13 +7,11 @@ namespace OHOS typedef enum GOAL_type { GOAL_STEP = 1, - - GOAL_CALOREIE, - GOAL_STAND, - GOAL_FAT, - GOAL_DISTANCE, - - GOAL_free, + GOAL_CALOREIE = 2, + GOAL_STAND = 3, + GOAL_FAT = 4, + GOAL_DISTANCE = 5, + GOAL_free = 6, } transmitting_type; UIViewGroup *GoalviewShow(void); diff --git a/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notificationC.h b/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notificationC.h new file mode 100644 index 000000000..a5b81f4d1 --- /dev/null +++ b/code/sdk/application/wearable/n9/service/msg_center/include/notify/goal_notificationC.h @@ -0,0 +1,17 @@ + +#ifndef GOAL_NOTIFICATION_C_H +#define GOAL_NOTIFICATION_C_H +#include +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + uint8_t set_Is_show_flagC(uint8_t flag, uint8_t type); +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp b/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp index 487ec4cc1..00436dab8 100644 --- a/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp +++ b/code/sdk/application/wearable/n9/service/msg_center/src/notify/goal_notification.cpp @@ -29,6 +29,7 @@ #ifdef SUPPORT_BLE_SERVICE #include "bleEvent.h" #endif +#include "goal_notificationC.h" namespace OHOS { @@ -462,3 +463,21 @@ namespace OHOS } } + + +#include +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + uint8_t set_Is_show_flagC(uint8_t flag, uint8_t type) + { + return OHOS::set_Is_show_flag(flag, type); + } +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif \ No newline at end of file diff --git a/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp b/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp index 44951cde3..a08a485fc 100644 --- a/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp +++ b/code/sdk/zhihui/services/ble_service/blemoder/ble_congfig_adapt.cpp @@ -17,6 +17,7 @@ #include "alarmclocktimerconfig/include/AlarmClockTimerConfig.h" #include "sleep/include/SleepModel.h" +#include "goal_notificationC.h" void set_ota_upgrade_(void) { @@ -374,15 +375,18 @@ void set_goal_other_notification_(uint8_t data) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_OTHER,data); if(data==1) { - // OHOS::set_Is_show_flag(1,OHOS::GOAL_CALOREIE); - // OHOS::set_Is_show_flag(1,OHOS::GOAL_STAND); - // OHOS::set_Is_show_flag(1,OHOS::GOAL_FAT); - // OHOS::set_Is_show_flag(1,OHOS::GOAL_DISTANCE); + // set_Is_show_flagC(1,GOAL_CALOREIE); + // set_Is_show_flagC(1,GOAL_STAND); + // set_Is_show_flagC(1,GOAL_FAT); + // set_Is_show_flagC(1,GOAL_DISTANCE); - } - - // SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); + set_Is_show_flagC(1,2); + set_Is_show_flagC(1,3); + set_Is_show_flagC(1,4); + set_Is_show_flagC(1,5); + } + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); return; } @@ -392,10 +396,10 @@ void set_goal_step_notification_(uint8_t data) p_ConfigModel->set_condigData_Int(OHOS::ConfigModel::CONFIGMODEL_ITEM_SPORTS_GOAL_STEP,data); if(data==1) { - // OHOS::set_Is_show_flag(1,OHOS::GOAL_STEP); + // set_Is_show_flagC(1,GOAL_STEP); + set_Is_show_flagC(1,1); } - - // SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); + SendMsgToUIService(UI_UPDATE_GOAL, 0, nullptr, 0); return; }