cat1相关代码添加SUPPORT_CAT1_SERVICE宏控制 1748/1
authorluozheng <1732036298@qq.com>
Sat, 10 May 2025 02:09:50 +0000 (10:09 +0800)
committerluozheng <1732036298@qq.com>
Tue, 13 May 2025 03:13:16 +0000 (11:13 +0800)
20 files changed:
code/sdk/application/wearable/dsoftbus_deps/dsoftbus/socket.c
code/sdk/application/wearable/fd230/nativeapp/nativeui/callerlog/src/CallerLogModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/displaybrightness/src/DisplayBrightnessPresent.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/dropdown/DropDownCardPage1.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/CallingView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/MainCallingPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/makephone/src/WaitingHintsView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/networkandcall/src/NetworkAndCallView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/DialingMethodPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/phone/src/PhoneCallPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/SystemPresenter.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/include/Systemupgrade.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/SystemModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/system/src/Systemupgrade.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateModel.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/systemupdate/src/SystemUpdateView.cpp
code/sdk/zhihui/4g/cat1Service/Service/cat1_ctl.c
code/sdk/zhihui/utils/custom_utils.c
code/sdk/zhihui/utils/custom_utils_at_cmd.c

index 4a70d73..604f77b 100644 (file)
@@ -9,6 +9,7 @@
 #include <netinet/in.h>
 #include <byteswap.h>
 
+#ifndef SUPPORT_CAT1_SERVICE
 int socket(int domain, int type, int protocol)
 {
     return 0;
@@ -91,3 +92,5 @@ uint32_t htonl(uint32_t n)
     union { int i; char c; } u = { 1 };
     return u.c ? bswap_32(n) : n;
 }
+
+#endif
\ No newline at end of file
index adcb138..511b5a3 100644 (file)
 #include "dial_sos_c.h"
 #endif
 
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
 #include "cat1_server.h"
+#endif
 #include "AlarmClockModel.h"
 
 #ifdef SUPPORT_PHONE_SERVICE
@@ -160,7 +162,9 @@ void StatusReset(void)
     NotificationManager::GetInstance()->SetWatchCallStatus(false);
    
     DisshakeTimer();
+    #ifdef SUPPORT_CAT1_SERVICE
     set_call_hungup_flag(0);
+    #endif
 
     #ifdef FD230_650
     set_TransCallToMobilePhone_falg(0);
@@ -270,6 +274,7 @@ static void CallTimerCallbackProc(int data)
        
        
         {
+            #ifdef SUPPORT_CAT1_SERVICE
             if(get_call_hungup_flag()>=2)
             {
                 cat1_handle_call_disconnected((char *)CallerLogModel::GetInstance()->GetPhoneNumber().c_str());
@@ -278,6 +283,7 @@ static void CallTimerCallbackProc(int data)
             {
                 set_call_hungup_flag(get_call_hungup_flag()+1);
             }
+            #endif
         }
        
    }
index 99a286d..c971b7f 100644 (file)
@@ -13,7 +13,9 @@
 #include "graphic_math.h"\r
 #include "string.h"\r
 #include "displaybrightness/include/DisplayBrightnessPresenter.h"\r
+#ifdef SUPPORT_CAT1_SERVICE\r
 #include "cat1_ctl.h"\r
+#endif\r
 #include "displaybrightness/include/DisplayBrightnessModel.h"\r
 #include "power_display_service.h"\r
 #include "common/key_code.h"\r
index 3b89ea1..83d0ef5 100644 (file)
 #include "ConfigModel.h"
 
 extern "C" {
+    #ifdef SUPPORT_CAT1_SERVICE
     #include "cat1_ctl.h"
     bool cat1_api_is_cat1_enabled(void);
+    #else    
+    bool cat1_api_is_cat1_enabled(void){return false;};
+    #endif
 }
 
 #include "dnotdisturb/include/DnotDisturbModel.h"
index 1414afe..0af0880 100644 (file)
@@ -9,8 +9,10 @@
 #include "wearable_log.h"
 #include "UiConfig.h"
 #include "PhoneService.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_server.h"
 #include "cat1_server_hal.h"
+#endif
 #include "custom_utils.h"
 
 #include "phone/include/phoneaddressmodel.h"
index a6dd3d1..1f260fc 100644 (file)
 #include "MainCallingView.h"
 #include "PhoneService.h"
 #include "WaitingHintsView.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_server.h"
 #include "cat1_server_hal.h"
+#endif
 #include "custom_utils.h"
 
 
index 580011a..c2a6170 100644 (file)
 
 #include "wearable_log.h"
 #include "PhoneService.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_server.h"
 #include "cat1_server_hal.h"
