From 57d3550eb3b3b4a5d9d55d6575ac10505d66b304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Wed, 30 Apr 2025 03:21:57 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=20=E8=93=9D=E7=89=99=E6=96=AD=E5=BC=80?= =?UTF-8?q?=E6=97=B6=E6=8C=82=E6=96=AD=E6=89=80=E6=9C=89=E8=93=9D=E7=89=99?= =?UTF-8?q?=E9=80=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- .../bluetooth/src/bluetooth_connection.cpp | 4 +- .../src/bluetooth_call_connection.cpp | 43 ++++++++++--------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/services/bluetooth/src/bluetooth_connection.cpp b/services/bluetooth/src/bluetooth_connection.cpp index 83c6cd8d..df9fd317 100644 --- a/services/bluetooth/src/bluetooth_connection.cpp +++ b/services/bluetooth/src/bluetooth_connection.cpp @@ -14,7 +14,7 @@ */ #include "bluetooth_connection.h" - +#include "bluetooth_call_connection.h" #include "audio_control_manager.h" #include "bluetooth_call_manager.h" #include "telephony_log_wrapper.h" @@ -280,7 +280,7 @@ void SystemAbilityListener::OnRemoveSystemAbility(int32_t systemAbilityId, const TELEPHONY_LOGE("removed SA is not bluetooth service, ignored."); return; } - + DelayedSingleton::GetInstance()->HfpDisConnectedEndBtCall(); DelayedSingleton::GetInstance()->ResetBtConnection(); std::shared_ptr audioDeviceManager = DelayedSingleton::GetInstance(); audioDeviceManager->ResetBtAudioDevicesList(); diff --git a/services/telephony_interaction/src/bluetooth_call_connection.cpp b/services/telephony_interaction/src/bluetooth_call_connection.cpp index 74a8c4f9..fc74c9d4 100644 --- a/services/telephony_interaction/src/bluetooth_call_connection.cpp +++ b/services/telephony_interaction/src/bluetooth_call_connection.cpp @@ -154,27 +154,28 @@ bool BluetoothCallConnection::GetBtCallScoConnected() void BluetoothCallConnection::HfpDisConnectedEndBtCall() { - sptr call = CallObjectManager::GetOneCallObject(CallRunningState::CALL_RUNNING_STATE_DIALING); - if (call == nullptr || call->GetCallType() != CallType::TYPE_BLUETOOTH) { - return; - } - TELEPHONY_LOGW("When BluetoothCall dialing Hfp is disconnected."); - CallAttributeInfo info; - (void)memset_s(&info, sizeof(CallAttributeInfo), 0, sizeof(CallAttributeInfo)); - call->GetCallAttributeBaseInfo(info); - CallDetailInfo detailInfo; - detailInfo.callType = info.callType; - detailInfo.accountId = info.accountId; - detailInfo.index = info.index; - detailInfo.state = TelCallState::CALL_STATUS_DISCONNECTED; - (void)memcpy_s(detailInfo.phoneNum, kMaxNumberLen, info.accountNumber, kMaxNumberLen); - (void)memset_s(detailInfo.bundleName, kMaxBundleNameLen + 1, 0, kMaxBundleNameLen + 1); - int32_t ret = DelayedSingleton::GetInstance()->UpdateCallReportInfo(detailInfo); - if (ret != TELEPHONY_SUCCESS) { - TELEPHONY_LOGE("UpdateCallReportInfo failed! errCode:%{public}d", ret); - } else { - TELEPHONY_LOGW("UpdateCallReportInfo success! state:%{public}d, index:%{public}d", - detailInfo.state, detailInfo.index); + std::list> allCallList = CallObjectManager::GetAllCallList(); + for (auto call : allCallList) { + if (call == nullptr || call->GetCallType() != CallType::TYPE_BLUETOOTH) { + continue; + } + CallAttributeInfo info; + (void)memset_s(&info, sizeof(CallAttributeInfo), 0, sizeof(CallAttributeInfo)); + call->GetCallAttributeBaseInfo(info); + CallDetailInfo detailInfo; + detailInfo.callType = info.callType; + detailInfo.accountId = info.accountId; + detailInfo.index = call->GetCallIndex(); + detailInfo.state = TelCallState::CALL_STATUS_DISCONNECTED; + (void)memcpy_s(detailInfo.phoneNum, kMaxNumberLen, info.accountNumber, kMaxNumberLen); + (void)memset_s(detailInfo.bundleName, kMaxBundleNameLen + 1, 0, kMaxBundleNameLen + 1); + int32_t ret = DelayedSingleton::GetInstance()->UpdateCallReportInfo(detailInfo); + if (ret != TELEPHONY_SUCCESS) { + TELEPHONY_LOGE("UpdateCallReportInfo failed! errCode:%{public}d", ret); + } else { + TELEPHONY_LOGI("UpdateCallReportInfo success! state:%{public}d, index:%{public}d", + detailInfo.state, detailInfo.index); + } } } -- Gitee From ed03e679cfc998f5427c39e95da9387ddc8a1f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Wed, 30 Apr 2025 03:24:57 +0000 Subject: [PATCH 2/3] update services/telephony_interaction/src/bluetooth_call_connection.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- services/telephony_interaction/src/bluetooth_call_connection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/telephony_interaction/src/bluetooth_call_connection.cpp b/services/telephony_interaction/src/bluetooth_call_connection.cpp index fc74c9d4..35b1e360 100644 --- a/services/telephony_interaction/src/bluetooth_call_connection.cpp +++ b/services/telephony_interaction/src/bluetooth_call_connection.cpp @@ -154,6 +154,7 @@ bool BluetoothCallConnection::GetBtCallScoConnected() void BluetoothCallConnection::HfpDisConnectedEndBtCall() { + TELEPHONY_LOGI("hfp disconnected,hangup all bt call."); std::list> allCallList = CallObjectManager::GetAllCallList(); for (auto call : allCallList) { if (call == nullptr || call->GetCallType() != CallType::TYPE_BLUETOOTH) { -- Gitee From d2ef639b9ccbf6a5276c06400119373088918b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E9=B8=BF=E7=9D=BF?= Date: Wed, 30 Apr 2025 03:25:33 +0000 Subject: [PATCH 3/3] update services/telephony_interaction/src/bluetooth_call_connection.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 王鸿睿 --- .../telephony_interaction/src/bluetooth_call_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/telephony_interaction/src/bluetooth_call_connection.cpp b/services/telephony_interaction/src/bluetooth_call_connection.cpp index 35b1e360..de979278 100644 --- a/services/telephony_interaction/src/bluetooth_call_connection.cpp +++ b/services/telephony_interaction/src/bluetooth_call_connection.cpp @@ -154,7 +154,7 @@ bool BluetoothCallConnection::GetBtCallScoConnected() void BluetoothCallConnection::HfpDisConnectedEndBtCall() { - TELEPHONY_LOGI("hfp disconnected,hangup all bt call."); + TELEPHONY_LOGI("hfp disconnected, hangup all bt call."); std::list> allCallList = CallObjectManager::GetAllCallList(); for (auto call : allCallList) { if (call == nullptr || call->GetCallType() != CallType::TYPE_BLUETOOTH) { -- Gitee