fix: fix circle deps between i18n and coreservice

Signed-off-by: liujiandong <liujiandong1@huawei.com>
This commit is contained in:
YOUR_NAME 2022-10-24 09:38:17 +08:00
parent 52e1869a98
commit bf91569f91
7 changed files with 13 additions and 1 deletions

View File

@ -37,6 +37,7 @@ inline constexpr const char *DEFAULT_PREFERRED_NETWORK_TYPE = "5"; // CORE_NETWO
inline constexpr const char *TEL_PREFERRED_NETWORK_TYPE = "const.telephony.preferredNetworkType";
inline constexpr const char *DEFAULT_OPERATOR_KEY = "";
inline constexpr const char *OPKEY_PROP_PREFIX = "persist.telephony.opkey";
inline constexpr const char *COUNTRY_CODE_KEY = "telephony.sim.countryCode";
template<typename T>
inline T GetMaxSlotCount()

View File

@ -12,3 +12,4 @@
# limitations under the License.
persist.telephony.="radio:radio:775"
telephony.="radio:radio:775"

View File

@ -93,6 +93,7 @@ protected:
virtual void OnAllFilesFetched() = 0;
bool LockQueriedOrNot();
void UpdateSPN(const std::string spn);
void SaveCountryCode();
std::shared_ptr<Telephony::ITelRilManager> telRilManager_ = nullptr;
std::shared_ptr<IccFileController> fileController_ = nullptr;
std::shared_ptr<SimStateManager> stateManager_ = nullptr;

View File

@ -539,5 +539,12 @@ void IccFile::UnInit()
}
ClearData();
}
void IccFile::SaveCountryCode()
{
std::string countryCode = ObtainIsoCountryCode();
std::string key = COUNTRY_CODE_KEY + std::to_string(slotId_);
SetParameter(key.c_str(), countryCode.c_str());
}
} // namespace Telephony
} // namespace OHOS

View File

@ -134,6 +134,7 @@ bool IsimFile::ProcessGetImsiDone(const AppExecFwk::InnerEvent::Pointer &event)
if (sharedObject != nullptr) {
imsi_ = *sharedObject;
TELEPHONY_LOGI("IsimFile::ProcessEvent MSG_SIM_OBTAIN_IMSI_DONE");
SaveCountryCode();
if (!imsi_.empty()) {
imsiReadyObser_->NotifyObserver(RadioEvent::RADIO_IMSI_LOADED_READY);
}

View File

@ -191,6 +191,7 @@ bool RuimFile::ProcessGetImsiDone(const AppExecFwk::InnerEvent::Pointer &event)
if (sharedObject != nullptr) {
imsi_ = *sharedObject;
TELEPHONY_LOGI("RuimFile::ProcessEvent MSG_SIM_OBTAIN_IMSI_DONE");
SaveCountryCode();
if (!imsi_.empty()) {
imsiReadyObser_->NotifyObserver(RadioEvent::RADIO_IMSI_LOADED_READY);
}

View File

@ -736,7 +736,7 @@ bool SimFile::ProcessObtainIMSIDone(const AppExecFwk::InnerEvent::Pointer &event
if (sharedObject != nullptr) {
imsi_ = *sharedObject;
TELEPHONY_LOGI("SimFile::ProcessEvent IMSI received success");
std::string iso = ObtainIsoCountryCode();
SaveCountryCode();
TELEPHONY_LOGI("SimFile::ObtainIsoCountryCode result success");
if (!imsi_.empty()) {
imsiReadyObser_->NotifyObserver(RadioEvent::RADIO_IMSI_LOADED_READY);