From f2e388dbdb972158281cd19d2b71c2686cfe4c5e Mon Sep 17 00:00:00 2001 From: lishuo Date: Mon, 31 Mar 2025 11:26:28 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8Bmap=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=8A=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lishuo --- services/utils/src/cellular_call_config.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/services/utils/src/cellular_call_config.cpp b/services/utils/src/cellular_call_config.cpp index 9bb0c5dc..3012985d 100644 --- a/services/utils/src/cellular_call_config.cpp +++ b/services/utils/src/cellular_call_config.cpp @@ -830,12 +830,15 @@ void CellularCallConfig::MergeEccCallList(int32_t slotId) { std::map> tempEccList; std::string mcc = GetMcc(slotId); - for (auto ecc : eccListRadioMap_[slotId]) { - ecc.mcc = mcc; - tempEccList[slotId].push_back(ecc); + { + std::unique_lock lock(mutex_); + for (auto ecc : eccListRadioMap_[slotId]) { + ecc.mcc = mcc; + tempEccList[slotId].push_back(ecc); + TELEPHONY_LOGD("MergeEccCallList merge radio slotId %{public}d size %{public}d", slotId, + static_cast(eccListRadioMap_[slotId].size())); + } } - TELEPHONY_LOGD("MergeEccCallList merge radio slotId %{public}d size %{public}d", slotId, - static_cast(eccListRadioMap_[slotId].size())); SimState simState = SimState::SIM_STATE_UNKNOWN; CoreManagerInner::GetInstance().GetSimState(slotId, simState); bool hasSim = simState == SimState::SIM_STATE_READY || simState == SimState::SIM_STATE_LOADED; -- Gitee From e68aaf3b03aeea65af23d8a94c833efc79a3d040 Mon Sep 17 00:00:00 2001 From: lishuo Date: Tue, 1 Apr 2025 06:45:05 +0000 Subject: [PATCH 2/2] update services/utils/src/cellular_call_config.cpp. Signed-off-by: lishuo --- services/utils/src/cellular_call_config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/utils/src/cellular_call_config.cpp b/services/utils/src/cellular_call_config.cpp index 3012985d..e10270ac 100644 --- a/services/utils/src/cellular_call_config.cpp +++ b/services/utils/src/cellular_call_config.cpp @@ -831,7 +831,7 @@ void CellularCallConfig::MergeEccCallList(int32_t slotId) std::map> tempEccList; std::string mcc = GetMcc(slotId); { - std::unique_lock lock(mutex_); + std::lock_guard lock(mutex_); for (auto ecc : eccListRadioMap_[slotId]) { ecc.mcc = mcc; tempEccList[slotId].push_back(ecc); -- Gitee