From: hcj <1224667075@qq.com> Date: Thu, 22 Aug 2024 07:36:20 +0000 (+0800) Subject: 修复产测代码线程干扰问题 X-Git-Tag: release_V1.2.70_20241020_135402~555^2~7^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=acfa18b2d1e0c6c2a3905c580789a0b9e86b4679;p=mirrors%2FFD230.git 修复产测代码线程干扰问题 --- diff --git a/code/sdk/application/wearable/fd230app/CMakeLists.txt b/code/sdk/application/wearable/fd230app/CMakeLists.txt index 04d9dc4b7..42019e1bd 100644 --- a/code/sdk/application/wearable/fd230app/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230app/CMakeLists.txt @@ -733,6 +733,7 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testold.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testbt.cpp ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testSEChipTest.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/producttest/src/testModel.cpp #每日目标 ${CMAKE_CURRENT_SOURCE_DIR}/nativeui/goal/src/goalmodel.cpp diff --git a/code/sdk/application/wearable/fd230app/nativeui/activity/src/ActivityModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/activity/src/ActivityModel.cpp index 64371d4bb..f053aac11 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/activity/src/ActivityModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/activity/src/ActivityModel.cpp @@ -142,9 +142,6 @@ static void Notify(void *args, const Topic topic, Request* request) if (request->msgId == TOPIC_EVENT_NEXTDAY_UPDATE) { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "STEP:TOPIC_EVENT_NEXTDAY_UPDATE"); - //午夜清除运动数据 - do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA,NULL); - uint32_t refreshValue = OHOS::ActivityModel::GetInstance()->ZeroHourStepHandle(); RefreshStepControls(refreshValue, TOPIC_EVENT_NEXTDAY_UPDATE); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp index dee89e03e..9fd0b3fde 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/alarmclocktimerconfig/src/AlarmClockTimerConfig.cpp @@ -310,7 +310,10 @@ extern "C" { AlarmClockEventData unuse; WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "AlarmCallBackProcB"); - AlarmTimerEventPublish(TOPIC_EVENT_NEXTDAY_UPDATE, unuse); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(AlarmTimerEventPublish, TOPIC_EVENT_NEXTDAY_UPDATE, unuse)); + + // AlarmTimerEventPublish(TOPIC_EVENT_NEXTDAY_UPDATE, unuse); SetZeroAlarm(); } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testModel.h b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testModel.h index 4c9de3567..4e813a8ed 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testModel.h +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/include/testModel.h @@ -7,6 +7,7 @@ namespace OHOS { public: static testModel *GetInstance(void); + void testModelupdata(int); private: testModel() = default; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp index 123eb54e8..36a0cdc89 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -188,7 +188,7 @@ namespace OHOS void testLCDView::LCDHideNextButton(void) { labelButton_next->SetVisible(false); - testLCDScrollView->Remove(Title); + Title->SetVisible(false); } #ifdef __cplusplus @@ -208,9 +208,13 @@ extern "C" void factorytest_hide_test_lcd_button(void) { - testLCDView::GetInstance()->LCDHideNextButton(); - if(MG_TEST_timer) - osTimerStop(MG_TEST_timer); + if(testLCDView::GetInstance()) + { + testLCDView::GetInstance()->LCDHideNextButton(); + if(MG_TEST_timer) + osTimerStop(MG_TEST_timer); + } + } #ifdef __cplusplus diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp index c653ac12c..66cb47673 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testModel.cpp @@ -1,4 +1,6 @@ #include "producttest/include/testModel.h" +#include "producttest/include/testPresenter.h" +#include "producttest/include/testLCDC.h" namespace OHOS { @@ -9,4 +11,33 @@ namespace OHOS return &instance; } + void testModel::testModelupdata(int type) + { + switch (type) + { + case 1: + /* code */ + break; + + default: + break; + } + if( testView::GetInstance()) + { + testView::GetInstance()->ChangeView(TESTVIEW,LCD); + + factorytest_hide_test_lcd_button(); + + } + else + printf("xxxxxxxxxxxxxxxxxxxxx\r\n"); + + + + return ; + } + + + + } \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp index ae7ab8d4d..3cda8dc66 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testPresenter.cpp @@ -365,7 +365,10 @@ extern "C" void factorytest_enter_test_lcd_view(void) { + if( testView::GetInstance()) testView::GetInstance()->ChangeView(TESTVIEW,LCD); + else + printf("xxxxxxxxxxxxxxxxxxxxx\r\n"); } void factorytest_enter_test_button_view(void) diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h index 853eab006..f8cedc04a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h @@ -103,6 +103,7 @@ void ScreenTurnOn(int32_t timeout); void ScreenTurnOff(void); void ScreenOffEnable(int32_t enable); + #ifdef __cplusplus } #endif diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h new file mode 100644 index 000000000..1bd17e183 --- /dev/null +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_serviceC.h @@ -0,0 +1,44 @@ +/*** + * @Date: 2024-07-12 19:25:33 + * @LastEditors: Caisking 3449750381@qq.com + * @LastEditTime: 2024-08-20 18:34:42 + * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/uiservice/include/ui_service.h + */ +/* + * @Author: luozheng 1732036298@qq.com + * @Date: 2024-06-12 11:44:04 + * @LastEditors: luozheng 1732036298@qq.com + * @LastEditTime: 2024-08-13 11:06:07 + * @FilePath: /FD230/code/sdk/application/wearable/nativeapp/nativeui/uiservice/include/ui_service.h + */ +/* + * Copyright (c) 2021-2021 CompanyNameMagicTag. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef OHOS_UI_SERVICE_C_H +#define OHOS_UI_SERVICE_C_H + + +#ifdef __cplusplus +extern "C" { +#endif + +#define UI_SERVICE "uiservice" +void HandleUpdatelcdMode(int); + +#ifdef __cplusplus +} +#endif + +#endif // OHOS_UiService_SERVICE_H diff --git a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp index 1e0da34b9..141e5405d 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/uiservice/src/ui_service.cpp @@ -48,6 +48,9 @@ #include "errcode.h" #include "pm_definition.h" +#include "producttest/include/testModel.h" +#include "ui_serviceC.h" + extern "C" errcode_t uapi_pm_add_sleep_veto(pm_id_t veto_id); extern "C" errcode_t uapi_pm_remove_sleep_veto(pm_id_t veto_id); @@ -633,6 +636,15 @@ extern "C" GraphicService::GetInstance()->PostGraphicEvent( std::bind(&OHOS::MainModel::UpdateDialState, &OHOS::MainModel::GetInstance())); } + + void HandleUpdatelcdMode(int type) + { + WEARABLE_LOGI(WEARABLE_LOG_MODULE_UI_SERVICE, "HandleUpdateSilentMode"); + GraphicService::GetInstance()->PostGraphicEvent( + std::bind(&OHOS::testModel::testModelupdata,OHOS::testModel::GetInstance(),type)); + } + + /* -------------------------------------------------------------------------- */ #ifdef __cplusplus } 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 3fec2b49a..d2866b960 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 @@ -57,7 +57,7 @@ #include "producttest/include/testcat1.h" #endif #include - +#include "cywee_service.h" #include "goalview.h" #include "goalother.h" @@ -498,6 +498,8 @@ void MsgCenterNotifyNextDayProc(const Topic topic, Request* req) HealthService::GetInstance()->ClearHourlyHeartRates(); HealthService::GetInstance()->SaveDailyHeartRate(); + //午夜清除运动数据 + do_cywee_service_check_msg(CYWEE_SERVICE_CMD_RESET_DAILY_DATA,NULL); #endif } @@ -1345,7 +1347,8 @@ void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req) void MsgCenterNotifybleTransmit(const Topic topic, Request* req) { unused(topic); - uint8_t* data=(uint8_t*)req->data; + uint8_t* data=(uint8_t*)req->data; + NotificationManager::GetInstance()->SetNotifyPriority(PRIORITY_ONE); if(data[0]==TRANS_FREE) { diff --git a/code/sdk/drivers/peripheral/utils/CMakeLists.txt b/code/sdk/drivers/peripheral/utils/CMakeLists.txt index f9ca05eb1..ab3c7330e 100644 --- a/code/sdk/drivers/peripheral/utils/CMakeLists.txt +++ b/code/sdk/drivers/peripheral/utils/CMakeLists.txt @@ -16,6 +16,8 @@ set(SOURCES set(PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR} ${ROOT_DIR}/application/wearable/fd230app/nativeui/phoneservice/include + ${ROOT_DIR}/application/wearable/fd230app/nativeui/uiservice/include + ) set(PRIVATE_HEADER diff --git a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c index 33c20a37f..f5c8a487d 100644 --- a/code/sdk/drivers/peripheral/utils/custom_cmd_service.c +++ b/code/sdk/drivers/peripheral/utils/custom_cmd_service.c @@ -35,6 +35,8 @@ #include "PhoneServiceC.h" +#include "ui_serviceC.h" + typedef struct { @@ -138,11 +140,16 @@ static void custom_cmd_service_check_task(void const *arg) case CUSTOM_CMD_MSG_TYPE_LCD_TEST: if(mail.data[0] == 1) { - uapi_setScreenBrightness(255); uapi_set_screen_on_api(); + uapi_setScreenBrightness(255); + printf("111\n"); uapi_factorytest_enter_test_view(1); - uapi_factorytest_enter_test_lcd_view(); - uapi_factorytest_hide_test_lcd_button(); + HandleUpdatelcdMode(1); + // printf("222\n"); + // LOS_Msleep(500); + // uapi_factorytest_enter_test_lcd_view(); + // printf("333\n"); + // uapi_factorytest_hide_test_lcd_button(); } else {