部分头文件加相应宏 3411/1 3411/head 3433/target/1 3436/target/1
authorluozheng <1732036298@qq.com>
Tue, 12 May 2026 09:08:42 +0000 (17:08 +0800)
committerluozheng <1732036298@qq.com>
Tue, 12 May 2026 09:08:42 +0000 (17:08 +0800)
13 files changed:
code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoiceModel.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/codedlock/include/CodedLockModel.h
code/sdk/application/wearable/n9/nativeapp/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/message/src/MessageModel.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/rebootandshutdown/src/RebootAndShutdownPresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/schedule/src/SchedulePresenter.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/traing/src/TraingModel.cpp
code/sdk/application/wearable/n9/service/msg_center/src/msg_center_customer.cpp
code/sdk/application/wearable/n9/service/msg_center/src/notify/phone_crt.cpp

index 7f6d834..ce8d782 100644 (file)
@@ -34,7 +34,9 @@
 #include "custom_runtime.h"
 #include "voice_call_volte_sample_wrapper.h"
 #include <los_base.h>
+#ifdef SUPPORT_CAT1_SERVICE
 #include "websocket_server_manager.h"
+#endif
 #include "font/ui_font.h"
 
 namespace OHOS
@@ -962,7 +964,9 @@ namespace OHOS
             WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "type = %d", type);
             if (AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_BT)
             {
+                #ifdef SUPPORT_AI_SERVICE
                 streamingRecordAndSend_AI(type); // 实时发送录音数据
+                #endif
             }
             else if (AiVoiceModel::GetInstance().GetSelect4gorbt() == AI_SELECT_4G)
             {
@@ -1005,10 +1009,12 @@ namespace OHOS
         else if (GetSelect4gorbt() == AI_SELECT_BT)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "停止录音BT");
+            #ifdef SUPPORT_AI_SERVICE
             int32_t argc = 1;
             uint8_t *argv = (uint8_t *)"stop";
             AudioCaptureSample(argc, (const char **)&argv);
             StopStreamingRecordAndSend_AI();
+            #endif
         }
         uapi_save_runtime_log(RUNTIME_LOG_RECORD_STOP_AI); // TOOD*
         return;
@@ -1382,8 +1388,9 @@ namespace OHOS
                 if (AiVoiceModel::GetInstance().GetInit_4gai_task())
                 {
                     uint8_t state = 0;
-                    // state = get_asr_is_ready_start();
+#ifdef SUPPORT_CAT1_SERVICE
                     state = get_asr_is_ready_start_old();
+#endif
                     if (state)
                     {
                         bool state = true;
@@ -1846,7 +1853,9 @@ namespace OHOS
     }
     bool AiVoiceModel::GetInit_4gai_task(void)
     {
+#ifdef SUPPORT_CAT1_SERVICE
         init_4gai_task = are_all_services_ready();
+#endif
         return init_4gai_task;
     }
 
index 9cff9ab..1119e4f 100644 (file)
@@ -18,7 +18,7 @@
 #include <unordered_map> // For std::unordered_map
 
 #ifdef SUPPORT_BLE_SERVICE
-#include <bleEvent.h>
+#include "bleEvent.h"
 #include "bleService.h"
 #endif
 
@@ -28,7 +28,9 @@
 #include "NativeRegisterManager.h"
 #include "aivoice/include/AiVoiceSelectView.h"
 #include "graphic_service.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "websocket_server_manager.h"
+#endif
 #include "custom_utils.h"
 namespace OHOS
 {
@@ -103,7 +105,9 @@ namespace OHOS
         add_4GAI_vote(); // 4g投票
 
         net4g_AI_init();
+        #ifdef SUPPORT_BLE_SERVICE
         uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_HIGH_AI);
+        #endif
         Audio::AudioManager::GetInstance().SetVolume(AUDIO_STREAM_VOICE_ASSISTANT, 100);
     }
 
@@ -128,7 +132,9 @@ namespace OHOS
         uapi_destroy_all_websocket_servers();
 #endif
 
+        #ifdef SUPPORT_BLE_SERVICE
         uapi_ble_connect_param_update(BLE_CONNECT_INTERVAL_SLOW);
+        #endif
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "AiVoicePresenter::OnStop end");
         return;
     }
