解决点击设置->蓝牙服务选项死机问题
authorluozheng <1732036298@qq.com>
Wed, 25 Jun 2025 08:42:49 +0000 (16:42 +0800)
committerluozheng <1732036298@qq.com>
Wed, 25 Jun 2025 08:42:49 +0000 (16:42 +0800)
code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h
code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp
code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp

index 6030a18..e52a852 100644 (file)
@@ -17,7 +17,7 @@
 #include "components/ui_image_view.h"
 #include "components/ui_toggle_button.h"
 
-#ifdef FD230_650
+#ifdef FD230
 #include "aivoice/include/AiVoiceConnectingView.h"
 #endif
 
@@ -80,7 +80,7 @@ namespace OHOS
         UIToggleButton *A2DP_ToggleButton{nullptr}; // A2DP
         UIScrollView *connectingScrollView{nullptr};
 
-#ifdef FD230_650
+#ifdef FD230
         AiVoiceConnectingView *p_AiVoiceConnectingView{nullptr};
 #endif
 
index c10398b..0600416 100644 (file)
@@ -86,7 +86,7 @@ namespace OHOS
                     if (it->second == "HFP")
                     {
                         ConfigModel::GetInstance()->SetHFPState(true);
-#ifdef FD230_650
+#ifdef FD230
                         uapi_hfp_connect();
 #endif
                         classicBlueToothView->init_connect_timer(BluetoothServiceOptionsView::CONNECT_HFP);
@@ -94,7 +94,7 @@ namespace OHOS
                     else if (it->second == "A2DP")
                     {
                         ConfigModel::GetInstance()->SetA2DPState(true);
-#ifdef FD230_650
+#ifdef FD230
                         uapi_a2dp_snk_connect();
 #endif
                         classicBlueToothView->init_connect_timer(BluetoothServiceOptionsView::CONNECT_A2DP);
@@ -105,7 +105,7 @@ namespace OHOS
                     if (it->second == "HFP")
                     {
                         ConfigModel::GetInstance()->SetHFPState(false);
-#ifdef FD230_650
+#ifdef FD230
                         uapi_hfp_disconnect();
 #endif
                         classicBlueToothView->init_connect_timer(BluetoothServiceOptionsView::DISCONNECT_HFP);
@@ -114,7 +114,7 @@ namespace OHOS
                     {
 
                         ConfigModel::GetInstance()->SetA2DPState(false);
-#ifdef FD230_650
+#ifdef FD230
                         uapi_a2dp_snk_disconnect();
 #endif
                         classicBlueToothView->init_connect_timer(BluetoothServiceOptionsView::DISCONNECT_A2DP);
index 9b038aa..d28a10a 100644 (file)
@@ -76,7 +76,7 @@ namespace OHOS
                     delete A2DP_ToggleButton;
                     A2DP_ToggleButton = nullptr;
                 }
-#ifdef FD230_650
+#ifdef FD230
                 if (p_AiVoiceConnectingView)
                 {
                     delete p_AiVoiceConnectingView;
@@ -110,7 +110,7 @@ namespace OHOS
         switch (button_state)
         {
         case BluetoothServiceOptionsView::CONNECT_HFP:
-#ifdef FD230_650
+#ifdef FD230
             if (uapi_hfp_connect_state())
             {
                 if (cm_get_A2DP_switch() && uapi_a2dp_snk_get_device_connect_state())
@@ -126,7 +126,7 @@ namespace OHOS
             break;
         case BluetoothServiceOptionsView::DISCONNECT_HFP:
 
-#ifdef FD230_650
+#ifdef FD230
             if (!uapi_hfp_connect_state())
             {
                 {
@@ -136,7 +136,7 @@ namespace OHOS
 #endif
             break;
         case BluetoothServiceOptionsView::CONNECT_A2DP:
-#ifdef FD230_650
+#ifdef FD230
             if (uapi_a2dp_snk_get_device_connect_state())
             {
                 connect_state++;
@@ -144,7 +144,7 @@ namespace OHOS
 #endif
             break;
         case BluetoothServiceOptionsView::DISCONNECT_A2DP:
-#ifdef FD230_650
+#ifdef FD230
             if (!uapi_a2dp_snk_get_device_connect_state())
             {
                 connect_state++;
@@ -321,7 +321,7 @@ namespace OHOS
             return false;
         }
         HFP_ToggleButton->SetPosition(298, 145, 100, 50);
-#ifdef FD230_650
+#ifdef FD230
         HFP_ToggleButton->SetState(uapi_hfp_connect_state()); // ConfigModel::GetInstance()->GetHFPState());
 #endif
         HFP_ToggleButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xffffffff);
@@ -334,7 +334,7 @@ namespace OHOS
             return false;
         }
         A2DP_ToggleButton->SetPosition(298, 265, 100, 50);
-#ifdef FD230_650
+#ifdef FD230
         A2DP_ToggleButton->SetState(uapi_a2dp_snk_get_device_connect_state());
 #endif
         A2DP_ToggleButton->SetStyle(STYLE_BACKGROUND_OPA, 0xffffffff);
@@ -419,7 +419,7 @@ namespace OHOS
         BlueToothScrollView->Add(A2DP_Label);
         BlueToothScrollView->Add(HFP_ToggleButton);
         BlueToothScrollView->Add(A2DP_ToggleButton);
-#ifdef FD230_650
+#ifdef FD230
         p_AiVoiceConnectingView = new AiVoiceConnectingView();
         if (p_AiVoiceConnectingView == nullptr)
         {
@@ -440,7 +440,7 @@ namespace OHOS
     {
         if (connectingScrollView)
             connectingScrollView->SetVisible(data);
-#ifdef FD230_650
+#ifdef FD230
         if (data == false)
         {
             if (A2DP_ToggleButton)
@@ -454,7 +454,7 @@ namespace OHOS
 
     void BluetoothServiceOptionsView::Button_UPdata(void)
     {
-#ifdef FD230_650
+#ifdef FD230
         if (A2DP_ToggleButton)
             A2DP_ToggleButton->SetState(uapi_a2dp_snk_get_device_connect_state());
 
index d781751..0f6487c 100644 (file)
@@ -111,7 +111,7 @@ namespace OHOS
 \r
     bool ClassicBlueToothPresenter::OnChange(UICheckBox::UICheckBoxState state)\r
     {\r
-#ifdef FD230_650\r
+#ifdef FD230\r
         WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ClassicBlueToothPresenter::OnChange");\r
         bd_addr_t bdaddr = {0};\r
         switch (state)\r