1.禅道1454,解决手表-手表与手机连接状态有时候显示异常问题
authorluozheng <1732036298@qq.com>
Mon, 20 Oct 2025 09:13:20 +0000 (17:13 +0800)
committerluozheng <1732036298@qq.com>
Mon, 20 Oct 2025 09:13:20 +0000 (17:13 +0800)
2.解决长按功能键sos界面无法显示问题
3.fd230,n9,272,同步修改上述问题代码

code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp
code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp

index 402fb5d..0ded82e 100644 (file)
@@ -29,9 +29,7 @@
 #include "cywee_service.h"
 #endif
 
-#ifdef FD230_650
 #include "dial_sos_c.h"
-#endif
 
 #include "broadcast_feature.h"
 #include "notification_manager.h"
@@ -128,13 +126,6 @@ namespace OHOS
         }
     }
 
-    void HandWatchFirstTimePaired(void)
-    {
-        SendMsgToUIService(UI_HAND_WATCH_FIRST_PAIRED, 0, nullptr, 0);
-    }
-
-
-
 #ifdef __cplusplus
     extern "C"
     {
@@ -146,6 +137,11 @@ namespace OHOS
     #include "bleEvent.h"
     #include "bleInstruct.h"
 
+    void hand_watch_first_time_Paired_(void)
+    {
+        SendMsgToUIService(UI_HAND_WATCH_FIRST_PAIRED, 0, nullptr, 0);
+    }
+
     void ble_connect_ok_(void)
     {
         SendMsgToUIService(PHONE_CONNECTED_TO_UI, 0, nullptr, 0);
@@ -212,7 +208,7 @@ namespace OHOS
 
     void ble_watch_first_paired(void)
     {
-        bleInstruct_t.hand_watch_first_time_Paired = HandWatchFirstTimePaired;
+        bleInstruct_t.hand_watch_first_time_Paired = hand_watch_first_time_Paired_;
         bleInstruct_t.ble_connect_ok = ble_connect_ok_;
         bleInstruct_t.ble_disconnect_ok = ble_disconnect_ok_;
         bleInstruct_t.Set_RaiseToWake = Set_RaiseToWake_; 
@@ -435,16 +431,14 @@ namespace OHOS
 
     static void SOSKeyLongPress(void)
     {
-        #ifdef FD230_650
         start_SOS_phone_dail();
-        #endif
     }
 
     static void HandFuncKeyOnLongPress(void)
     {
         if (HandleAlarmOrFindWatchNotify())
             return;
-        // GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
+        GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
         SOSKeyLongPress();
     }
 
index b55fc95..6c47325 100644 (file)
 #include "bleService.h"
 #endif
 #include "uiservice/include/ui_service.h"
+#include "custom_runtime.h"
+#include "ConfigModelC.h"
+#ifdef SUPPORT_CYWEE_SERVICE
+#include "cywee_service.h"
+#endif
 
-#ifdef FD230_650
 #include "dial_sos_c.h"
-#endif
 
 #include "broadcast_feature.h"
 #include "notification_manager.h"
@@ -122,13 +125,6 @@ namespace OHOS
         }
     }
 
-    void HandWatchFirstTimePaired(void)
-    {
-        SendMsgToUIService(UI_HAND_WATCH_FIRST_PAIRED, 0, nullptr, 0);
-    }
-
-
-
 #ifdef __cplusplus
     extern "C"
     {
@@ -139,9 +135,85 @@ namespace OHOS
 #ifdef BLE_INSTRUCT
     #include "bleEvent.h"
     #include "bleInstruct.h"
+    void hand_watch_first_time_Paired_(void)
+    {
+        SendMsgToUIService(UI_HAND_WATCH_FIRST_PAIRED, 0, nullptr, 0);
+    }
+
+    void ble_connect_ok_(void)
+    {
+        SendMsgToUIService(PHONE_CONNECTED_TO_UI, 0, nullptr, 0);
+    }
+
+    void ble_disconnect_ok_(void)
+    {
+        SendMsgToUIService(PHONE_DISCONNECTED_TO_UI, 0, nullptr, 0);
+    }
+
+    void Set_RaiseToWake_(bool value) //抬婉亮屏开关 
+    {
+        if(uapi_sleep_mode_flag_get())
+        {
+            return;
+        }
+
+        mmi_flip_wrist_switch_set(value);
+        if(true == value)
+        {
+    #ifdef SUPPORT_CYWEE_SERVICE
+                cywee_hand_wake_switch(1); // 关闭抬腕亮屏,和息屏
+    #endif
+        }
+        else
+        {
+    #ifdef SUPPORT_CYWEE_SERVICE
+                cywee_hand_wake_switch(0); // 关闭抬腕亮屏,和息屏
+    #endif
+        }
+
+        SendMsgToUIService(UI_UPDATE_RAISETOBRIGHTNESS,0,nullptr,0);
+        return;
+    }
+
+    int Get_RaiseToWake_(void) //获取抬婉亮屏开关 
+    {
+        return mmi_flip_wrist_switch_get();
+    }
+
+    void Set_SystemVolume_(int value) //设置系统音量
+    {
+        uapi_systemVolumeSet(value);
+        SendMsgToUIService(UI_UPDATE_SYSTEM_VOLUME,0,nullptr,0);
+        return;
+    }
+
+    int Get_SystemVolume_(void) //获取系统音量
+    {
+        return uapi_systemVolumeGet();
+    }
+    void Set_CallVolume_(int value) //设置通话音量
+    {
+        uapi_callVolumeSet(value);
+        SendMsgToUIService(UI_UPDATE_CALL_VOLUME,0,nullptr,0);
+        return;
+    }
+
+    int Get_CallVolume_(void) //获取通话音量
+    {
+        return uapi_callVolumeGet();
+    }
+
     void ble_watch_first_paired(void)
     {
-        bleInstruct_t.hand_watch_first_time_Paired = HandWatchFirstTimePaired;
+        bleInstruct_t.hand_watch_first_time_Paired = hand_watch_first_time_Paired_;
+        bleInstruct_t.ble_connect_ok = ble_connect_ok_;
+        bleInstruct_t.ble_disconnect_ok = ble_disconnect_ok_;
+        bleInstruct_t.Set_RaiseToWake = Set_RaiseToWake_; 
+        bleInstruct_t.Get_RaiseToWake = Get_RaiseToWake_;
+        bleInstruct_t.Set_SystemVolume = Set_SystemVolume_;
+        bleInstruct_t.Get_SystemVolume = Get_SystemVolume_;
+        bleInstruct_t.Set_CallVolume = Set_CallVolume_;
+        bleInstruct_t.Get_CallVolume = Get_CallVolume_;
     }
 #endif
 
@@ -352,16 +424,14 @@ namespace OHOS
 
     static void SOSKeyLongPress(void)
     {
-        #ifdef FD230_650
         start_SOS_phone_dail();
-        #endif
     }
 
     static void HandFuncKeyOnLongPress(void)
     {
         if (HandleAlarmOrFindWatchNotify())
             return;
-        // GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
+        GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
         SOSKeyLongPress();
     }
 
index 1fd98fa..4b3fe80 100644 (file)
 #include "bleService.h"
 #endif
 #include "uiservice/include/ui_service.h"
+#include "custom_runtime.h"
+#include "ConfigModelC.h"
+#ifdef SUPPORT_CYWEE_SERVICE
+#include "cywee_service.h"
+#endif
 
-#ifdef FD230_650
 #include "dial_sos_c.h"
-#endif
 
 #include "broadcast_feature.h"
 #include "notification_manager.h"
@@ -140,9 +143,86 @@ namespace OHOS
 #ifdef BLE_INSTRUCT
     #include "bleEvent.h"
     #include "bleInstruct.h"
+
+    void hand_watch_first_time_Paired_(void)
+    {
+        SendMsgToUIService(UI_HAND_WATCH_FIRST_PAIRED, 0, nullptr, 0);
+    }
+
+    void ble_connect_ok_(void)
+    {
+        SendMsgToUIService(PHONE_CONNECTED_TO_UI, 0, nullptr, 0);
+    }
+
+    void ble_disconnect_ok_(void)
+    {
+        SendMsgToUIService(PHONE_DISCONNECTED_TO_UI, 0, nullptr, 0);
+    }
+
+    void Set_RaiseToWake_(bool value) //抬婉亮屏开关 
+    {
+        if(uapi_sleep_mode_flag_get())
+        {
+            return;
+        }
+
+        mmi_flip_wrist_switch_set(value);
+        if(true == value)
+        {
+    #ifdef SUPPORT_CYWEE_SERVICE
+                cywee_hand_wake_switch(1); // 关闭抬腕亮屏,和息屏
+    #endif
+        }
+        else
+        {
+    #ifdef SUPPORT_CYWEE_SERVICE
+                cywee_hand_wake_switch(0); // 关闭抬腕亮屏,和息屏
+    #endif
+        }
+
+        SendMsgToUIService(UI_UPDATE_RAISETOBRIGHTNESS,0,nullptr,0);
+        return;
+    }
+
+    int Get_RaiseToWake_(void) //获取抬婉亮屏开关 
+    {
+        return mmi_flip_wrist_switch_get();
+    }
+
+    void Set_SystemVolume_(int value) //设置系统音量
+    {
+        uapi_systemVolumeSet(value);
+        SendMsgToUIService(UI_UPDATE_SYSTEM_VOLUME,0,nullptr,0);
+        return;
+    }
+
+    int Get_SystemVolume_(void) //获取系统音量
+    {
+        return uapi_systemVolumeGet();
+    }
+    void Set_CallVolume_(int value) //设置通话音量
+    {
+        uapi_callVolumeSet(value);
+        SendMsgToUIService(UI_UPDATE_CALL_VOLUME,0,nullptr,0);
+        return;
+    }
+
+    int Get_CallVolume_(void) //获取通话音量
+    {
+        return uapi_callVolumeGet();
+    }
+
     void ble_watch_first_paired(void)
     {
-        bleInstruct_t.hand_watch_first_time_Paired = HandWatchFirstTimePaired;
+        bleInstruct_t.hand_watch_first_time_Paired = hand_watch_first_time_Paired_;
+        bleInstruct_t.ble_connect_ok = ble_connect_ok_;
+        bleInstruct_t.ble_disconnect_ok = ble_disconnect_ok_;
+        bleInstruct_t.Set_RaiseToWake = Set_RaiseToWake_; 
+        bleInstruct_t.Get_RaiseToWake = Get_RaiseToWake_;
+        bleInstruct_t.Set_SystemVolume = Set_SystemVolume_;
+        bleInstruct_t.Get_SystemVolume = Get_SystemVolume_;
+        bleInstruct_t.Set_CallVolume = Set_CallVolume_;
+        bleInstruct_t.Get_CallVolume = Get_CallVolume_;
     }
 #endif
 
@@ -357,16 +437,14 @@ namespace OHOS
 
     static void SOSKeyLongPress(void)
     {
-        #ifdef FD230_650
         start_SOS_phone_dail();
-        #endif
     }
 
     static void HandFuncKeyOnLongPress(void)
     {
         if (HandleAlarmOrFindWatchNotify())
             return;
-        // GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
+        GraphicService::GetInstance()->PostGraphicEvent(std::bind(SOSKeyLongPress));
         SOSKeyLongPress();
     }