index a55e4e3..5ec8378 100644 (file)
@@ -376,17 +376,21 @@ void CallingView::showdial(bool flag)
 void CallingView::text_updata_buf(const char *buf)
 {
     if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1){
-    SendDtfmStrNumberToCat1(buf[0]);
+        #ifdef SUPPORT_CAT1_SERVICE
+        SendDtfmStrNumberToCat1(buf[0]);
+        #endif
     }
     else{
-    uapi_hfp_send_DTMF_CODE(buf[0]);
+        #ifdef SUPPORT_HFP_SERVICE
+        uapi_hfp_send_DTMF_CODE(buf[0]);
+        #endif
     }
     
     char new_buf[16]={0};
     const char*text_buf=label_number->GetText();
     sprintf_s(new_buf,16,"%s%s",text_buf,buf);
     label_number->SetText(new_buf);
-   RootView::GetInstance()->Invalidate();
+    RootView::GetInstance()->Invalidate();
 
     return;
 }
index 2189e8e..03999aa 100644 (file)
@@ -248,7 +248,9 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
 
                 //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
 
+                #ifdef SUPPORT_CAT1_SERVICE
                 cat1_call_hungup_timer();
+                #endif
                 
 
             }
@@ -266,7 +268,9 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
             if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
             {
                     //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
+                    #ifdef SUPPORT_CAT1_SERVICE
                     cat1_call_hungup_timer();
+                    #endif
                     return true;
                 //#endif
 
@@ -294,11 +298,11 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
 
             if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
             {
-                    //cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
-                    cat1_call_hungup_timer();
+                #ifdef SUPPORT_CAT1_SERVICE
+                cat1_call_hungup_timer();
+                #endif
                     
-                    return true;
-                //#endif
+                return true;
 
             }else
             {
@@ -315,8 +319,10 @@ bool MainCallingPresenter::OnClick(UIView& view, const ClickEvent& event)
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "MainCallingPresenter::phone calling");
         if (CallerLogModel::GetInstance()->GetCallSource() == CallerLogModel::CallSourceCat1)
         {
+            #ifdef SUPPORT_CAT1_SERVICE
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "MakephoneNotify 11111111 ");
             cat1_call_answer();
+            #endif
             return true;
 
             //#endif
index 42d3462..a371925 100644 (file)
@@ -319,7 +319,9 @@ uint8_t MessageModel::GetMessageCount() const { return numberOfItems; }
 // 加载Message文件
 bool MessageModel::LoadMessagesFromStorage() {
   // 加载消息过滤文件
+  #ifdef SUPPORT_BLE_SERVICE
   filtration_file_read();
+  #endif
 
   std::ifstream file(MESSAGE_JSON_FILE);
   if (!file.is_open()) {
@@ -408,7 +410,9 @@ bool MessageModel::LoadMessagesFromStorage() {
 // 保存Message文件
 bool MessageModel::SaveMessagesToStorage() {
   // 消息过滤文件保存
+  #ifdef SUPPORT_BLE_SERVICE
   filtration_file_save();
+  #endif
   if (MessageVector.empty()) {
     // 清空文件
     std::ofstream file(MESSAGE_JSON_FILE,
index f19d4ef..d115bef 100644 (file)
@@ -65,7 +65,7 @@ namespace OHOS
 
             if(get_address_number())
             {
-                // if(uapi_cat1_get_power_stat()==0 || 
+                #ifdef SUPPORT_CAT1_SERVICE
                 if(uapi_dev_runtime_get_cat1_simstat()==0)
                 {
                     DialingMethodView::GetInstance()->fail_Dial_show(0);
@@ -74,11 +74,11 @@ namespace OHOS
                 {
                     cat1_UI_call_dial(get_address_number());
                 }
-                
+                #endif
             }
             else
             {
-                // if(uapi_cat1_get_power_stat()==0 || 
+                #ifdef SUPPORT_CAT1_SERVICE
                 if(uapi_dev_runtime_get_cat1_simstat()==0)
                 {
                     DialingMethodView::GetInstance()->fail_Dial_show(0);
@@ -87,7 +87,7 @@ namespace OHOS
                     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uapi_cat1_get_power_stat");
                     NativeAbility::GetInstance().EnterSlice(VIEW_PHONECALL);
                 }
-              
+                #endif
             }
             
         }
index 8a2b71f..c8c1ae3 100644 (file)
@@ -126,7 +126,9 @@ namespace OHOS
             if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGWATCHSIM)\r
             {\r
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "DIALINGMETHOD_USINGWATCHSIM");\r
+                #ifdef SUPPORT_CAT1_SERVICE\r
                 cat1_UI_call_dial((char *)phoneNumber.c_str());\r
+                #endif\r
 \r
             }\r
             else if(TelephonyInitInterface::DIALINGMETHOD == DIALINGMETHOD_USINGPHONE)\r
index f92836a..5355451 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * @Author: luozheng 1732036298@qq.com
- * @Date: 2024-06-20 15:11:17
- * @LastEditors: luozheng 1732036298@qq.com
- * @LastEditTime: 2024-10-24 20:17:39
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/RebootAndShutdownPresenter.cpp
- */
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
 #include "common/key_code.h"
index 1cbb072..3b48361 100644 (file)
@@ -1,10 +1,3 @@
-/*\r
- * @Author: luozheng 1732036298@qq.com\r
- * @Date: 2024-06-20 15:11:17\r
- * @LastEditors: luozheng 1732036298@qq.com\r
- * @LastEditTime: 2024-12-13 16:28:48\r
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/aivoice/src/SchedulePresenter.cpp\r
- */\r
 #include "AppViewIDs.h"\r
 #include "NativeAbility.h"\r
 #include "common/key_code.h"\r
index 637468f..27b482e 100644 (file)
  #endif
      /*运动结束并且是手表发起的运动*/
      if (Openingway == false) {
+       #ifdef SUPPORT_BLE_SERVICE
        sendtraningstateend();
+       #endif
      }
      /*运动结束并且是app发起的运动*/
      else {
-       sendtraningstatedata(0, sportdata->duration);
+      #ifdef SUPPORT_BLE_SERVICE
+      sendtraningstatedata(0, sportdata->duration);
+      #endif
      }
  
      WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "结束运动");
index a54eac7..b3fdbe2 100644 (file)
@@ -194,11 +194,11 @@ void MsgCenterSubscribe()
     MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_PHONE_TO_WATCH);
     MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_WATCH_TO_PHONE);
     MsgCenterSubscribeTopic(TOPIC_EVENT_HFP_HINT);
-    // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_UPDATE);
-    // MsgCenterSubscribeTopic(TOPIC_EVENT_ACTIVITY_EXTRA_INFO_UPDATE);
+    
+    #ifdef SUPPORT_CYWEE_SERVICE
     MsgCenterSubscribeTopic(TOPIC_EVENT_AR_ALERT_TYPE_UPDATE);
     MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_UPDATE);
-    // MsgCenterSubscribeTopic(TOPIC_EVENT_INACTIVITY_ACCUMULATE_TIME_UPDATE);
+    #endif
     MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRAINING);
     MsgCenterSubscribeTopic(TOPIC_EVENT_BLE_TRANSMIT);
     MsgCenterSubscribeTopic(TOPIC_EVENT_GOAL_SHOW_VIEW);
