From 7af0c24202cf172b94775de41c1ec708c47729f7 Mon Sep 17 00:00:00 2001 From: fanrui0 Date: Fri, 12 Sep 2025 12:37:36 +0800 Subject: [PATCH 1/4] updata ecclist Signed-off-by: fanrui0 --- .../common/include/cellular_call_rdb_helper.h | 1 + .../common/src/cellular_call_rdb_helper.cpp | 14 +++ .../manager/include/cellular_call_service.h | 10 +++ .../manager/src/cellular_call_service.cpp | 15 ++++ services/utils/include/cellular_call_config.h | 16 ++++ services/utils/src/cellular_call_config.cpp | 90 +++++++++++++++---- .../getcallrestriction_fuzzer/BUILD.gn | 2 + test/fuzztest/getcscalldata_fuzzer/BUILD.gn | 2 + test/fuzztest/imscallback_fuzzer/BUILD.gn | 2 + test/fuzztest/imsclient_fuzzer/BUILD.gn | 2 + .../BUILD.gn | 2 + .../satellitecallback_fuzzer/BUILD.gn | 2 + test/fuzztest/satelliteclient_fuzzer/BUILD.gn | 2 + .../setimsfeaturevalue_fuzzer/BUILD.gn | 2 + .../fuzztest/setpreviewwindow_fuzzer/BUILD.gn | 2 + test/unittest/cstest/BUILD.gn | 6 ++ test/unittest/imstest/zero_branch1_test.cpp | 17 +++- test/unittest/satellitetest/BUILD.gn | 6 ++ 18 files changed, 175 insertions(+), 18 deletions(-) diff --git a/services/common/include/cellular_call_rdb_helper.h b/services/common/include/cellular_call_rdb_helper.h index 780a2003..3cc21e27 100644 --- a/services/common/include/cellular_call_rdb_helper.h +++ b/services/common/include/cellular_call_rdb_helper.h @@ -38,6 +38,7 @@ class CellularCallRdbHelper : public DelayedSingleton { public: int32_t QueryEccList(const std::string &numeric, std::vector &eccVec); + void RegisterListenState(sptr &settingsCallback); private: std::shared_ptr CreateDataAbilityHelper(); diff --git a/services/common/src/cellular_call_rdb_helper.cpp b/services/common/src/cellular_call_rdb_helper.cpp index 586753aa..8cb3fa20 100644 --- a/services/common/src/cellular_call_rdb_helper.cpp +++ b/services/common/src/cellular_call_rdb_helper.cpp @@ -89,5 +89,19 @@ int32_t CellularCallRdbHelper::QueryEccList(const std::string &numeric, std::vec dataShareHelper = nullptr; return TELEPHONY_SUCCESS; } + +void CellularCallRdbHelper::RegisterListenState(sptr &settingsCallback) +{ + if (settingsCallback == nullptr) { + return; + } + auto dataShareHelper = CreateDataAbilityHelper(); + if (dataShareHelper == nullptr) { + TELEPHONY_LOGE("dataShareHelper is nullptr"); + } + OHOS::Uri uri_listen(GLOBAL_ECC_URI_SELECTION); + dataShareHelper->RegisterObserver(uri_listen, settingsCallback); + dataShareHelper->Release(); +} } // namespace Telephony } // namespace OHOS diff --git a/services/manager/include/cellular_call_service.h b/services/manager/include/cellular_call_service.h index 76c61a06..6835c573 100755 --- a/services/manager/include/cellular_call_service.h +++ b/services/manager/include/cellular_call_service.h @@ -28,6 +28,8 @@ #include "singleton.h" #include "system_ability.h" #include "system_ability_status_change_stub.h" +#include "cellular_call_rdb_helper.h" +#include "data_ability_observer_stub.h" namespace OHOS { namespace Telephony { @@ -757,6 +759,7 @@ private: #endif void SubscribeToEvents(const std::vector& events, int priority = 0, const std::string& permission = ""); + void RegisterEccListener(); private: enum class SatelliteState { @@ -782,6 +785,7 @@ private: #ifdef BASE_POWER_IMPROVEMENT_FEATURE std::shared_ptr strEnterEventResult_ = nullptr; #endif + sptr settingsCallback_ = nullptr; private: class SystemAbilityStatusChangeListener : public OHOS::SystemAbilityStatusChangeStub { @@ -796,6 +800,12 @@ private: std::shared_ptr cellularCallHandler_ = nullptr; int32_t count_ = 0; }; + class EmergencyInfObserver : public AAFwk::DataAbilityObserverStub { + public: + EmergencyInfoObserver() = default; + virtual ~EmergencyInfoObserver() = default; + void OnChange() override; + } }; } // namespace Telephony } // namespace OHOS diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index 970bc31f..eeadc860 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -79,6 +79,7 @@ bool CellularCallService::Init() // connect ims_service DelayedSingleton::GetInstance()->Init(); TELEPHONY_LOGD("CellularCallService::Init, init success"); + RegisterEccListener(); return true; } @@ -1752,5 +1753,19 @@ void CellularCallService::ProcessFinishCommonEvent() } } #endif + +void CellularCallService::RegisterEccListener() +{ + if (settingsCallback_ == nullptr) { + settingsCallback_ = sptr::MakeSptr(); + } + DelayedSingleton::GetInstance()->RegisterListenState(settingsCallback_); +} + +void CellularCallService::EmergencyInfObserver::OnChange() +{ + CellularCallConfig config; + config.HandleEccListChange(); +} } // namespace Telephony } // namespace OHOS diff --git a/services/utils/include/cellular_call_config.h b/services/utils/include/cellular_call_config.h index a6d021fd..3158e6fa 100644 --- a/services/utils/include/cellular_call_config.h +++ b/services/utils/include/cellular_call_config.h @@ -17,6 +17,7 @@ #define CELLULAR_CALL_CONFIG_H #include +#include #include #include "config_request.h" @@ -24,6 +25,7 @@ #include "operator_config_types.h" #include "sim_state_type.h" #include "telephony_log_wrapper.h" +#include "ffrt.h" namespace OHOS { namespace Telephony { @@ -475,6 +477,7 @@ public: * @return bool */ bool IsVolteSupport(int32_t slotId); + void HandleEccListChange(); private: static void InitDefaultOperatorConfig(); @@ -507,8 +510,18 @@ private: std::vector &callListWithCard, std::vector &callListNoCard); int32_t CheckHomeAndPresentState(int32_t slotId, bool &isHoamAndPresent); bool GetRoamingState(int32_t slotId); + bool RegisterListenState(); + bool UnRegisterListenState(); + bool ProcessHplmnEccList(int32_t slotId, std::string hplmn, bool &isHplmnEccList, + std::vector &callListWithCard, std::vector &callListWithNoCard); + bool ProcessCurrentPlmnEccList(int32_t slotId, std::string hplmn, + std::vector &callListWithCard, std::vector &callListWithNoCard); private: + struct EccList { + std::string plmn = ""; + std::vector ecccInfoList = {}; + } static std::map modeTempMap_; static std::map modeMap_; static std::map> eccListRadioMap_; @@ -543,6 +556,9 @@ private: bool isRoaming_ = false; }; static std::map networkServiceState_; + static EccList hplmnEccList_[2]; + static EccList currentPlmnEccList_[2]; + static ffrt::mutex plmnMutex_; }; } // namespace Telephony } // namespace OHOS diff --git a/services/utils/src/cellular_call_config.cpp b/services/utils/src/cellular_call_config.cpp index 01ddf368..24da473c 100644 --- a/services/utils/src/cellular_call_config.cpp +++ b/services/utils/src/cellular_call_config.cpp @@ -45,6 +45,7 @@ const int32_t SAVE_IMS_SWITCH_SUCCESS_NOT_CHANGED = 2; const int32_t INVALID_SIM_ID = 0; const int32_t IMS_GBA_BIT = 0x02; const int32_t SYSTEM_PARAMETER_LENGTH = 0x02; +const int32_t SLOT_NUM = 2; const int MCC_LEN = 3; const std::string LAST_ICCID_KEY = "persist.telephony.last_iccid"; const std::string IMSSWITCH_STATE = "persist.telephony.imsswitch"; @@ -79,6 +80,9 @@ std::map CellularCallConfig::curPlmn_; std::map CellularCallConfig::networkServiceState_; std::map CellularCallConfig::readyToCall_; bool CellularCallConfig::isOperatorConfigInit_ = false; +CellularCallConfig::EccList CellularCallConfig::hplmnEccList_[SLOT_NUM]; +CellularCallConfig::EccList CellularCallConfig::currentPlmnEccList_[SLOT_NUM]; +ffrt::mutex CellularCallConfig::plmnMutex_; void CellularCallConfig::InitDefaultOperatorConfig() { @@ -333,36 +337,25 @@ int32_t CellularCallConfig::CheckHomeAndPresentState(int32_t slotId, bool &isHom void CellularCallConfig::UpdateEccNumberList(int32_t slotId) { + std::lock_guard lock(plmnMutex_); std::u16string u16Hplmn = u""; CoreManagerInner::GetInstance().GetSimOperatorNumeric(slotId, u16Hplmn); std::string hplmn = Str16ToStr8(u16Hplmn); std::vector callListWithCard; std::vector callListNoCard; - std::vector eccVec; bool isHomeAndPresent = false; + bool isHplmnEccList = false; if (CheckHomeAndPresentState(slotId, isHomeAndPresent) != TELEPHONY_SUCCESS) { return; } if (!hplmn.empty() && isHomeAndPresent) { - OperatorConfig operatorConfig; - CoreManagerInner::GetInstance().GetOperatorConfigs(slotId, operatorConfig); - callListWithCard = operatorConfig.stringArrayValue[KEY_EMERGENCY_CALL_STRING_ARRAY]; - if (callListWithCard.empty()) { - DelayedSingleton::GetInstance()->QueryEccList(hplmn, eccVec); - GetEccListFromResult(eccVec, callListWithCard, callListNoCard); + if (ProcessHplmnEccList(slotId, hplmn, isHplmnEccList, callListWithCard, callListNoCard)) { + return; } } else { - if (curPlmn_[slotId].empty()) { - std::u16string u16Rplmn = CoreManagerInner::GetInstance().GetOperatorNumeric(slotId); - std::string rplmn = Str16ToStr8(u16Rplmn); - if (rplmn.empty()) { - TELEPHONY_LOGE("rplmn is empty"); - return; - } - curPlmn_[slotId] = rplmn; + if (ProcessCurrentPlmnEccList(slotId, hplmn, callListWithCard, callListNoCard)) { + return; } - DelayedSingleton::GetInstance()->QueryEccList(curPlmn_[slotId], eccVec); - GetEccListFromResult(eccVec, callListWithCard, callListNoCard); } std::vector eccInfoList; for (auto it : callListWithCard) { @@ -371,9 +364,56 @@ void CellularCallConfig::UpdateEccNumberList(int32_t slotId) for (auto it : callListNoCard) { eccInfoList.push_back(BuildDefaultEmergencyCall(it, SimpresentType::TYPE_NO_CARD)); } + if (isHplmnEccList) { + hplmnEccList_[slotId].eccInfoList = eccInfoList; + hplmnEccList_[slotId].plmn = hplmn; + } else { + currentPlmnEccList_[slotId].eccInfoList = eccInfoList; + currentPlmnEccList_[slotId].plmn = curPlmn_[slotId]; + } SetEmergencyCallList(slotId, eccInfoList); } +bool CellularCallConfig::ProcessHplmnEccList(int32_t slotId, std::string hplmn, bool &isHplmnEccList, + std::vector &callListWithCard, std::vector &callListNoCard) +{ + if (hplmnEccList_[soltId].plmn == hplmn) { + SetEmergencyCallList(slotId, hplmnEccList_[slotId].ecccInfoList); + return true; + } + std::vector eccVec; + OperatorConfig operatorConfig; + CoreManagerInner::GetInstance().GetOperatorConfigs(slotId, operatorConfig); + callListWithCard = operatorConfig.stringArrayValue[KEY_EMERGENCY_CALL_STRING_ARRAY]; + if (callListWithCard.empty()) { + DelayedSingleton::GetInstance()->QueryEccList(hplmn, eccVec); + GetEccListFromResult(eccVec, callListWithCard, callListNoCard); + } + isHplmnEccList = true; + return false; +} + +bool CellularCallConfig::ProcessCurrentPlmnEccList(int32_t slotId, std::string hplmn, + std::vector &callListWithCard, std::vector &callListNoCard) +{ + if (curPlmn_[slotId].empty()) { + std::u16string u16Rplmn = CoreManagerInner::GetInstance().GetOperatorNumeric(slotId); + std::string rplmn = Str16ToStr8(u16Rplmn); + if (rplmn.empty()) { + TELEPHONY_LOGE("rplmn is empty"); + return; + } + curPlmn_[slotId] = rplmn; + } + std::vector eccVec; + if (currentPlmnEccList_[slotId].plmn == curPlmn_[slotId]) { + SetEmergencyCallList(slotId, currentPllmnEccList_[slotId].ecccInfoList); + return true; + } + DelayedSingleton::GetInstance()->QueryEccList(curPlmn_[slotId], eccVec); + GetEccListFromResult(eccVec, callListWithCard, callListNoCard); +} + void CellularCallConfig::HandleSimAccountLoaded(int32_t slotId) { TELEPHONY_LOGI("entry, slotId: %{public}d", slotId); @@ -1151,5 +1191,21 @@ bool CellularCallConfig::IsVolteSupport(int32_t slotId) "isVolteProvisioned[%{public}d]", slotId, volteSupported_[slotId], isGbaValid, imsSwitch, isVolteProvisioned); return volteSupported_[slotId] && isGbaValid && imsSwitch && isVolteProvisioned; } + +void CellularCallConfig::HandleEccListChange() +{ + std::unique_lock lock(plmnMutex_); + hplmnEccList_[0].plmn = ""; + hplmnEccList_[0].ecccInfoList.clear(); + hplmnEccList_[1].plmn = ""; + hplmnEccList_[1].ecccInfoList.clear(); + currentPlmnEccList_[0].plmn = ""; + currentPlmnEccList_[0].ecccInfoList.clear(); + currentPlmnEccList_[1].plmn = ""; + currentPlmnEccList_[1].ecccInfoList.clear(); + lock.unlock(); + UpdateEccNumberList(0); + UpdateEccNumberList(1); +} } // namespace Telephony } // namespace OHOS diff --git a/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn b/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn index 334e7c4d..6122ac9d 100644 --- a/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn +++ b/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn @@ -51,6 +51,8 @@ ohos_fuzztest("GetCallRestrictionFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/getcscalldata_fuzzer/BUILD.gn b/test/fuzztest/getcscalldata_fuzzer/BUILD.gn index 0cb0630c..df739b5a 100644 --- a/test/fuzztest/getcscalldata_fuzzer/BUILD.gn +++ b/test/fuzztest/getcscalldata_fuzzer/BUILD.gn @@ -50,6 +50,8 @@ ohos_fuzztest("GetCsCallDataFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/imscallback_fuzzer/BUILD.gn b/test/fuzztest/imscallback_fuzzer/BUILD.gn index 0fc871b1..24b0399e 100644 --- a/test/fuzztest/imscallback_fuzzer/BUILD.gn +++ b/test/fuzztest/imscallback_fuzzer/BUILD.gn @@ -49,6 +49,8 @@ ohos_fuzztest("ImsCallbackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "ffrt:libffrt", "graphic_surface:surface", "hilog:libhilog", diff --git a/test/fuzztest/imsclient_fuzzer/BUILD.gn b/test/fuzztest/imsclient_fuzzer/BUILD.gn index afe8ead4..b2e38305 100644 --- a/test/fuzztest/imsclient_fuzzer/BUILD.gn +++ b/test/fuzztest/imsclient_fuzzer/BUILD.gn @@ -49,6 +49,8 @@ ohos_fuzztest("ImsClientFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "ffrt:libffrt", "graphic_surface:surface", "hilog:libhilog", diff --git a/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn b/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn index 13c6da84..91d5e079 100644 --- a/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn +++ b/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn @@ -50,6 +50,8 @@ ohos_fuzztest("RegisterCallManagerCallBackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/satellitecallback_fuzzer/BUILD.gn b/test/fuzztest/satellitecallback_fuzzer/BUILD.gn index 5178fb74..09b5fd3b 100644 --- a/test/fuzztest/satellitecallback_fuzzer/BUILD.gn +++ b/test/fuzztest/satellitecallback_fuzzer/BUILD.gn @@ -52,6 +52,8 @@ ohos_fuzztest("SatelliteCallbackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/satelliteclient_fuzzer/BUILD.gn b/test/fuzztest/satelliteclient_fuzzer/BUILD.gn index 656c78dc..72a6695a 100644 --- a/test/fuzztest/satelliteclient_fuzzer/BUILD.gn +++ b/test/fuzztest/satelliteclient_fuzzer/BUILD.gn @@ -52,6 +52,8 @@ ohos_fuzztest("SatelliteClientFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn b/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn index 846a44d4..1acf59b0 100644 --- a/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn +++ b/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn @@ -50,6 +50,8 @@ ohos_fuzztest("SetImsFeatureValueFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn b/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn index 415d87cc..eda05156 100644 --- a/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn +++ b/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn @@ -50,6 +50,8 @@ ohos_fuzztest("SetPreviewWindowFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/unittest/cstest/BUILD.gn b/test/unittest/cstest/BUILD.gn index 7c03877e..93f3648b 100755 --- a/test/unittest/cstest/BUILD.gn +++ b/test/unittest/cstest/BUILD.gn @@ -47,6 +47,8 @@ ohos_unittest("cellular_call_cs_calloperation_test") { "core_service:tel_core_service_api", "eventhandler:libeventhandler", "core_service:ffrt_mocked", + "data_share":datashare_common", + "data_share":datashare_consumer", "graphic_surface:surface", "hilog:libhilog", "init:libbegetutil", @@ -91,6 +93,8 @@ ohos_unittest("cellular_call_cs1_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -137,6 +141,8 @@ ohos_unittest("cellular_call_cs2_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", diff --git a/test/unittest/imstest/zero_branch1_test.cpp b/test/unittest/imstest/zero_branch1_test.cpp index fb7f74fb..fc0b91fe 100644 --- a/test/unittest/imstest/zero_branch1_test.cpp +++ b/test/unittest/imstest/zero_branch1_test.cpp @@ -1149,7 +1149,22 @@ HWTEST_F(ZeroBranch1Test, Telephony_CellularCallRdbHelper_001, Function | Medium CoreManagerInner::GetInstance().GetSimOperatorNumeric(SIM1_SLOTID, u16Hplmn); std::string hplmn = Str16ToStr8(u16Hplmn); std::vector eccVec; - ASSERT_NE(DelayedSingleton::GetInstance()->QueryEccList(hplmn, eccVec), TELEPHONY_SUCCESS); + auto rdbHelper = DelayedSingleton::GetInstance(); + EXPECT_NE(rdbHelper->->QueryEccList(hplmn, eccVec), TELEPHONY_SUCCESS); + sptr callback = sptr::MakeSptr(); + rdbHelper->RegisterListenState(callback); + callback = nullptr; + rdbHelper->RegisterListenState(callback); + CellularCallConfig config; + std::vector callListWithCard; + std::vector callListNoCard; + config.hplmnEccList_[0].plmn = ""; + bool isHplmnEccList = false; + config.ProcessHplmnEccList(0, "", isHplmnEccList, callListWithCard, callListNoCard); + config.hplmnEccList_[0].plmn = "test"; + config.ProcessHplmnEccList(0, "", isHplmnEccList, callListWithCard, callListNoCard); + callListNoCard.push_back("element1"); + config.ProcessHplmnEccList(0, "", isHplmnEccList, callListWithCard, callListNoCard); } /** diff --git a/test/unittest/satellitetest/BUILD.gn b/test/unittest/satellitetest/BUILD.gn index b10fed30..76c0967f 100644 --- a/test/unittest/satellitetest/BUILD.gn +++ b/test/unittest/satellitetest/BUILD.gn @@ -46,6 +46,8 @@ ohos_unittest("cellular_call_satellite_callback_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -94,6 +96,8 @@ ohos_unittest("cellular_call_satellite_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -142,6 +146,8 @@ ohos_unittest("cellular_call_satellite_zero_branch_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", + "data_share":datashare_common", + "data_share":datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", -- Gitee From b587e839190c1d766dffe645bdbbdaebda454964 Mon Sep 17 00:00:00 2001 From: fanrui0 Date: Fri, 12 Sep 2025 12:53:02 +0800 Subject: [PATCH 2/4] updata ecclist Signed-off-by: fanrui0 --- .../common/src/cellular_call_rdb_helper.cpp | 1 + .../manager/include/cellular_call_service.h | 4 ++-- services/manager/src/cellular_call_service.cpp | 2 +- services/utils/include/cellular_call_config.h | 8 ++++---- services/utils/src/cellular_call_config.cpp | 17 +++++++++-------- .../fuzztest/getcallrestriction_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/getcscalldata_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/imscallback_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/imsclient_fuzzer/BUILD.gn | 4 ++-- .../registercallmanagercallback_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/satellitecallback_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/satelliteclient_fuzzer/BUILD.gn | 4 ++-- .../fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn | 4 ++-- test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn | 4 ++-- test/unittest/cstest/BUILD.gn | 12 ++++++------ test/unittest/imstest/zero_branch1_test.cpp | 2 +- test/unittest/satellitetest/BUILD.gn | 12 ++++++------ 17 files changed, 48 insertions(+), 46 deletions(-) diff --git a/services/common/src/cellular_call_rdb_helper.cpp b/services/common/src/cellular_call_rdb_helper.cpp index 8cb3fa20..73e86ff6 100644 --- a/services/common/src/cellular_call_rdb_helper.cpp +++ b/services/common/src/cellular_call_rdb_helper.cpp @@ -98,6 +98,7 @@ void CellularCallRdbHelper::RegisterListenState(sptrRegisterObserver(uri_listen, settingsCallback); diff --git a/services/manager/include/cellular_call_service.h b/services/manager/include/cellular_call_service.h index 6835c573..5e3066d1 100755 --- a/services/manager/include/cellular_call_service.h +++ b/services/manager/include/cellular_call_service.h @@ -800,12 +800,12 @@ private: std::shared_ptr cellularCallHandler_ = nullptr; int32_t count_ = 0; }; - class EmergencyInfObserver : public AAFwk::DataAbilityObserverStub { + class EmergencyInfoObserver : public AAFwk::DataAbilityObserverStub { public: EmergencyInfoObserver() = default; virtual ~EmergencyInfoObserver() = default; void OnChange() override; - } + }; }; } // namespace Telephony } // namespace OHOS diff --git a/services/manager/src/cellular_call_service.cpp b/services/manager/src/cellular_call_service.cpp index eeadc860..21748373 100755 --- a/services/manager/src/cellular_call_service.cpp +++ b/services/manager/src/cellular_call_service.cpp @@ -1762,7 +1762,7 @@ void CellularCallService::RegisterEccListener() DelayedSingleton::GetInstance()->RegisterListenState(settingsCallback_); } -void CellularCallService::EmergencyInfObserver::OnChange() +void CellularCallService::EmergencyInfoObserver::OnChange() { CellularCallConfig config; config.HandleEccListChange(); diff --git a/services/utils/include/cellular_call_config.h b/services/utils/include/cellular_call_config.h index 3158e6fa..984a1b3b 100644 --- a/services/utils/include/cellular_call_config.h +++ b/services/utils/include/cellular_call_config.h @@ -513,15 +513,15 @@ private: bool RegisterListenState(); bool UnRegisterListenState(); bool ProcessHplmnEccList(int32_t slotId, std::string hplmn, bool &isHplmnEccList, - std::vector &callListWithCard, std::vector &callListWithNoCard); + std::vector &callListWithCard, std::vector &callListNoCard); bool ProcessCurrentPlmnEccList(int32_t slotId, std::string hplmn, - std::vector &callListWithCard, std::vector &callListWithNoCard); + std::vector &callListWithCard, std::vector &callListNoCard); private: struct EccList { std::string plmn = ""; - std::vector ecccInfoList = {}; - } + std::vector eccInfoList = {}; + }; static std::map modeTempMap_; static std::map modeMap_; static std::map> eccListRadioMap_; diff --git a/services/utils/src/cellular_call_config.cpp b/services/utils/src/cellular_call_config.cpp index 24da473c..6f8cbdd6 100644 --- a/services/utils/src/cellular_call_config.cpp +++ b/services/utils/src/cellular_call_config.cpp @@ -374,10 +374,10 @@ void CellularCallConfig::UpdateEccNumberList(int32_t slotId) SetEmergencyCallList(slotId, eccInfoList); } -bool CellularCallConfig::ProcessHplmnEccList(int32_t slotId, std::string hplmn, bool &isHplmnEccList, +bool CellularCallConfig::ProcessHplmnEccList(int32_t slotId, std::string hplmn, bool &isHplmnEccList, std::vector &callListWithCard, std::vector &callListNoCard) { - if (hplmnEccList_[soltId].plmn == hplmn) { + if (hplmnEccList_[slotId].plmn == hplmn) { SetEmergencyCallList(slotId, hplmnEccList_[slotId].ecccInfoList); return true; } @@ -401,17 +401,18 @@ bool CellularCallConfig::ProcessCurrentPlmnEccList(int32_t slotId, std::string h std::string rplmn = Str16ToStr8(u16Rplmn); if (rplmn.empty()) { TELEPHONY_LOGE("rplmn is empty"); - return; + return true; } curPlmn_[slotId] = rplmn; } std::vector eccVec; if (currentPlmnEccList_[slotId].plmn == curPlmn_[slotId]) { - SetEmergencyCallList(slotId, currentPllmnEccList_[slotId].ecccInfoList); + SetEmergencyCallList(slotId, currentPlmnEccList_[slotId].eccInfoList); return true; } DelayedSingleton::GetInstance()->QueryEccList(curPlmn_[slotId], eccVec); GetEccListFromResult(eccVec, callListWithCard, callListNoCard); + return false; } void CellularCallConfig::HandleSimAccountLoaded(int32_t slotId) @@ -1196,13 +1197,13 @@ void CellularCallConfig::HandleEccListChange() { std::unique_lock lock(plmnMutex_); hplmnEccList_[0].plmn = ""; - hplmnEccList_[0].ecccInfoList.clear(); + hplmnEccList_[0].eccInfoList.clear(); hplmnEccList_[1].plmn = ""; - hplmnEccList_[1].ecccInfoList.clear(); + hplmnEccList_[1].eccInfoList.clear(); currentPlmnEccList_[0].plmn = ""; - currentPlmnEccList_[0].ecccInfoList.clear(); + currentPlmnEccList_[0].eccInfoList.clear(); currentPlmnEccList_[1].plmn = ""; - currentPlmnEccList_[1].ecccInfoList.clear(); + currentPlmnEccList_[1].eccInfoList.clear(); lock.unlock(); UpdateEccNumberList(0); UpdateEccNumberList(1); diff --git a/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn b/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn index 6122ac9d..bff420b0 100644 --- a/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn +++ b/test/fuzztest/getcallrestriction_fuzzer/BUILD.gn @@ -51,8 +51,8 @@ ohos_fuzztest("GetCallRestrictionFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/getcscalldata_fuzzer/BUILD.gn b/test/fuzztest/getcscalldata_fuzzer/BUILD.gn index df739b5a..ffa0e26f 100644 --- a/test/fuzztest/getcscalldata_fuzzer/BUILD.gn +++ b/test/fuzztest/getcscalldata_fuzzer/BUILD.gn @@ -50,8 +50,8 @@ ohos_fuzztest("GetCsCallDataFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/imscallback_fuzzer/BUILD.gn b/test/fuzztest/imscallback_fuzzer/BUILD.gn index 24b0399e..5dbb9ae6 100644 --- a/test/fuzztest/imscallback_fuzzer/BUILD.gn +++ b/test/fuzztest/imscallback_fuzzer/BUILD.gn @@ -49,8 +49,8 @@ ohos_fuzztest("ImsCallbackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "ffrt:libffrt", "graphic_surface:surface", "hilog:libhilog", diff --git a/test/fuzztest/imsclient_fuzzer/BUILD.gn b/test/fuzztest/imsclient_fuzzer/BUILD.gn index b2e38305..2a229947 100644 --- a/test/fuzztest/imsclient_fuzzer/BUILD.gn +++ b/test/fuzztest/imsclient_fuzzer/BUILD.gn @@ -49,8 +49,8 @@ ohos_fuzztest("ImsClientFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "ffrt:libffrt", "graphic_surface:surface", "hilog:libhilog", diff --git a/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn b/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn index 91d5e079..7ca8ae14 100644 --- a/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn +++ b/test/fuzztest/registercallmanagercallback_fuzzer/BUILD.gn @@ -50,8 +50,8 @@ ohos_fuzztest("RegisterCallManagerCallBackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/satellitecallback_fuzzer/BUILD.gn b/test/fuzztest/satellitecallback_fuzzer/BUILD.gn index 09b5fd3b..64384a8d 100644 --- a/test/fuzztest/satellitecallback_fuzzer/BUILD.gn +++ b/test/fuzztest/satellitecallback_fuzzer/BUILD.gn @@ -52,8 +52,8 @@ ohos_fuzztest("SatelliteCallbackFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/satelliteclient_fuzzer/BUILD.gn b/test/fuzztest/satelliteclient_fuzzer/BUILD.gn index 72a6695a..8d97dabd 100644 --- a/test/fuzztest/satelliteclient_fuzzer/BUILD.gn +++ b/test/fuzztest/satelliteclient_fuzzer/BUILD.gn @@ -52,8 +52,8 @@ ohos_fuzztest("SatelliteClientFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn b/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn index 1acf59b0..c64cd229 100644 --- a/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn +++ b/test/fuzztest/setimsfeaturevalue_fuzzer/BUILD.gn @@ -50,8 +50,8 @@ ohos_fuzztest("SetImsFeatureValueFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn b/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn index eda05156..fe4740aa 100644 --- a/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn +++ b/test/fuzztest/setpreviewwindow_fuzzer/BUILD.gn @@ -50,8 +50,8 @@ ohos_fuzztest("SetPreviewWindowFuzzTest") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "ffrt:libffrt", "graphic_surface:surface", diff --git a/test/unittest/cstest/BUILD.gn b/test/unittest/cstest/BUILD.gn index 93f3648b..3f915978 100755 --- a/test/unittest/cstest/BUILD.gn +++ b/test/unittest/cstest/BUILD.gn @@ -47,8 +47,8 @@ ohos_unittest("cellular_call_cs_calloperation_test") { "core_service:tel_core_service_api", "eventhandler:libeventhandler", "core_service:ffrt_mocked", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "graphic_surface:surface", "hilog:libhilog", "init:libbegetutil", @@ -93,8 +93,8 @@ ohos_unittest("cellular_call_cs1_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -141,8 +141,8 @@ ohos_unittest("cellular_call_cs2_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", diff --git a/test/unittest/imstest/zero_branch1_test.cpp b/test/unittest/imstest/zero_branch1_test.cpp index fc0b91fe..aa990cf6 100644 --- a/test/unittest/imstest/zero_branch1_test.cpp +++ b/test/unittest/imstest/zero_branch1_test.cpp @@ -1150,7 +1150,7 @@ HWTEST_F(ZeroBranch1Test, Telephony_CellularCallRdbHelper_001, Function | Medium std::string hplmn = Str16ToStr8(u16Hplmn); std::vector eccVec; auto rdbHelper = DelayedSingleton::GetInstance(); - EXPECT_NE(rdbHelper->->QueryEccList(hplmn, eccVec), TELEPHONY_SUCCESS); + EXPECT_NE(rdbHelper->QueryEccList(hplmn, eccVec), TELEPHONY_SUCCESS); sptr callback = sptr::MakeSptr(); rdbHelper->RegisterListenState(callback); callback = nullptr; diff --git a/test/unittest/satellitetest/BUILD.gn b/test/unittest/satellitetest/BUILD.gn index 76c0967f..f41d2143 100644 --- a/test/unittest/satellitetest/BUILD.gn +++ b/test/unittest/satellitetest/BUILD.gn @@ -46,8 +46,8 @@ ohos_unittest("cellular_call_satellite_callback_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -96,8 +96,8 @@ ohos_unittest("cellular_call_satellite_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", @@ -146,8 +146,8 @@ ohos_unittest("cellular_call_satellite_zero_branch_test") { "common_event_service:cesfwk_innerkits", "core_service:libtel_common", "core_service:tel_core_service_api", - "data_share":datashare_common", - "data_share":datashare_consumer", + "data_share:datashare_common", + "data_share:datashare_consumer", "eventhandler:libeventhandler", "core_service:ffrt_mocked", "graphic_surface:surface", -- Gitee From 2c3d54526445d5a80f4a152c67900ae4eb818d04 Mon Sep 17 00:00:00 2001 From: fanrui0 Date: Fri, 12 Sep 2025 14:21:32 +0800 Subject: [PATCH 3/4] updata ecclist Signed-off-by: fanrui0 --- 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 6f8cbdd6..2cc34d45 100644 --- a/services/utils/src/cellular_call_config.cpp +++ b/services/utils/src/cellular_call_config.cpp @@ -378,7 +378,7 @@ bool CellularCallConfig::ProcessHplmnEccList(int32_t slotId, std::string hplmn, std::vector &callListWithCard, std::vector &callListNoCard) { if (hplmnEccList_[slotId].plmn == hplmn) { - SetEmergencyCallList(slotId, hplmnEccList_[slotId].ecccInfoList); + SetEmergencyCallList(slotId, hplmnEccList_[slotId].eccInfoList); return true; } std::vector eccVec; -- Gitee From dd42885e8602bd31e3aba171bdb5e41a651eaa56 Mon Sep 17 00:00:00 2001 From: fanrui0 Date: Fri, 12 Sep 2025 07:04:20 +0000 Subject: [PATCH 4/4] update test/unittest/imstest/zero_branch1_test.cpp. Signed-off-by: fanrui0 --- test/unittest/imstest/zero_branch1_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittest/imstest/zero_branch1_test.cpp b/test/unittest/imstest/zero_branch1_test.cpp index aa990cf6..c189dc94 100644 --- a/test/unittest/imstest/zero_branch1_test.cpp +++ b/test/unittest/imstest/zero_branch1_test.cpp @@ -1151,7 +1151,7 @@ HWTEST_F(ZeroBranch1Test, Telephony_CellularCallRdbHelper_001, Function | Medium std::vector eccVec; auto rdbHelper = DelayedSingleton::GetInstance(); EXPECT_NE(rdbHelper->QueryEccList(hplmn, eccVec), TELEPHONY_SUCCESS); - sptr callback = sptr::MakeSptr(); + sptr callback = sptr::MakeSptr(); rdbHelper->RegisterListenState(callback); callback = nullptr; rdbHelper->RegisterListenState(callback); -- Gitee