From 8d13ddb2fa6458553cf1ddd20669a7bf779d5b32 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 20 Oct 2025 17:13:20 +0800 Subject: [PATCH] =?utf8?q?1.=E7=A6=85=E9=81=931454=EF=BC=8C=E8=A7=A3?= =?utf8?q?=E5=86=B3=E6=89=8B=E8=A1=A8-=E6=89=8B=E8=A1=A8=E4=B8=8E=E6=89=8B?= =?utf8?q?=E6=9C=BA=E8=BF=9E=E6=8E=A5=E7=8A=B6=E6=80=81=E6=9C=89=E6=97=B6?= =?utf8?q?=E5=80=99=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= =?utf8?q?=202.=E8=A7=A3=E5=86=B3=E9=95=BF=E6=8C=89=E5=8A=9F=E8=83=BD?= =?utf8?q?=E9=94=AEsos=E7=95=8C=E9=9D=A2=E6=97=A0=E6=B3=95=E6=98=BE?= =?utf8?q?=E7=A4=BA=E9=97=AE=E9=A2=98=203.fd230=EF=BC=8Cn9=EF=BC=8C272?= =?utf8?q?=EF=BC=8C=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9=E4=B8=8A=E8=BF=B0?= =?utf8?q?=E9=97=AE=E9=A2=98=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../src/RebootAndShutdownModel.cpp | 20 ++-- .../src/RebootAndShutdownModel.cpp | 96 ++++++++++++++++--- .../src/RebootAndShutdownModel.cpp | 90 +++++++++++++++-- 3 files changed, 174 insertions(+), 32 deletions(-) diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp index 402fb5d27..0ded82eb4 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp @@ -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(); } diff --git a/code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp b/code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp index b55fc95bb..6c4732527 100644 --- a/code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp +++ b/code/sdk/application/wearable/fd272/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp @@ -22,10 +22,13 @@ #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(); } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp index 1fd98fa0c..4b3fe8097 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownModel.cpp @@ -23,10 +23,13 @@ #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(); } -- 2.17.1