From 8ebb9cd8b717e564b85e2fe04ec80a58f1fd3a77 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Fri, 29 Aug 2025 15:46:52 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E4=B8=8B=E6=8B=89=E7=95=8C?= =?utf8?q?=E9=9D=A2=E8=BF=9E=E6=8E=A5=E7=8A=B6=E6=80=81=E5=BC=82=E5=B8=B8?= =?utf8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/aivoice/src/AiVoicePresenter.cpp | 7 ++----- .../nativeui/main/src/PullUpDownView.cpp | 19 ++----------------- .../nativeui/settings/src/SettingModel.cpp | 4 ++++ 3 files changed, 8 insertions(+), 22 deletions(-) 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 -- 2.17.1