@@ -1486,6 +1486,7 @@ void MsgCenterNotifyInactivityAccumulateTimeProc(const Topic topic, Request* req
 //APP运动相关
 void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req)
 {
+    #ifdef SUPPORT_BLE_SERVICE
     unused(topic);
     uint8_t* data=(uint8_t*)req->data;
     if(data!=NULL && req->len>=2)
@@ -1506,9 +1507,7 @@ void MsgCenterNotifybleAPPtraining(const Topic topic, Request* req)
             break;
         }
     }
-
-    // unused(req);
-
+    #endif  
 }
 
 
index ddc3e8f..f31d4b7 100644 (file)
 #include "cat1_server.h"
 #include "cat1_ctl.h"
 #include "cat1_porting.h"
+#include "cat1_UI_hal.h"
 #endif
 #include "custom_runtime.h"
 
-#include "cat1_UI_hal.h"
 #include "custom_utils.h"
 #include "phone/include/phoneaddressmodel.h"
 #include "components/ui_label_button.h"
@@ -70,9 +70,9 @@ uint8_t get_falg_SOS(void)
 //结束通话运行
 void sos_falg_add(void)
 {
-    if(sos_dail_falg)
+    if (sos_dail_falg)
     {
-        if(OHOS::get_sos_number_count()<=0)
+        if (OHOS::get_sos_number_count() <= 0)
         {
 #ifdef SUPPORT_CAT1_SERVICE
             cat1_UI_call_dial("SOS");
@@ -80,33 +80,37 @@ void sos_falg_add(void)
             return;
         }
 
-        printf("sos dial %d\r\n",sos_dail_falg);
-        #if SOS_TEST_FLAG
-        if(1)
-        #else
-        if( uapi_dev_runtime_get_cat1_simstat())
-        #endif
+        printf("sos dial %d\r\n", sos_dail_falg);
+#if SOS_TEST_FLAG
+        if (1)
+#else
+        int simstat = 0;
+#ifdef SUPPORT_CAT1_SERVICE
+        simstat = uapi_dev_runtime_get_cat1_simstat();
+#endif
+        if (simstat)
+#endif
         {
 #ifdef SUPPORT_CAT1_SERVICE
-            cat1_UI_call_dial(OHOS:: get_sos_number(sos_dail_falg));
+            cat1_UI_call_dial(OHOS::get_sos_number(sos_dail_falg));
 #endif
         }
-        #if SOS_HFP_FALG
-        else if(uapi_hfp_connect_state())
+#if SOS_HFP_FALG
+        else if (uapi_hfp_connect_state())
         {
-            DialCall((unsigned char *)OHOS::get_sos_number(sos_dail_falg),osal_strlen((const char*)OHOS::get_sos_number(sos_dail_falg)));
+            DialCall((unsigned char *)OHOS::get_sos_number(sos_dail_falg), osal_strlen((const char *)OHOS::get_sos_number(sos_dail_falg)));
         }
-        #endif
+#endif
         else
         {
 #ifdef SUPPORT_CAT1_SERVICE
-             cat1_UI_call_dial("SOS");
+            cat1_UI_call_dial("SOS");
 #endif
         }
         sos_dail_falg++;
-        if(sos_dail_falg>=OHOS::get_sos_number_count()*3)
+        if (sos_dail_falg >= OHOS::get_sos_number_count() * 3)
         {
-            sos_dail_falg=0;
+            sos_dail_falg = 0;
         }
     }
 }
