From 7cd0bbab7a24e6e7c547ec9ff8ebe656d85104f2 Mon Sep 17 00:00:00 2001 From: hcj <1224667075@qq.com> Date: Tue, 18 Jun 2024 20:44:44 +0800 Subject: [PATCH] =?utf8?q?=E4=BA=A7=E6=B5=8B=E5=A2=9E=E5=8A=A0=E4=B8=8D?= =?utf8?q?=E5=8F=AF=E4=BC=91=E7=9C=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/producttest/src/testLCD.cpp | 26 ++++++++ .../producttest/src/testSEChipTest.cpp | 63 ++++++++++++++++++- .../nativeui/producttest/src/testTP.cpp | 29 ++++++++- .../nativeui/producttest/src/testView.cpp | 2 + .../nativeui/producttest/src/testbutton.cpp | 28 ++++++++- .../nativeui/producttest/src/testcat1.cpp | 1 + .../nativeui/producttest/src/testchanging.cpp | 27 +++++++- .../nativeui/producttest/src/testgsenson.cpp | 28 +++++++++ .../nativeui/producttest/src/testhrsenson.cpp | 30 ++++++++- .../producttest/src/testluminance.cpp | 26 ++++++++ .../nativeui/producttest/src/testmagnetic.cpp | 28 +++++++++ .../producttest/src/testmicrophone.cpp | 26 ++++++++ .../nativeui/producttest/src/testmotor.cpp | 26 ++++++++ .../nativeui/producttest/src/testold.cpp | 26 ++++++++ .../nativeui/producttest/src/testspeak.cpp | 26 ++++++++ .../nativeui/bluetooth/src/BluetoothModel.cpp | 2 +- 16 files changed, 387 insertions(+), 7 deletions(-) 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 900594883..f6b885d97 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testLCD.cpp @@ -4,6 +4,19 @@ #include "producttest/include/testLCD.h" #include "cmsis_os2.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -52,6 +65,12 @@ namespace OHOS delete Title; Title=nullptr; } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } delete testLCDScrollView; testLCDScrollView=nullptr; @@ -135,6 +154,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(163,45,"LCD_TEST"); testLCDScrollView->Add(Title); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp index 3a0cabee4..c5ea95b8b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testSEChipTest.cpp @@ -3,7 +3,19 @@ #include "producttest/include/testPresenter.h" #include "producttest/include/testSEChipTest.h" #include "ConfigModel.h" - +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -31,7 +43,47 @@ namespace OHOS void testSEChipView::ClearAll() { - + if(testSEChipScrollView) + { + + testSEChipScrollView->RemoveAll(); + + if(chipinfo_label) + { + delete chipinfo_label; + chipinfo_label=nullptr; + } + + if(labelButton_next) + { + delete labelButton_next; + labelButton_next=nullptr; + } + + if(Title) + { + delete Title; + Title=nullptr; + } + + if(IIC_label) + { + delete IIC_label; + IIC_label=nullptr; + } + + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + + + delete testSEChipScrollView; + testSEChipScrollView=nullptr; + } } UILabel *testSEChipView::InitLabel(LabelConfig &labelConfig) @@ -146,6 +198,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(142,40,"SEChip_TEST"); testSEChipScrollView->Add(Title); + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } /* -------------------------------------------------------------------------- */ return testSEChipScrollView; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp index 2623c695f..f3beb206f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testTP.cpp @@ -4,7 +4,19 @@ #include "producttest/include/testTP.h" #include "cmsis_os2.h" - +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -52,6 +64,14 @@ namespace OHOS delete Title; Title=nullptr; } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + delete testTPScrollView; + testTPScrollView=nullptr; } } @@ -163,6 +183,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(175,45,"TP_TEST"); testTPScrollView->Add(Title); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp index 1c2aa5399..3a9fca544 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testView.cpp @@ -2,6 +2,8 @@ #include "producttest/include/testPresenter.h" #include "power_display_service.h" #include "wearable_log.h" + + namespace OHOS { diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp index f565b3b19..6307857d7 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testbutton.cpp @@ -4,7 +4,19 @@ #include "producttest/include/testbutton.h" #include "AlarmClockModel.h" #include "cmsis_os2.h" - +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -64,6 +76,13 @@ namespace OHOS Title=nullptr; } RootView::GetInstance()->ClearOnKeyActListener(); + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } delete testBUTTONScrollView; testBUTTONScrollView=nullptr; @@ -293,6 +312,13 @@ namespace OHOS testBUTTONScrollView->SetTouchable(true); testBUTTONScrollView->SetDraggable(true); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp index 43fc7fcbc..a06b85374 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testcat1.cpp @@ -78,6 +78,7 @@ namespace OHOS delete Title; Title=nullptr; } + delete testcat1ScrollView; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp index 76d90e955..018a34c75 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testchanging.cpp @@ -4,7 +4,19 @@ #include "producttest/include/testchanging.h" #include "cmsis_os2.h" - +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -50,6 +62,12 @@ namespace OHOS delete Title; Title=nullptr; } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } delete testCHANINGScrollView; testCHANINGScrollView=nullptr; @@ -166,6 +184,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(120,45,"CHANING_TEST"); testCHANINGScrollView->Add(Title); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp index 385c0dc28..c5bf5754f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testgsenson.cpp @@ -4,6 +4,21 @@ #include "producttest/include/testgsenson.h" #include "cmsis_os2.h" #include "cywee_hal.h" + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif + //#include "acc_service.h" namespace OHOS { @@ -76,6 +91,12 @@ namespace OHOS { delete labelButton_next; labelButton_next=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } delete testGsonsonScrollView; testGsonsonScrollView=nullptr; @@ -218,6 +239,13 @@ namespace OHOS labelButton_next= testAboutView::GetInstance()->init_button_next(167,378,"BTbutton_next"); testGsonsonScrollView->Add(labelButton_next); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + testGsonsonScrollView->SetTouchable(true); testGsonsonScrollView->SetDraggable(true); diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp index 7c559dcd4..10ec69513 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testhrsenson.cpp @@ -9,6 +9,21 @@ #include "cat1_server_hal.h" #include "ppg_service.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif + + namespace OHOS { @@ -63,6 +78,12 @@ namespace OHOS delete Title; Title=nullptr; } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } delete testhrsensonScrollView; testhrsensonScrollView=nullptr; @@ -280,7 +301,14 @@ namespace OHOS testhrsensonScrollView->SetDraggable(true); int8_t md = PPG_SERVICE_CMD_TYPE_STOP_PPG_TEST; - send_ppg_cmd_msg(md); + send_ppg_cmd_msg(md); + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp index e47fbe4ea..fa959fb56 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testluminance.cpp @@ -4,6 +4,19 @@ #include "producttest/include/testluminance.h" #include "ConfigModel.h" #include "cmsis_os2.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -50,6 +63,12 @@ namespace OHOS delete Title; Title=nullptr; } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } delete testLUMScrollView; testLUMScrollView=nullptr; @@ -116,6 +135,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(99,54,"BRIGHTNESS_TEST"); testLUMScrollView->Add(Title); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp index 68bbef825..102cb53ee 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmagnetic.cpp @@ -9,6 +9,21 @@ #include "battery_service.h" #include "battery_hal.h" #endif + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif + namespace OHOS { @@ -61,6 +76,12 @@ namespace OHOS { delete labelButton_next; labelButton_next=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } delete testmagicScrollView; testmagicScrollView=nullptr; @@ -222,6 +243,13 @@ namespace OHOS testmagicScrollView->SetTouchable(true); testmagicScrollView->SetDraggable(true); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp index 494b2cc5d..42ce2798a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmicrophone.cpp @@ -5,6 +5,19 @@ #include "AlarmClockModel.h" #include "cmsis_os2.h" #include "audio_capture_wrapper.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -49,6 +62,12 @@ namespace OHOS { delete Title; Title=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } AlarmClockModel::GetInstance()->AlarmPlayerStop(); delete testmakephoneScrollView; @@ -193,6 +212,13 @@ namespace OHOS testmakephoneScrollView->SetTouchable(true); testmakephoneScrollView->SetDraggable(true); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp index 6b557aa37..043c2492c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testmotor.cpp @@ -6,6 +6,19 @@ #include "cmsis_os2.h" #include "dock/vibrator_manager.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -51,6 +64,12 @@ namespace OHOS { delete Title; Title=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } delete tesMOTORScrollView; tesMOTORScrollView=nullptr; @@ -180,6 +199,13 @@ namespace OHOS Title= testAboutView::GetInstance()->init_title(136,45,"MOTOR_TEST"); tesMOTORScrollView->Add(Title); + + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp index 9996b769a..968fff5b6 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testold.cpp @@ -10,6 +10,19 @@ #include "CompassModel.h" #include "linux/delay.h" #include "power_display_service.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif //#include "acc_service.h" namespace OHOS { @@ -157,6 +170,12 @@ namespace OHOS { delete labelButton_next; labelButton_next=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } delete testoldScrollView; testoldScrollView=nullptr; @@ -283,6 +302,13 @@ namespace OHOS } display_api->set_screen_set_keepon_timeout(-1); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + diff --git a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp index 2347aa6a2..fb33f7cd8 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/producttest/src/testspeak.cpp @@ -4,6 +4,19 @@ #include "producttest/include/testspeak.h" #include "AlarmClockModel.h" #include "cmsis_os2.h" +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + #include "pm_veto.h" + #include "pm.h" +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif namespace OHOS { @@ -54,6 +67,12 @@ namespace OHOS { delete Title; Title=nullptr; + } + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 1) { + uapi_pm_remove_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); } delete testSPEAKScrollView; testSPEAKScrollView=nullptr; @@ -216,6 +235,13 @@ namespace OHOS testSPEAKScrollView->SetTouchable(true); testSPEAKScrollView->SetDraggable(true); + uint8_t cnt = pm_veto_get_id_cnt(PM_ID_P_TEST); + if (cnt == 0) { + uapi_pm_add_sleep_veto(PM_ID_P_TEST); + } else { + // WEARABLE_LOGE(WEARABLE_LOG_MODULE_MAIN_SERVICE,"CAT1 SERVICE MCU has got pm_id_cat1 vote\r\n"); + } + return true; } diff --git a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp index c8cd31ca6..e11693cab 100755 --- a/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp +++ b/code/sdk/application/wearable/nativeapp/nativeui/bluetooth/src/BluetoothModel.cpp @@ -482,7 +482,7 @@ void BtGapReadRemoteRssiEventCallback(const bd_addr_t *bdAddr, int rssi, int sta void BtGapDiscoveryStateChangedCallback(int status) { UNUSED(status); - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "bt BtGapDiscoveryStateChangedCallback %d", status); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "bt BtGapDiscoveryStateChangedCallback %d", status); } static void ChangeScanView() -- 2.17.1