+#endif
 
 #include "phone/include/phoneaddressmodel.h"
 
index 0f37f1a..4f7fbf4 100644 (file)
 #include "networkandcall/include/NetworkAndCallC.h"
 
 extern "C" {
+    #ifdef SUPPORT_CAT1_SERVICE
     #include "cat1_ctl.h"
     bool cat1_api_is_cat1_enabled(void);
+    #endif
 }
 
 #include "NativeRegisterManager.h"
@@ -100,7 +102,11 @@ namespace OHOS
                     {
                         uapi_set4GCapability(true);
                  
+                        #ifdef SUPPORT_CAT1_SERVICE
                         ConfigModel::GetInstance()->SetCat1_4Gability(cat1_api_is_cat1_enabled());
+                        #else
+                        ConfigModel::GetInstance()->SetCat1_4Gability(false);
+                        #endif
                     
                         if(p_NetworkAndCallView->GetVoLTEToggleButton())
                         {
index 4769041..32a6b8e 100644 (file)
@@ -5,8 +5,10 @@
 #include "ConfigModel.h"
 
 extern "C" {
+    #ifdef SUPPORT_CAT1_SERVICE
     #include "cat1_ctl.h"
     bool cat1_api_is_cat1_enabled(void);
+    #endif
 }
 
 #include "ui_resource_string.h"
@@ -178,7 +180,11 @@ namespace OHOS
                 MobileData_toggleButton->SetPosition(298, 145, 100, 50);
             }
          
+            #ifdef SUPPORT_CAT1_SERVICE
             MobileData_toggleButton->SetState(cat1_api_is_cat1_enabled());
+            #else
+            MobileData_toggleButton->SetState(ConfigModel::GetInstance()->GetCat1_4Gability());
+            #endif
            
             MobileData_toggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0x00);
             MobileData_toggleButton->SetImages(PNG_TOGGLEBUTTON_ON_IMAGE, PNG_TOGGLEBUTTON_OFF_IMAGE);
index 7e59586..9493d25 100644 (file)
 #include <custom_utils.h>
 #include "phone/include/TelephonyInitInterface.h"
 #include "phone/include/phoneaddressmodel.h"
-#include "cat1_server_hal.h"
 #include "PhoneService.h"
 #include "custom_runtime.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
+#include "cat1_server_hal.h"
+#endif
 #include "NativeRegisterManager.h"
 
 namespace OHOS
index b96f9a0..c3a63dc 100644 (file)
@@ -5,7 +5,9 @@
 #include "string"\r
 #include "phone/include/PhoneCallPresenter.h"\r
 #include <iostream>\r
+#ifdef SUPPORT_CAT1_SERVICE\r
 #include "cat1_server_hal.h"\r
+#endif\r
 #include "PhoneService.h"\r
 #include "phone/include/PhoneCallView.h"\r
 #include "phone/include/TelephonyInitInterface.h"\r
index e628ae3..61fa326 100644 (file)
@@ -14,7 +14,9 @@
 #include "system/include/SystemModel.h"\r
 #include "components/ui_radio_button.h"\r
 #include "KeyInputListener.h"\r
-  #include "cat1_ctl.h"\r
+#ifdef SUPPORT_CAT1_SERVICE\r
+#include "cat1_ctl.h"\r
+#endif\r
 \r
 namespace OHOS\r
 {\r
index b476a30..634c7a4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef SYSTEM_UPGRADE_VIEW_H
 #define SYSTEM_UPGRADE_VIEW_H
 
-
+#ifndef XTS_SUPPORT
 #include "View.h"
 
 #include "components/ui_image_view.h"
@@ -132,4 +132,5 @@ namespace OHOS
         bool initViewStatus{false};
     };
 } // namespace OHOS
+#endif
 #endif
\ No newline at end of file
index dd49248..1822377 100644 (file)
@@ -9,14 +9,17 @@
 #include <fstream>
 #include "cJSON.h"
 #include "ConfigModel.h"
-#include "lwip/err.h"
 #include "power_display_service.h"
 #include "cmsis_os2.h"
 #include "los_memory.h"
 #include "thread_init.h"
- #include "lwip/apps/http_client.h"
+
  #include "tcxo.h"
+ #ifdef SUPPORT_CAT1_SERVICE
  #include "cat1_server.h"
+ #include "lwip/err.h"
+#include "lwip/apps/http_client.h"
+ #endif
  #include "linux/delay.h"
 
 #define UPDATAREPORT_M UPDATAREPORT
