iccfresh bugfix

Signed-off-by: Jierbumo866 <fangping5@huawei.com>
This commit is contained in:
Jierbumo866 2024-01-31 18:23:25 +08:00
parent 932f9193c7
commit 9db469b31c
6 changed files with 15 additions and 7 deletions

View File

@ -85,6 +85,7 @@ public:
virtual bool SetVoiceCallForwarding(bool enable, const std::string &number) = 0;
virtual std::string GetVoiceMailNumber() = 0;
virtual void SetVoiceMailNumber(const std::string mailNumber) = 0;
virtual void ProcessIccRefresh(int msgId) = 0;
bool HasSimCard();
void UnInit();
void ClearData();
@ -93,7 +94,6 @@ public:
void LoadVoiceMail();
protected:
virtual void ProcessIccRefresh(int msgId) = 0;
virtual void ProcessFileLoaded(bool response) = 0;
virtual void OnAllFilesFetched() = 0;
bool LockQueriedOrNot();

View File

@ -35,13 +35,13 @@ public:
bool UpdateVoiceMail(const std::string &mailName, const std::string &mailNumber);
bool SetVoiceMailCount(int32_t voiceMailCount);
bool SetVoiceCallForwarding(bool enable, const std::string &number);
void ProcessIccRefresh(int msgId);
int ObtainSpnCondition(bool roaming, const std::string &operatorNum);
std::string ObtainIsoCountryCode();
std::string GetVoiceMailNumber();
void SetVoiceMailNumber(const std::string mailNumber);
protected:
void ProcessIccRefresh(int msgId);
void ProcessFileLoaded(bool response);
void OnAllFilesFetched();
void LoadIsimFiles();

View File

@ -41,12 +41,12 @@ public:
int ObtainSpnCondition(bool roaming, const std::string &operatorNum);
bool UpdateVoiceMail(const std::string &mailName, const std::string &mailNumber);
bool SetVoiceMailCount(int32_t voiceMailCount);
void ProcessIccRefresh(int msgId);
bool SetVoiceCallForwarding(bool enable, const std::string &number);
std::string GetVoiceMailNumber();
void SetVoiceMailNumber(const std::string mailNumber);
protected:
void ProcessIccRefresh(int msgId);
void ProcessFileLoaded(bool response);
void OnAllFilesFetched();
void LoadRuimFiles();

View File

@ -38,6 +38,7 @@ public:
bool UpdateVoiceMail(const std::string &mailName, const std::string &mailNumber);
bool SetVoiceMailCount(int32_t voiceMailCount);
bool SetVoiceCallForwarding(bool enable, const std::string &number);
void ProcessIccRefresh(int msgId);
std::string GetVoiceMailNumber();
void SetVoiceMailNumber(const std::string mailNumber);
@ -49,7 +50,6 @@ protected:
OBTAIN_OPERATOR_NAMESTRING,
OBTAIN_OPERATOR_NAME_SHORTFORM
};
void ProcessIccRefresh(int msgId);
void ProcessFileLoaded(bool response);
void OnAllFilesFetched();
void LoadSimFiles();

View File

@ -90,7 +90,6 @@ void IccFile::Init()
stateManager_->RegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_READY);
stateManager_->RegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_LOCKED);
stateManager_->RegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_SIMLOCK);
stateManager_->RegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_ICC_REFRESH);
}
}
@ -321,7 +320,7 @@ void IccFile::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
result = ProcessIccFileObtained(event);
ProcessFileLoaded(result);
break;
case RadioEvent::RADIO_ICC_REFRESH:
case MSG_ICC_REFRESH:
ProcessIccRefresh(MSG_ID_DEFAULT);
break;
default:
@ -643,7 +642,6 @@ void IccFile::UnInit()
stateManager_->UnRegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_READY);
stateManager_->UnRegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_LOCKED);
stateManager_->UnRegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_SIM_STATE_SIMLOCK);
stateManager_->UnRegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_ICC_REFRESH);
}
ClearData();
}

View File

@ -118,6 +118,7 @@ void SimFileManager::Init(int slotId)
simStateManager->RegisterCoreNotify(shared_from_this(), RadioEvent::RADIO_CARD_TYPE_CHANGE);
telRilManager->RegisterCoreNotify(slotId, shared_from_this(), RadioEvent::RADIO_VOICE_TECH_CHANGED, nullptr);
telRilManager->RegisterCoreNotify(slotId_, shared_from_this(), RadioEvent::RADIO_ICC_REFRESH, nullptr);
TELEPHONY_LOGI("SimFileManager::Init() end");
}
@ -760,6 +761,15 @@ void SimFileManager::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
HandleSimRecordsLoaded();
break;
}
case RadioEvent::RADIO_ICC_REFRESH: {
TELEPHONY_LOGI("SimFileManager::ProcessEvent, handle sim refresh event");
if (simFile_ == nullptr) {
TELEPHONY_LOGE("simFile_ is null");
return;
}
simFile_->ProcessIccRefresh(MSG_ID_DEFAULT);
break;
};
default:
break;
}