解决充电弹窗不显示问题
authorluozheng <1732036298@qq.com>
Tue, 24 Jun 2025 04:17:28 +0000 (12:17 +0800)
committerluozheng <1732036298@qq.com>
Tue, 24 Jun 2025 04:17:28 +0000 (12:17 +0800)
27 files changed:
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/include/dial/DialModelChargeC.h [new file with mode: 0644]
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dial/DialModelCharge.cpp
code/sdk/application/wearable/fd230/service/msg_center/CMakeLists.txt
code/sdk/application/wearable/fd230/service/msg_center/src/msg_center_customer.cpp
code/sdk/zhihui/UI/producttest/include/testA5133.h
code/sdk/zhihui/UI/producttest/include/testGPS.h
code/sdk/zhihui/UI/producttest/include/testLCD.h
code/sdk/zhihui/UI/producttest/include/testPing.h
code/sdk/zhihui/UI/producttest/include/testSEChipTest.h
code/sdk/zhihui/UI/producttest/include/testTP.h
code/sdk/zhihui/UI/producttest/include/testView.h
code/sdk/zhihui/UI/producttest/include/testabout.h
code/sdk/zhihui/UI/producttest/include/testbt.h
code/sdk/zhihui/UI/producttest/include/testbutton.h
code/sdk/zhihui/UI/producttest/include/testcat1.h
code/sdk/zhihui/UI/producttest/include/testchanging.h
code/sdk/zhihui/UI/producttest/include/testchangingC.h [new file with mode: 0644]
code/sdk/zhihui/UI/producttest/include/testgsenson.h
code/sdk/zhihui/UI/producttest/include/testhrsenson.h
code/sdk/zhihui/UI/producttest/include/testluminance.h
code/sdk/zhihui/UI/producttest/include/testmagnetic.h
code/sdk/zhihui/UI/producttest/include/testmicrophone.h
code/sdk/zhihui/UI/producttest/include/testmotor.h
code/sdk/zhihui/UI/producttest/include/testold.h
code/sdk/zhihui/UI/producttest/include/testpressure.h
code/sdk/zhihui/UI/producttest/include/testspeak.h
code/sdk/zhihui/UI/producttest/src/testchanging.cpp

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 (file)
index 0000000..f9c5895
--- /dev/null
@@ -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
index abe3920..1e89666 100644 (file)
@@ -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 */
index 01d5104..f826ec6 100644 (file)
@@ -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)
index c9c7a39..6ceedcf 100644 (file)
@@ -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
 
 #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
 }
 
 /*低电量提醒*/
index 611ad75..87d4f84 100644 (file)
@@ -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"
index f95c79b..d287853 100644 (file)
@@ -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"
index 2d655c7..90cee71 100644 (file)
@@ -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"
index f7be833..3bdec1d 100644 (file)
@@ -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"
index a431acc..e8bbe00 100644 (file)
@@ -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"
index 0c3c96f..dfd3c05 100644 (file)
@@ -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"
index c0e420a..53f060c 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef TEST_VIEW_H\r
 #define TEST_VIEW_H\r
 \r
-#include "BaseView.h"\r
+\r
 #include "View.h"\r
 \r
 #include "components/ui_view_group.h"\r
index 4dc8630..35cb5c6 100644 (file)
@@ -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"
index d4120bf..4cf8d32 100644 (file)
@@ -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"
index 0a3d4da..284e5f7 100644 (file)
@@ -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"
index d4263ad..d38f5eb 100644 (file)
@@ -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"
index 730c3bc..959bdf0 100644 (file)
@@ -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 (file)
index 0000000..7b0f792
--- /dev/null
@@ -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
index d4bc8f5..599a773 100644 (file)
@@ -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"
index 4ba83b9..2626277 100644 (file)
@@ -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"
index ff3b740..444101a 100644 (file)
@@ -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"
index d0ef55b..e3c0304 100644 (file)
@@ -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"
index 9a6d876..818db62 100644 (file)
@@ -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"
index cb68649..782b2b3 100644 (file)
@@ -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"
index c0dfed1..d8a7596 100644 (file)
@@ -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"
index a864079..3bbd6b1 100644 (file)
@@ -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"
index 7c5e977..c565d57 100644 (file)
@@ -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"
index 24efbe7..4d108eb 100644 (file)
@@ -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