From: luozheng <1732036298@qq.com> Date: Fri, 29 Aug 2025 07:46:52 +0000 (+0800) Subject: 解决下拉界面连接状态异常问题 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~135^2 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=8ebb9cd8b717e564b85e2fe04ec80a58f1fd3a77;p=mirrors%2FFD230.git 解决下拉界面连接状态异常问题 --- diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp index ab99d3cb0..c64d882b6 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/aivoice/src/AiVoicePresenter.cpp @@ -16,8 +16,6 @@ #include "iostream" #include // For std::string #include // For std::unordered_map -#include // For std::string -#include // For std::unordered_map #ifdef SUPPORT_BLE_SERVICE #include @@ -671,8 +669,7 @@ namespace OHOS { if (scrollView == view_->GetAiVoiceScrollView(AIVOICE_STARTCHAT_VIEWID)) { - /*AI对话界面右滑退出当前Slice*/ - // NativeAbility::GetInstance().Back(TransitionType::TRANSITION_BACK_TO_HEXAGONS); + //开始对话界面,右滑切换界面 DragLeftToRightChangeAIModel(); } else if (scrollView == view_->GetAiVoiceScrollView(AIVOICE_ALERT_APPBLUETOOTH_AND_4GNETWORK_VIEWID)) @@ -727,7 +724,7 @@ namespace OHOS } else if (model->GetAiModelTextId() == STR_AIMODES_CHATGPT && event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP) /*上滑*/ { - WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "DIRECTION_BOTTOM_TO_TOP"); + //如果选择的模型是在chatgpt if (model->IsExistOpenAIAPIKeys() == true) { ChangeViewAndLogicOperator(AIVOICE_STARTCHAT_VIEWID, AIVOICE_SETAPIKEYS); /*开始对话界面->API Keys set界面*/ diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/PullUpDownView.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/PullUpDownView.cpp index 6df5a4b7b..52018d7e1 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/PullUpDownView.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/main/src/PullUpDownView.cpp @@ -129,11 +129,7 @@ namespace OHOS // else // return false; -#ifdef FD230 return SettingModel::GetInstance().GetPhoneConnectStatus(); -#else - return false; -#endif } // 获取蓝牙耳机连接状态 bool PullUpDownView::GetEarPhoneConnectedStatus(void) @@ -145,11 +141,8 @@ namespace OHOS // return true; // else // return false; -#ifdef FD230 + return SettingModel::GetInstance().GetEarPhoneConnectStatus(); -#else - return false; -#endif } // 获取蓝牙连接状态 bool PullUpDownView::GetBlueToothConnectedStatus(void) @@ -162,11 +155,7 @@ namespace OHOS // else // return false; -#ifdef FD230 return SettingModel::GetInstance().GetBlueToothConnectStatus(); -#else - return false; -#endif } // 设置蓝牙连接状态是否显示 @@ -537,9 +526,7 @@ namespace OHOS /* -------------------------------------------------------------------------- */ UpdateSignalStrengthStatusAndBatteryPosition(); /* -------------------------------------------------------------------------- */ -#ifdef FD230 MainPresenterSample::GetInstance()->UpdataBaseData(); -#endif /* -------------------------------------------------------------------------- */ UpdateBatteryProcess(); } @@ -889,13 +876,11 @@ namespace OHOS updateSignalDisplay(); // 函数用于更新信号显示的UI UpdateXPosition(); -#ifdef FD230 /*更新蓝牙连接状态*/ int a2dp = uapi_a2dp_snk_get_device_connect_state(); int hfp = uapi_hfp_connect_state(); - bool bluetoothstatus = (a2dp == 0 && hfp == 0) ? false : true; + int bluetoothstatus = (a2dp == 0 && hfp == 0) ? 0 : 1; UpdateBlueToothStatus(bluetoothstatus); -#endif } // 更新是否是充电状态 diff --git a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingModel.cpp b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingModel.cpp index 136b2aaff..2e54d9829 100644 --- a/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingModel.cpp +++ b/code/sdk/application/wearable/fd230/nativeapp/nativeui/settings/src/SettingModel.cpp @@ -105,6 +105,10 @@ namespace OHOS // { // btConnectStatus = true; // } + int a2dp = uapi_a2dp_snk_get_device_connect_state(); + int hfp = uapi_hfp_connect_state(); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "a2dp:%d,hfp:%d",a2dp,hfp); + btConnectStatus = (a2dp == 0 && hfp == 0) ? 0 : 1; #else btConnectStatus = false; #endif