From 58033277eba562434ae75c01c92c3dd4c85c3b60 Mon Sep 17 00:00:00 2001 From: ASheLock Date: Thu, 9 Nov 2023 14:10:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=B4=A7=E6=80=A5=E5=8F=B7=E7=A0=81?= =?UTF-8?q?=E9=A9=BB=E7=BD=91=E6=96=B0=E5=A2=9Ecs=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ASheLock --- .../control/include/cellular_call_config.h | 4 +- services/control/src/cellular_call_config.cpp | 46 +++++++++++-------- .../manager/src/cellular_call_handler.cpp | 2 + .../manager/src/cellular_call_service.cpp | 8 ++++ 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/services/control/include/cellular_call_config.h b/services/control/include/cellular_call_config.h index 2da0c08..c8c89f3 100755 --- a/services/control/include/cellular_call_config.h +++ b/services/control/include/cellular_call_config.h @@ -488,6 +488,7 @@ private: void SaveVoNRState(int32_t slotId, int32_t state); int32_t ObtainVoNRState(int32_t slotId); void UpdateEccNumberList(int32_t slotId); + bool IsHomeNetRegister(int32_t slotId, std::string hplmn); private: static std::map modeTempMap_; @@ -498,7 +499,8 @@ private: static std::map> allEccList_; static std::map simState_; static std::map curPlmn_; - static std::map serviceState_; + static std::map psServiceState_; + static std::map csServiceState_; std::mutex mutex_; static std::mutex operatorMutex_; ConfigRequest configRequest_; diff --git a/services/control/src/cellular_call_config.cpp b/services/control/src/cellular_call_config.cpp index f56a1f1..9bcdcb6 100755 --- a/services/control/src/cellular_call_config.cpp +++ b/services/control/src/cellular_call_config.cpp @@ -72,7 +72,8 @@ std::vector CellularCallConfig::eccList3gppNoSim_; std::map> CellularCallConfig::allEccList_; std::map CellularCallConfig::simState_; std::map CellularCallConfig::curPlmn_; -std::map CellularCallConfig::serviceState_; +std::map CellularCallConfig::psServiceState_; +std::map CellularCallConfig::csServiceState_; std::map CellularCallConfig::readyToCall_; bool CellularCallConfig::isOperatorConfigInit_ = false; @@ -97,7 +98,9 @@ void CellularCallConfig::InitDefaultOperatorConfig() CellularCallConfig::forceVolteSwitchOn_.insert(std::pair(i, false)); CellularCallConfig::readyToCall_.insert(std::pair(i, true)); CellularCallConfig::vonrSwithStatus_.insert(std::pair(i, VONR_SWITCH_VALUE_UNKNOWN)); - CellularCallConfig::serviceState_.insert(std::pair(i, + CellularCallConfig::psServiceState_.insert(std::pair(i, + RegServiceState::REG_STATE_UNKNOWN)); + CellularCallConfig::csServiceState_.insert(std::pair(i, RegServiceState::REG_STATE_UNKNOWN)); } } @@ -242,12 +245,14 @@ void CellularCallConfig::HandleNetworkStateChange(int32_t slotId) { TELEPHONY_LOGI("CellularCallConfig::HandleNetworkStateChange entry, slotId: %{public}d", slotId); ModuleServiceUtils moduleUtils; - RegServiceState regState = moduleUtils.GetPsRegState(slotId); - if (serviceState_[slotId] == regState) { + RegServiceState psRegState = moduleUtils.GetPsRegState(slotId); + RegServiceState csRegState = moduleUtils.GetCsRegState(slotId); + if (psServiceState_[slotId] == psRegState && csServiceState_[slotId] == csRegState) { TELEPHONY_LOGI("serviceState is not change, slotId: %{public}d", slotId); return; } - serviceState_[slotId] = regState; + psServiceState_[slotId] = psRegState; + csServiceState_[slotId] = csRegState; CheckAndUpdateSimState(slotId); UpdateEccNumberList(slotId); } @@ -258,14 +263,8 @@ void CellularCallConfig::UpdateEccNumberList(int32_t slotId) CoreManagerInner::GetInstance().GetSimOperatorNumeric(slotId, u16Hplmn); std::string hplmn = Str16ToStr8(u16Hplmn); std::vector callList; - int32_t roamingState = CoreManagerInner::GetInstance().GetPsRoamingState(slotId); - bool isRoaming = roamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && - roamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); - ModuleServiceUtils moduleUtils; - bool isNetworkInService = moduleUtils.GetPsRegState(slotId) == RegServiceState::REG_STATE_IN_SERVICE; - bool isHomeNetRegister = !hplmn.empty() && isNetworkInService && !isRoaming; std::vector eccVec; - if (isHomeNetRegister && simState_[slotId] == SIM_PRESENT) { + if (simState_[slotId] == SIM_PRESENT && IsHomeNetRegister(slotId, hplmn)) { OperatorConfig operatorConfig; CoreManagerInner::GetInstance().GetOperatorConfigs(slotId, operatorConfig); callList = operatorConfig.stringArrayValue[KEY_EMERGENCY_CALL_STRING_ARRAY]; @@ -762,12 +761,7 @@ void CellularCallConfig::MergeEccCallList(int32_t slotId) std::u16string u16Hplmn = u""; CoreManagerInner::GetInstance().GetSimOperatorNumeric(slotId, u16Hplmn); std::string hplmn = Str16ToStr8(u16Hplmn); - int32_t roamingState = CoreManagerInner::GetInstance().GetPsRoamingState(slotId); - bool isRoaming = roamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && - roamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); - ModuleServiceUtils moduleUtils; - bool isNetworkInService = moduleUtils.GetPsRegState(slotId) == RegServiceState::REG_STATE_IN_SERVICE; - if (hasSim && isNetworkInService && !isRoaming && !hplmn.empty()) { + if (hasSim && IsHomeNetRegister(slotId, hplmn)) { std::vector eccVec; DelayedSingleton::GetInstance()->QueryEccList(hplmn, eccVec); if (!eccVec.empty()) { @@ -1020,5 +1014,21 @@ bool CellularCallConfig::IsReadyToCall(int32_t slotId) } return readyToCall_[slotId]; } + +bool CellularCallConfig::IsHomeNetRegister(int32_t slotId, std::string hplmn) +{ + int32_t psRoamingState = CoreManagerInner::GetInstance().GetPsRoamingState(slotId); + bool isPsRoaming = psRoamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && + psRoamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); + int32_t csRoamingState = static_cast(RoamingType::ROAMING_STATE_UNKNOWN); + CoreManagerInner::GetInstance().GetCsRoamingState(slotId, csRoamingState); + bool isCsRoaming = csRoamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && + csRoamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); + ModuleServiceUtils moduleUtils; + bool isNetworkInService = moduleUtils.GetPsRegState(slotId) == RegServiceState::REG_STATE_IN_SERVICE || + moduleUtils.GetCsRegState(slotId) == RegServiceState::REG_STATE_IN_SERVICE; + bool isHomeNetRegister = !hplmn.empty() && isNetworkInService && !isPsRoaming && !isCsRoaming; + return isHomeNetRegister; +} } // namespace Telephony } // namespace OHOS diff --git a/services/manager/src/cellular_call_handler.cpp b/services/manager/src/cellular_call_handler.cpp index e76d027..99e7ba0 100755 --- a/services/manager/src/cellular_call_handler.cpp +++ b/services/manager/src/cellular_call_handler.cpp @@ -129,6 +129,8 @@ void CellularCallHandler::InitActiveReportFuncMap() requestFuncMap_[RadioEvent::RADIO_RESIDENT_NETWORK_CHANGE] = &CellularCallHandler::ResidentNetworkChangeReport; requestFuncMap_[RadioEvent::RADIO_PS_CONNECTION_ATTACHED] = &CellularCallHandler::NetworkStateChangeReport; requestFuncMap_[RadioEvent::RADIO_PS_CONNECTION_DETACHED] = &CellularCallHandler::NetworkStateChangeReport; + requestFuncMap_[RadioEvent::RADIO_CS_CONNECTION_ATTACHED] = &CellularCallHandler::NetworkStateChangeReport; + requestFuncMap_[RadioEvent::RADIO_CS_CONNECTION_DETACHED] = &CellularCallHandler::NetworkStateChangeReport; #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE requestFuncMap_[RadioEvent::RADIO_GET_STATUS] = &CellularCallHandler::GetRadioStateProcess; requestFuncMap_[RadioEvent::RADIO_STATE_CHANGED] = &CellularCallHandler::RadioStateChangeProcess; diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index 31f701f..da563c1 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -181,6 +181,10 @@ void CellularCallService::HandlerResetUnRegister() slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED); CoreManagerInner::GetInstance().UnRegisterCoreNotify( slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED); + CoreManagerInner::GetInstance().UnRegisterCoreNotify( + slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED); + CoreManagerInner::GetInstance().UnRegisterCoreNotify( + slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED); #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED); #endif @@ -228,6 +232,10 @@ void CellularCallService::RegisterCoreServiceHandler() slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED, nullptr); CoreManagerInner::GetInstance().RegisterCoreNotify( slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED, nullptr); + CoreManagerInner::GetInstance().RegisterCoreNotify( + slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED, nullptr); + CoreManagerInner::GetInstance().RegisterCoreNotify( + slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED, nullptr); #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE CoreManagerInner::GetInstance().RegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED, nullptr); CoreManagerInner::GetInstance().GetRadioState(slot, RadioEvent::RADIO_GET_STATUS, handler); -- Gitee From 63159a9df3be93cff780b8c8eac882e894583764 Mon Sep 17 00:00:00 2001 From: ASheLock Date: Thu, 9 Nov 2023 17:54:20 +0800 Subject: [PATCH 2/5] =?UTF-8?q?3gpp=E5=8F=B7=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ASheLock --- services/control/src/cellular_call_config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/control/src/cellular_call_config.cpp b/services/control/src/cellular_call_config.cpp index 9bcdcb6..b1bae84 100755 --- a/services/control/src/cellular_call_config.cpp +++ b/services/control/src/cellular_call_config.cpp @@ -709,9 +709,9 @@ void CellularCallConfig::InitModeActive() eccList3gppNoSim_.clear(); allEccList_.clear(); eccList3gppHasSim_.push_back(BuildDefaultEmergencyCall("112", SimpresentType::TYPE_HAS_CARD)); - eccList3gppHasSim_.push_back(BuildDefaultEmergencyCall("991", SimpresentType::TYPE_HAS_CARD)); + eccList3gppHasSim_.push_back(BuildDefaultEmergencyCall("911", SimpresentType::TYPE_HAS_CARD)); eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("112", SimpresentType::TYPE_NO_CARD)); - eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("991", SimpresentType::TYPE_NO_CARD)); + eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("911", SimpresentType::TYPE_NO_CARD)); eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("000", SimpresentType::TYPE_NO_CARD)); eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("08", SimpresentType::TYPE_NO_CARD)); eccList3gppNoSim_.push_back(BuildDefaultEmergencyCall("110", SimpresentType::TYPE_NO_CARD)); -- Gitee From 3f3486c83925732cc940adab0790c96e6ef319af Mon Sep 17 00:00:00 2001 From: ASheLock Date: Fri, 10 Nov 2023 10:55:24 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=97=A8=E7=A6=81=E5=A4=A7=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ASheLock --- .../manager/src/cellular_call_service.cpp | 95 ++++++++----------- 1 file changed, 38 insertions(+), 57 deletions(-) diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index da563c1..75da3b8 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -163,30 +163,25 @@ void CellularCallService::HandlerResetUnRegister() if (handler != nullptr) { handler.reset(); } - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_AVAIL); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_NOT_AVAIL); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_RECORDS_LOADED); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_ACCOUNT_LOADED); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_STATUS_INFO); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_USSD_NOTICE); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SS_NOTICE); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RINGBACK_VOICE); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_EMERGENCY_NUMBER_REPORT); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SRVCC_STATUS); - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RSRVCC_STATUS); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_RESIDENT_NETWORK_CHANGE); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED); - CoreManagerInner::GetInstance().UnRegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED); + CoreManagerInner &coreInner = CoreManagerInner::GetInstance(); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_AVAIL); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_NOT_AVAIL); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_RECORDS_LOADED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_ACCOUNT_LOADED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_STATUS_INFO); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_USSD_NOTICE); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SS_NOTICE); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RINGBACK_VOICE); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_EMERGENCY_NUMBER_REPORT); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SRVCC_STATUS); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RSRVCC_STATUS); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_RESIDENT_NETWORK_CHANGE); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED); #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE - CoreManagerInner::GetInstance().UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED); + coreInner.UnRegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED); #endif if (GetCsControl(slot) != nullptr) { GetCsControl(slot)->ReleaseAllConnection(); @@ -204,41 +199,27 @@ void CellularCallService::RegisterCoreServiceHandler() int32_t slot = it.first; auto handler = it.second; if (handler != nullptr) { - CoreManagerInner::GetInstance().RegisterCoreNotify(slot, handler, RadioEvent::RADIO_AVAIL, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify(slot, handler, RadioEvent::RADIO_NOT_AVAIL, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_SIM_STATE_CHANGE, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_SIM_RECORDS_LOADED, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_SIM_ACCOUNT_LOADED, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_STATUS_INFO, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_USSD_NOTICE, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_SS_NOTICE, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_EMERGENCY_NUMBER_REPORT, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_RINGBACK_VOICE, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_SRVCC_STATUS, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CALL_RSRVCC_STATUS, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_RESIDENT_NETWORK_CHANGE, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED, nullptr); - CoreManagerInner::GetInstance().RegisterCoreNotify( - slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED, nullptr); + CoreManagerInner &coreInner = CoreManagerInner::GetInstance(); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_AVAIL, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_NOT_AVAIL, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_STATE_CHANGE, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_RECORDS_LOADED, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_SIM_ACCOUNT_LOADED, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_STATUS_INFO, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_USSD_NOTICE, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SS_NOTICE, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_EMERGENCY_NUMBER_REPORT, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RINGBACK_VOICE, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_SRVCC_STATUS, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CALL_RSRVCC_STATUS, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_RESIDENT_NETWORK_CHANGE, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_PS_CONNECTION_ATTACHED, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_PS_CONNECTION_DETACHED, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CS_CONNECTION_ATTACHED, nullptr); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_CS_CONNECTION_DETACHED, nullptr); #ifdef CALL_MANAGER_AUTO_START_OPTIMIZE - CoreManagerInner::GetInstance().RegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED, nullptr); - CoreManagerInner::GetInstance().GetRadioState(slot, RadioEvent::RADIO_GET_STATUS, handler); + coreInner.RegisterCoreNotify(slot, handler, RadioEvent::RADIO_STATE_CHANGED, nullptr); + coreInner.GetRadioState(slot, RadioEvent::RADIO_GET_STATUS, handler); #endif } CellularCallConfig config; -- Gitee From f8d5517fc25dd39374cfb5f90437d302bf0ae8f8 Mon Sep 17 00:00:00 2001 From: ASheLock Date: Thu, 16 Nov 2023 16:29:12 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9Etdd=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ASheLock --- test/unittest/cstest/cs_test.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/test/unittest/cstest/cs_test.cpp b/test/unittest/cstest/cs_test.cpp index a0d5ae9..d27464a 100755 --- a/test/unittest/cstest/cs_test.cpp +++ b/test/unittest/cstest/cs_test.cpp @@ -2663,13 +2663,21 @@ HWTEST_F(CsTest, cellular_call_ModuleServiceUtils_0001, Function | MediumTest | */ HWTEST_F(CsTest, cellular_call_CellularCallConfig_0001, Function | MediumTest | Level3) { - CellularCallConfig CellularCallConfig; + CellularCallConfig cellularCallConfig; bool isReadyToCall = false; bool csType = 0; - CellularCallConfig.SetReadyToCall(SIM1_SLOTID, isReadyToCall); + cellularCallConfig.SetReadyToCall(SIM1_SLOTID, isReadyToCall); CellularCallCallback cellularCallCallback; cellularCallCallback.SetReadyToCall(SIM1_SLOTID, csType, isReadyToCall); - EXPECT_EQ(CellularCallConfig.IsReadyToCall(SIM1_SLOTID), TELEPHONY_SUCCESS); + cellularCallConfig.HandleSimStateChanged(SIM1_SLOTID); + std::string plmn = "46000"; + cellularCallConfig.HandleResidentNetworkChange(SIM1_SLOTID, plmn); + cellularCallConfig.HandleNetworkStateChange(SIM1_SLOTID); + cellularCallConfig.UpdateEccNumberList(SIM1_SLOTID); + cellularCallConfig.MergeEccCallList(SIM1_SLOTID); + EmergencyInfoList eccList; + cellularCallConfig.UpdateEmergencyCallFromRadio(SIM1_SLOTID, eccList); + EXPECT_EQ(cellularCallConfig.IsReadyToCall(SIM1_SLOTID), TELEPHONY_SUCCESS); } } // namespace Telephony } // namespace OHOS -- Gitee From 134b7a25de86a7e6dc44724c38b8a06579462963 Mon Sep 17 00:00:00 2001 From: ASheLock Date: Mon, 27 Nov 2023 12:36:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=97=A8=E7=A6=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ASheLock --- services/control/src/cellular_call_config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/control/src/cellular_call_config.cpp b/services/control/src/cellular_call_config.cpp index 684e084..5516d7d 100755 --- a/services/control/src/cellular_call_config.cpp +++ b/services/control/src/cellular_call_config.cpp @@ -762,8 +762,8 @@ void CellularCallConfig::MergeEccCallList(int32_t slotId) CoreManagerInner::GetInstance().GetSimOperatorNumeric(slotId, u16Hplmn); std::string hplmn = Str16ToStr8(u16Hplmn); int32_t psRoamingState = CoreManagerInner::GetInstance().GetPsRoamingState(slotId); - bool isPsRoaming = roamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && - roamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); + bool isPsRoaming = psRoamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && + psRoamingState <= static_cast(RoamingType::ROAMING_STATE_INTERNATIONAL); int32_t csRoamingState = static_cast(RoamingType::ROAMING_STATE_UNKNOWN); CoreManagerInner::GetInstance().GetCsRoamingState(slotId, csRoamingState); bool isCsRoaming = csRoamingState > static_cast(RoamingType::ROAMING_STATE_UNKNOWN) && -- Gitee