@@ -118,39 +122,41 @@ void sos_falg_clean(void)
 
 void start_SOS_phone_dail(void)
 {
-    if(OHOS::get_sos_number_count()<=0)
+    if (OHOS::get_sos_number_count() <= 0)
     {
 #ifdef SUPPORT_CAT1_SERVICE
         cat1_UI_call_dial("SOS");
 #endif
         return;
     }
-    #if SOS_TEST_FLAG
-    if(1)
-    #else
-    if(uapi_dev_runtime_get_cat1_simstat())
+#if SOS_TEST_FLAG
+    if (1)
+#else
+    int simstat = 0;
+    #ifdef SUPPORT_CAT1_SERVICE
+    simstat = uapi_dev_runtime_get_cat1_simstat();
     #endif
+    if (simstat)
+#endif
     {
 #ifdef SUPPORT_CAT1_SERVICE
         cat1_UI_call_dial(OHOS::get_sos_number(0));
 #endif
-         sos_dail_falg=1;
+        sos_dail_falg = 1;
     }
-    #if SOS_HFP_FALG
-    else if(uapi_hfp_connect_state())
+#if SOS_HFP_FALG
+    else if (uapi_hfp_connect_state())
     {
-        DialCall((unsigned char *)OHOS::get_sos_number(0),osal_strlen((const char*)OHOS::get_sos_number(0)));
-        sos_dail_falg=1;
+        DialCall((unsigned char *)OHOS::get_sos_number(0), osal_strlen((const char *)OHOS::get_sos_number(0)));
+        sos_dail_falg = 1;
     }
-    #endif
+#endif
     else
     {
 #ifdef SUPPORT_CAT1_SERVICE
         cat1_UI_call_dial("SOS");
 #endif
     }
-    
-   
 }