From: luozheng <1732036298@qq.com> Date: Wed, 25 Jun 2025 08:42:49 +0000 (+0800) Subject: 解决点击设置->蓝牙服务选项死机问题 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~253 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=931f61de391c0eb109e578375e880bbe762c51bb;p=mirrors%2FFD230.git 解决点击设置->蓝牙服务选项死机问题 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h index 6030a1836..e52a85218 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/include/BluetoothServiceOptionsView.h @@ -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 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp index c10398b62..0600416ff 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsPresenter.cpp @@ -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); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp index 9b038aa1b..d28a10a96 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/BluetoothServiceOptionsView.cpp @@ -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()); diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp index d78175192..0f6487c4b 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/classicbluetooth/src/ClassicBlueToothPresenter.cpp @@ -111,7 +111,7 @@ namespace OHOS bool ClassicBlueToothPresenter::OnChange(UICheckBox::UICheckBoxState state) { -#ifdef FD230_650 +#ifdef FD230 WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "ClassicBlueToothPresenter::OnChange"); bd_addr_t bdaddr = {0}; switch (state)