From: luozheng <1732036298@qq.com> Date: Tue, 24 Jun 2025 04:17:28 +0000 (+0800) Subject: 解决充电弹窗不显示问题 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~262 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=dba549c9b0aeaf4ea7429a240151f1cc088e1331;p=mirrors%2FFD230.git 解决充电弹窗不显示问题 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialModelChargeC.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialModelChargeC.h new file mode 100644 index 000000000..f9c5895b1 --- /dev/null +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialModelChargeC.h @@ -0,0 +1,19 @@ +#ifndef DIAL_MODEL_CHARGEC_H +#define DIAL_MODEL_CHARGEC_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +void setChargeStatus(int status); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelCharge.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelCharge.cpp index abe39205e..1e89666e0 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelCharge.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelCharge.cpp @@ -7,6 +7,7 @@ #include "RegisterDialModel.h" #include "DialModelCharge.h" +#include "main/include/dial/DialModelChargeC.h" #include "wearable_log.h" REGIST_DIAL_MODULE(OHOS::DialDataType::CHARGING_STATUS, OHOS::DialModelCharge::GetInstance()); @@ -29,3 +30,20 @@ namespace OHOS } } } +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +void setChargeStatus(int status) +{ + OHOS::DialModelCharge::GetInstance()->UpdatechargeStatus(status); +} + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ diff --git a/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt b/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt index 01d51049e..f826ec67f 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt +++ b/code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt @@ -143,6 +143,7 @@ set(PRIVATE_HEADER ${ROOT_DIR}/zhihui/drivers ${ROOT_DIR}/zhihui/services + ${ROOT_DIR}/zhihui/UI/producttest/include/ ) if("JS_ENABLE" IN_LIST DEFINES) diff --git a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp index c9c7a399c..6ceedcf6a 100644 --- a/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp @@ -33,9 +33,6 @@ #include "VolumeSettingView.h" #include "VolumeSettingPresenter.h" #include "VolumeSettingView.h" -#include "pairing_notification.h" -// #include "saveele/include/SaveEleModel.h" -// #include "DialModelCharge.h" #define DIALDATASET 1 @@ -52,6 +49,11 @@ #include "sedentaryReminder_notification.h" #include "findwatch_notification.h" #include "debug_output_notification/debug_output_notification.h" +#include "pairing_notification.h" +#include "main/include/dial/DialModelChargeC.h" +#include "saveele/include/SaveEleModel.h" +#include "testchangingC.h" +#include "custom_runtime.h" #ifdef SUPPORT_POWER_MANAGER #include "power_display_service.h" @@ -418,9 +420,10 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req) { GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); } - #if 0 + #if DIALDATASET - DialModelCharge::GetInstance()->UpdatechargeStatus(1); + // DialModelCharge::GetInstance()->UpdatechargeStatus(1); + setChargeStatus(1); #endif SaveEleModel::GetInstance()->SetChargeStatus(true); @@ -431,19 +434,22 @@ void MsgCenterNotifyChargePlugProc(const Topic topic, Request* req) } - testCHANINGView *t = testCHANINGView::GetInstance(); - if(t != nullptr) - { - t->ChangeViewcolor(true); - } - else + // if(IsTestCHANGINGViewCreated()) + // { + // ChangeViewcolorC(1); + // } + // else + // { + // if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗 + // { + // NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); + // } + // } + + if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗 { - if (CheckPriority(topic) && !uapi_dev_runtime_get_factory_test_status_flag()) //产测模式不弹充电弹窗 - { - NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); - } + NotificationManager::GetInstance()->ShowNotify(ShowChargeingNotify, (uint16_t)topic, true); } - #endif } /*充电器已拔掉*/ @@ -459,26 +465,29 @@ void MsgCenterNotifyChargeUnPlugProc(const Topic topic, Request* req) { GraphicService::GetInstance()->PostGraphicEvent(std::bind(&OHOS::PullUpDownView::UpdateBatteryProcess, OHOS::PullUpDownView::GetInstance() )); } -#if 0 #if DIALDATASET - DialModelCharge::GetInstance()->UpdatechargeStatus(0); + // DialModelCharge::GetInstance()->UpdatechargeStatus(0); + setChargeStatus(0); #endif SaveEleModel::GetInstance()->SetChargeStatus(false); - testCHANINGView *t = testCHANINGView::GetInstance(); - if(t != nullptr) - { - t->ChangeViewcolor(false); - } - else + // if(IsTestCHANGINGViewCreated()) + // { + // ChangeViewcolorC(0); + // } + // else + // { + // if(is_UIViewGroup_charge()) + // { + // NotificationManager::GetInstance()->StopNotify(); + // } + // } + + if(is_UIViewGroup_charge()) { - if(is_UIViewGroup_charge()) - { - NotificationManager::GetInstance()->StopNotify(); - } + NotificationManager::GetInstance()->StopNotify(); } - #endif } /*低电量提醒*/ diff --git a/code/sdk/zhihui/UI/producttest/include/testA5133.h b/code/sdk/zhihui/UI/producttest/include/testA5133.h index 611ad7575..87d4f8423 100644 --- a/code/sdk/zhihui/UI/producttest/include/testA5133.h +++ b/code/sdk/zhihui/UI/producttest/include/testA5133.h @@ -11,7 +11,7 @@ #ifndef TEST_A5133_VIEW_H #define TEST_A5133_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testGPS.h b/code/sdk/zhihui/UI/producttest/include/testGPS.h index f95c79be2..d28785330 100644 --- a/code/sdk/zhihui/UI/producttest/include/testGPS.h +++ b/code/sdk/zhihui/UI/producttest/include/testGPS.h @@ -1,7 +1,7 @@ #ifndef TEST_GPS__VIEW_H #define TEST_GPS__VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testLCD.h b/code/sdk/zhihui/UI/producttest/include/testLCD.h index 2d655c76a..90cee71e1 100644 --- a/code/sdk/zhihui/UI/producttest/include/testLCD.h +++ b/code/sdk/zhihui/UI/producttest/include/testLCD.h @@ -1,7 +1,7 @@ #ifndef TEST_LCD_VIEW_H #define TEST_LCD_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testPing.h b/code/sdk/zhihui/UI/producttest/include/testPing.h index f7be83368..3bdec1d5b 100644 --- a/code/sdk/zhihui/UI/producttest/include/testPing.h +++ b/code/sdk/zhihui/UI/producttest/include/testPing.h @@ -9,7 +9,7 @@ #ifndef TEST_PING_VIEW_H #define TEST_PING_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testSEChipTest.h b/code/sdk/zhihui/UI/producttest/include/testSEChipTest.h index a431accb6..e8bbe00fc 100644 --- a/code/sdk/zhihui/UI/producttest/include/testSEChipTest.h +++ b/code/sdk/zhihui/UI/producttest/include/testSEChipTest.h @@ -1,7 +1,7 @@ #ifndef TEST_SECCHIP_VIEW_H #define TEST_SECCHIP_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testTP.h b/code/sdk/zhihui/UI/producttest/include/testTP.h index 0c3c96f30..dfd3c05e9 100644 --- a/code/sdk/zhihui/UI/producttest/include/testTP.h +++ b/code/sdk/zhihui/UI/producttest/include/testTP.h @@ -1,7 +1,7 @@ #ifndef TEST_TP_VIEW_H #define TEST_TP_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testView.h b/code/sdk/zhihui/UI/producttest/include/testView.h index c0e420a2b..53f060c85 100644 --- a/code/sdk/zhihui/UI/producttest/include/testView.h +++ b/code/sdk/zhihui/UI/producttest/include/testView.h @@ -1,7 +1,7 @@ #ifndef TEST_VIEW_H #define TEST_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_view_group.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testabout.h b/code/sdk/zhihui/UI/producttest/include/testabout.h index 4dc863092..35cb5c6a2 100644 --- a/code/sdk/zhihui/UI/producttest/include/testabout.h +++ b/code/sdk/zhihui/UI/producttest/include/testabout.h @@ -1,7 +1,7 @@ #ifndef TEST_ABOUT_VIEW_H #define TEST_ABOUT_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testbt.h b/code/sdk/zhihui/UI/producttest/include/testbt.h index d4120bf91..4cf8d32ae 100644 --- a/code/sdk/zhihui/UI/producttest/include/testbt.h +++ b/code/sdk/zhihui/UI/producttest/include/testbt.h @@ -1,7 +1,7 @@ #ifndef TEST_BT_VIEW_H #define TEST_BT_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testbutton.h b/code/sdk/zhihui/UI/producttest/include/testbutton.h index 0a3d4da92..284e5f77a 100644 --- a/code/sdk/zhihui/UI/producttest/include/testbutton.h +++ b/code/sdk/zhihui/UI/producttest/include/testbutton.h @@ -1,7 +1,7 @@ #ifndef TEST_BUTTON_VIEW_H #define TEST_BUTTON_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testcat1.h b/code/sdk/zhihui/UI/producttest/include/testcat1.h index d4263ad07..d38f5eb13 100644 --- a/code/sdk/zhihui/UI/producttest/include/testcat1.h +++ b/code/sdk/zhihui/UI/producttest/include/testcat1.h @@ -1,7 +1,7 @@ #ifndef TEST_CAT1_VIEW_H #define TEST_CAT1_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testchanging.h b/code/sdk/zhihui/UI/producttest/include/testchanging.h index 730c3bcf9..959bdf08e 100644 --- a/code/sdk/zhihui/UI/producttest/include/testchanging.h +++ b/code/sdk/zhihui/UI/producttest/include/testchanging.h @@ -1,7 +1,6 @@ #ifndef TEST_CHANGING_VIEW_H #define TEST_CHANGING_VIEW_H -#include "BaseView.h" #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testchangingC.h b/code/sdk/zhihui/UI/producttest/include/testchangingC.h new file mode 100644 index 000000000..7b0f792b1 --- /dev/null +++ b/code/sdk/zhihui/UI/producttest/include/testchangingC.h @@ -0,0 +1,20 @@ +#ifndef TEST_CHANGINGC_VIEW_H +#define TEST_CHANGINGC_VIEW_H + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +int IsTestCHANGINGViewCreated(void); +void ChangeViewcolorC(int val); + +#ifdef __cplusplus +#if __cplusplus +} +#endif /* __cplusplus */ +#endif /* __cplusplus */ + +#endif \ No newline at end of file diff --git a/code/sdk/zhihui/UI/producttest/include/testgsenson.h b/code/sdk/zhihui/UI/producttest/include/testgsenson.h index d4bc8f512..599a773bb 100644 --- a/code/sdk/zhihui/UI/producttest/include/testgsenson.h +++ b/code/sdk/zhihui/UI/producttest/include/testgsenson.h @@ -1,7 +1,7 @@ #ifndef TEST_GSONSON_VIEW_H #define TEST_GSONSON_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testhrsenson.h b/code/sdk/zhihui/UI/producttest/include/testhrsenson.h index 4ba83b9a3..2626277b3 100644 --- a/code/sdk/zhihui/UI/producttest/include/testhrsenson.h +++ b/code/sdk/zhihui/UI/producttest/include/testhrsenson.h @@ -1,7 +1,7 @@ #ifndef TEST_HRSENSON_VIEW_H #define TEST_HRSENSON_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testluminance.h b/code/sdk/zhihui/UI/producttest/include/testluminance.h index ff3b74095..444101a8c 100644 --- a/code/sdk/zhihui/UI/producttest/include/testluminance.h +++ b/code/sdk/zhihui/UI/producttest/include/testluminance.h @@ -1,7 +1,7 @@ #ifndef TEST_LUMINANCE_VIEW_H #define TEST_LUMINANCE_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testmagnetic.h b/code/sdk/zhihui/UI/producttest/include/testmagnetic.h index d0ef55b6a..e3c030473 100644 --- a/code/sdk/zhihui/UI/producttest/include/testmagnetic.h +++ b/code/sdk/zhihui/UI/producttest/include/testmagnetic.h @@ -1,7 +1,7 @@ #ifndef TEST_MG_VIEW_H #define TEST_MG_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testmicrophone.h b/code/sdk/zhihui/UI/producttest/include/testmicrophone.h index 9a6d87641..818db62b9 100644 --- a/code/sdk/zhihui/UI/producttest/include/testmicrophone.h +++ b/code/sdk/zhihui/UI/producttest/include/testmicrophone.h @@ -11,7 +11,7 @@ #ifndef TEST_MICRPHONE_VIEW_H #define TEST_MICRPHONE_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testmotor.h b/code/sdk/zhihui/UI/producttest/include/testmotor.h index cb68649d1..782b2b371 100644 --- a/code/sdk/zhihui/UI/producttest/include/testmotor.h +++ b/code/sdk/zhihui/UI/producttest/include/testmotor.h @@ -1,7 +1,7 @@ #ifndef TEST_MOTOR_VIEW_H #define TEST_MOTOR_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testold.h b/code/sdk/zhihui/UI/producttest/include/testold.h index c0dfed13f..d8a759637 100644 --- a/code/sdk/zhihui/UI/producttest/include/testold.h +++ b/code/sdk/zhihui/UI/producttest/include/testold.h @@ -9,7 +9,7 @@ #ifndef TEST_OLD_VIEW_H #define TEST_OLD_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testpressure.h b/code/sdk/zhihui/UI/producttest/include/testpressure.h index a8640796f..3bbd6b165 100644 --- a/code/sdk/zhihui/UI/producttest/include/testpressure.h +++ b/code/sdk/zhihui/UI/producttest/include/testpressure.h @@ -1,7 +1,7 @@ #ifndef TEST_PRESSURE_VIEW_H #define TEST_PRESSURE_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/include/testspeak.h b/code/sdk/zhihui/UI/producttest/include/testspeak.h index 7c5e977d7..c565d5708 100644 --- a/code/sdk/zhihui/UI/producttest/include/testspeak.h +++ b/code/sdk/zhihui/UI/producttest/include/testspeak.h @@ -1,7 +1,7 @@ #ifndef TEST_SPEAK_VIEW_H #define TEST_SPEAK_VIEW_H -#include "BaseView.h" + #include "View.h" #include "components/ui_scroll_view.h" #include "components/ui_label.h" diff --git a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp index 24efbe726..4d108ebf2 100644 --- a/code/sdk/zhihui/UI/producttest/src/testchanging.cpp +++ b/code/sdk/zhihui/UI/producttest/src/testchanging.cpp @@ -2,6 +2,7 @@ #include "custom_utils.h" #include "producttest/include/testPresenter.h" #include "producttest/include/testchanging.h" +#include "producttest/include/testchangingC.h" #include "battery_hal.h" #include "producttest/include/testView.h" #include "cmsis_os2.h" @@ -33,7 +34,7 @@ namespace OHOS { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "testCHANINGView::~testCHANINGView"); ClearAll(); - //g_pSystemAboutTheWatchView = nullptr; + g_pSystemAboutTheWatchView = nullptr; } testCHANINGView *testCHANINGView::GetInstance() @@ -223,4 +224,37 @@ namespace OHOS } return testCHANINGScrollView; } -} \ No newline at end of file +} + +#ifdef __cplusplus +#if __cplusplus +extern "C" +{ +#endif +#endif + int IsTestCHANGINGViewCreated(void) + { + if(OHOS::testCHANINGView::GetInstance()) + { + return 1; + } + return 0; + } + void ChangeViewcolorC(int val) + { + bool falg; + if(val==1) + { + falg=true; + } + else + { + falg=false; + } + OHOS::testCHANINGView::GetInstance()->ChangeViewcolor(falg); + } +#ifdef __cplusplus +#if __cplusplus +} +#endif +#endif \ No newline at end of file