index 0d3afcc..bc5531e 100644 (file)
@@ -1,3 +1,5 @@
+#ifndef XTS_SUPPORT
+
 #include "system/include/Systemupgrade.h"
 #include "system/include/SystemPresenter.h"
 #include "wearable_log.h"
@@ -949,4 +951,5 @@ namespace OHOS
         return scrollView;
     }
 
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
index 678c2b1..566b3ce 100644 (file)
 #include "stdio.h"
 #include "cJSON.h"
 #include "ConfigModel.h"
-#include "lwip/err.h"
 #include "power_display_service.h"
 #include "cmsis_os2.h"
 #include "los_memory.h"
 #include "thread_init.h"
-#include "lwip/apps/http_client.h"
 #include "tcxo.h"
-#include "cat1_server.h"
 #include "linux/delay.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
+#include "cat1_server.h"
+#include "lwip/apps/http_client.h"
+#include "lwip/err.h"
+#endif
 #include "AppViewIDs.h"
 #include "NativeAbility.h"
 namespace OHOS
index bfecb0a..e835711 100644 (file)
 #include <fstream>
 #include "cJSON.h"
 #include "ConfigModel.h"
-#include "lwip/err.h"
 #include "power_display_service.h"
 #include "cmsis_os2.h"
 #include "los_memory.h"
 #include "thread_init.h"
-#include "lwip/apps/http_client.h"
 #include "tcxo.h"
-#include "cat1_server.h"
 #include "linux/delay.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
 #include "cat1_server_hal.h"
+#include "cat1_server.h"
+#include "lwip/apps/http_client.h"
+#include "lwip/err.h"
+#endif
 #include "bts_le_gap.h"
 #include "custom_http_download.h"
 
@@ -54,7 +56,8 @@ namespace OHOS
 
     static SystemUpdateView *g_pSystemUpdateView{nullptr};
 
-    
+#ifdef SUPPORT_CAT1_SERVICE
+
     static osThreadId_t g_alipay_task_handle = NULL;
     //static char * imei_str="864430010001091";
 //     osThreadAttr_t g_alipay_attr = {
@@ -288,6 +291,7 @@ namespace OHOS
         }
     }
 
+#endif
 
     SystemUpdateView::SystemUpdateView()
     {
@@ -383,12 +387,16 @@ namespace OHOS
         switch (falg_id)
         {
           case OTA_BUTTON_GET_VISON://开始获取升级
+#ifdef SUPPORT_CAT1_SERVICE
             start_get_updata_json();
+#endif
             SystemUpdateModel ::GetInstance().button_flag=OTA_BUTTON_GET_VISON_ING;
             break;
         case OTA_BUTTON_GET_ABLE_DOWNLOAD://开始下载升级包
+#ifdef SUPPORT_CAT1_SERVICE
             start_get_updata_fwpkg();
             start_dwonload();
+#endif
             break;
         case OTA_BUTTON_GET_ABLE_UPDTAT:
             #if OTA_UPDATA_TEST
index 7c0fd98..9650480 100644 (file)
@@ -3,7 +3,9 @@
 #include "platform_core.h"
 #include "stdint.h"
 #include "pinctrl.h"
+#ifdef SUPPORT_CAT1_SERVICE
 #include "cat1_ctl.h"
+#endif
 #include "gpio.h"
 #include "gpio_porting.h"
 #include "tcxo.h"
index de7cad8..df1eecd 100644 (file)
@@ -1488,7 +1488,9 @@ void uapi_set4GCapability(bool isopen)
     void *tcp_thread_id = NULL;
     if(isopen)
     {
+        #ifdef SUPPORT_CAT1_SERVICE
         power_on_cat1();
+        #endif
         // if(!uapi_dev_runtime_get_saveele_status())
         {
             uapi_dev_runtime_set_cat1_powerstat(1);
@@ -1507,7 +1509,9 @@ void uapi_set4GCapability(bool isopen)
     }
     else
     {
+        #ifdef SUPPORT_CAT1_SERVICE
         power_off_cat1();
+        #endif
         // if(!uapi_dev_runtime_get_saveele_status())
         {
             uapi_dev_runtime_set_cat1_powerstat(0);
index 2e6dbaf..f48ff0b 100644 (file)
@@ -452,7 +452,9 @@ static uint32_t custom_utils_pdudec(uint8_t *para, uint32_t paraLen, char *strCo
     const char *inpdustr = (const char*)argv[0];
      
     
+    #ifdef SUPPORT_CAT1_SERVICE
     pdu_decode_example(inpdustr,0,0,0);
+    #endif
 
     return ERRCODE_SUCC;
 }