mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2025-03-07 01:07:18 +00:00
commit
d2f4554de1
@ -464,7 +464,8 @@ bool NapiUtil::CreateCallErrorMessageForJs(int32_t errorCode, JsError &error)
|
||||
return flag;
|
||||
}
|
||||
|
||||
JsError NapiUtil::ConverErrorMessageWithPermissionForJs(int32_t errorCode, std::string funcName, std::string permission)
|
||||
JsError NapiUtil::ConverErrorMessageWithPermissionForJs(
|
||||
int32_t errorCode, const std::string &funcName, const std::string &permission)
|
||||
{
|
||||
if (errorCode == TELEPHONY_ERR_PERMISSION_ERR) {
|
||||
JsError error = {};
|
||||
|
@ -63,7 +63,7 @@ public:
|
||||
static bool CreateCommonErrorMessageForJs(int32_t errorCode, JsError &error);
|
||||
static bool CreateCallErrorMessageForJs(int32_t errorCode, JsError &error);
|
||||
static JsError ConverErrorMessageWithPermissionForJs(
|
||||
int32_t errorCode, std::string funcName, std::string permission);
|
||||
int32_t errorCode, const std::string &funcName, const std::string &permission);
|
||||
};
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -1725,7 +1725,8 @@ static void NativeGetCellInformation(napi_env env, void *data)
|
||||
asyncContext->cellInformations =
|
||||
DelayedRefSingleton<CoreServiceClient>::GetInstance().GetCellInfoList(asyncContext->slotId);
|
||||
asyncContext->resolved = true;
|
||||
TELEPHONY_LOGI("NativeGetCellInformation len = %{public}lu", (unsigned long)asyncContext->cellInformations.size());
|
||||
TELEPHONY_LOGI("NativeGetCellInformation len = %{public}lu",
|
||||
static_cast<unsigned long>(asyncContext->cellInformations.size()));
|
||||
asyncContext->resolved = (asyncContext->cellInformations.size() != 0);
|
||||
}
|
||||
|
||||
@ -1943,19 +1944,13 @@ static void GetNrOptionModeCallback(napi_env env, napi_status status, void *data
|
||||
{
|
||||
auto context = static_cast<GetNrOptionModeContext *>(data);
|
||||
TELEPHONY_LOGI("GetNrOptionModeCallback resolved = %{public}d", context->resolved);
|
||||
napi_value callbackValue = nullptr;
|
||||
napi_value callbackValue = ParseErrorValue(env, context->errorCode, "GetNrOptionMode");
|
||||
if (status == napi_ok) {
|
||||
if (context->resolved) {
|
||||
napi_create_int32(env, context->nrOptionMode, &callbackValue);
|
||||
} else {
|
||||
if (context->errorCode == ERROR_SLOT_ID_INVALID) {
|
||||
callbackValue = NapiUtil::CreateErrorMessage(env, "slotId is invalid", ERROR_SLOT_ID_INVALID);
|
||||
} else {
|
||||
callbackValue = ParseErrorValue(env, context->errorCode, "getNrOptionMode error");
|
||||
}
|
||||
} else if (context->errorCode == ERROR_SLOT_ID_INVALID) {
|
||||
callbackValue = NapiUtil::CreateErrorMessage(env, "slotId is invalid", ERROR_SLOT_ID_INVALID);
|
||||
}
|
||||
} else {
|
||||
callbackValue = ParseErrorValue(env, context->errorCode, "getNrOptionMode failed");
|
||||
}
|
||||
NapiUtil::Handle2ValueCallback(env, context, callbackValue);
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
constexpr int ARGC_MAX = 3;
|
||||
struct AsyncPara {
|
||||
std::string funcName = "";
|
||||
napi_env env = nullptr;
|
||||
@ -119,7 +120,6 @@ napi_value NapiCreateAsyncWork2(const AsyncPara ¶, AsyncContextType *asyncCo
|
||||
napi_value NapiCreateAsyncWork4(const AsyncPara ¶, AsyncContextPIN *context, napi_ref *ref)
|
||||
{
|
||||
napi_env env = para.env;
|
||||
constexpr int ARGC_MAX = 3;
|
||||
size_t argc = ARGC_MAX;
|
||||
napi_value argv[ARGC_MAX] = {nullptr};
|
||||
NAPI_CALL(env, napi_get_cb_info(env, para.info, &argc, argv, nullptr, nullptr));
|
||||
@ -147,7 +147,7 @@ napi_value NapiCreateAsyncWork4(const AsyncPara ¶, AsyncContextPIN *context,
|
||||
|
||||
template<typename T>
|
||||
void NapiAsyncCompleteCallback(napi_env env, napi_status status, const AsyncContext<T> &asyncContext,
|
||||
std::string errMessage, bool funcIgnoreReturnVal = false, int errorCode = ERROR_DEFAULT)
|
||||
const std::string &errMessage, bool funcIgnoreReturnVal = false, int errorCode = ERROR_DEFAULT)
|
||||
{
|
||||
if (status != napi_ok) {
|
||||
napi_throw_type_error(env, nullptr, "excute failed");
|
||||
@ -1220,7 +1220,7 @@ void NativeGetIMSI(napi_env env, void *data)
|
||||
TELEPHONY_LOGI("NAPI NativeGetIMSI success");
|
||||
} else {
|
||||
TELEPHONY_LOGE("NAPI NativeGetIMSI IMSI length is invalid %{public}lu",
|
||||
(unsigned long)asyncContext->callbackVal.length());
|
||||
static_cast<unsigned long>(asyncContext->callbackVal.length()));
|
||||
}
|
||||
asyncContext->context.resolved = !(asyncContext->callbackVal.empty());
|
||||
}
|
||||
|
@ -1449,7 +1449,7 @@ bool CoreManagerInner::SetPrimarySlotId(int32_t slotId)
|
||||
return simManager_->SetPrimarySlotId(slotId);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
bool CoreManagerInner::SetShowNumber(int32_t slotId, const std::u16string &number)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1458,7 +1458,7 @@ bool CoreManagerInner::SetShowNumber(int32_t slotId, const std::u16string number
|
||||
return simManager_->SetShowNumber(slotId, number);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::SetShowName(int32_t slotId, const std::u16string name)
|
||||
bool CoreManagerInner::SetShowName(int32_t slotId, const std::u16string &name)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1720,7 +1720,7 @@ int32_t CoreManagerInner::GetCardType(int32_t slotId)
|
||||
return static_cast<int32_t>(simManager_->GetCardType(slotId));
|
||||
}
|
||||
|
||||
bool CoreManagerInner::UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response)
|
||||
bool CoreManagerInner::UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1729,7 +1729,8 @@ bool CoreManagerInner::UnlockPin(int32_t slotId, std::string pin, LockStatusResp
|
||||
return simManager_->UnlockPin(slotId, pin, response);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::UnlockPuk(int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response)
|
||||
bool CoreManagerInner::UnlockPuk(
|
||||
int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1738,7 +1739,8 @@ bool CoreManagerInner::UnlockPuk(int32_t slotId, std::string newPin, std::string
|
||||
return simManager_->UnlockPuk(slotId, newPin, puk, response);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::AlterPin(int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response)
|
||||
bool CoreManagerInner::AlterPin(
|
||||
int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1774,7 +1776,7 @@ int32_t CoreManagerInner::RefreshSimState(int32_t slotId)
|
||||
return simManager_->RefreshSimState(slotId);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response)
|
||||
bool CoreManagerInner::UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1783,7 +1785,8 @@ bool CoreManagerInner::UnlockPin2(int32_t slotId, std::string pin2, LockStatusRe
|
||||
return simManager_->UnlockPin2(slotId, pin2, response);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response)
|
||||
bool CoreManagerInner::UnlockPuk2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
@ -1792,7 +1795,8 @@ bool CoreManagerInner::UnlockPuk2(int32_t slotId, std::string newPin2, std::stri
|
||||
return simManager_->UnlockPuk2(slotId, newPin2, puk2, response);
|
||||
}
|
||||
|
||||
bool CoreManagerInner::AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response)
|
||||
bool CoreManagerInner::AlterPin2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null!");
|
||||
|
@ -424,7 +424,7 @@ int32_t CoreServiceClient::GetDefaultVoiceSlotId()
|
||||
return proxy->GetDefaultVoiceSlotId();
|
||||
}
|
||||
|
||||
bool CoreServiceClient::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
bool CoreServiceClient::SetShowNumber(int32_t slotId, const std::u16string &number)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -444,7 +444,7 @@ std::u16string CoreServiceClient::GetShowNumber(int32_t slotId)
|
||||
return proxy->GetShowNumber(slotId);
|
||||
}
|
||||
|
||||
bool CoreServiceClient::SetShowName(int32_t slotId, const std::u16string name)
|
||||
bool CoreServiceClient::SetShowName(int32_t slotId, const std::u16string &name)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -484,7 +484,7 @@ bool CoreServiceClient::GetOperatorConfigs(int32_t slotId, OperatorConfig &poc)
|
||||
return proxy->GetOperatorConfigs(slotId, poc);
|
||||
}
|
||||
|
||||
bool CoreServiceClient::UnlockPin(int32_t slotId, std::u16string pin, LockStatusResponse &response)
|
||||
bool CoreServiceClient::UnlockPin(int32_t slotId, const std::u16string &pin, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -495,7 +495,7 @@ bool CoreServiceClient::UnlockPin(int32_t slotId, std::u16string pin, LockStatus
|
||||
}
|
||||
|
||||
bool CoreServiceClient::UnlockPuk(
|
||||
int32_t slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response)
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -506,7 +506,7 @@ bool CoreServiceClient::UnlockPuk(
|
||||
}
|
||||
|
||||
bool CoreServiceClient::AlterPin(
|
||||
int32_t slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response)
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -516,7 +516,7 @@ bool CoreServiceClient::AlterPin(
|
||||
return proxy->AlterPin(slotId, newPin, oldPin, response);
|
||||
}
|
||||
|
||||
bool CoreServiceClient::UnlockPin2(int32_t slotId, std::u16string pin2, LockStatusResponse &response)
|
||||
bool CoreServiceClient::UnlockPin2(int32_t slotId, const std::u16string &pin2, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -527,7 +527,7 @@ bool CoreServiceClient::UnlockPin2(int32_t slotId, std::u16string pin2, LockStat
|
||||
}
|
||||
|
||||
bool CoreServiceClient::UnlockPuk2(
|
||||
int32_t slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response)
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -538,7 +538,7 @@ bool CoreServiceClient::UnlockPuk2(
|
||||
}
|
||||
|
||||
bool CoreServiceClient::AlterPin2(
|
||||
int32_t slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response)
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2, LockStatusResponse &response)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ namespace Telephony {
|
||||
NetworkSearchResult::NetworkSearchResult() {}
|
||||
|
||||
void NetworkSearchResult::SetNetworkSearchResultValue(
|
||||
int32_t listSize, std::vector<NetworkInformation> &operatorInfo)
|
||||
int32_t listSize, const std::vector<NetworkInformation> &operatorInfo)
|
||||
{
|
||||
listSize_ = listSize;
|
||||
operatorInfoList_ = operatorInfo;
|
||||
|
@ -36,7 +36,8 @@ int32_t TelephonyStateRegistryProxy::UpdateCellularDataConnectState(
|
||||
int32_t slotId, int32_t dataStatus, int32_t networkForm)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -66,7 +67,8 @@ int32_t TelephonyStateRegistryProxy::UpdateCellularDataFlow(
|
||||
int32_t slotId, int32_t dataFlowType)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -93,7 +95,8 @@ int32_t TelephonyStateRegistryProxy::UpdateCallState(
|
||||
int32_t slotId, int32_t callStatus, const std::u16string &number)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -123,7 +126,8 @@ int32_t TelephonyStateRegistryProxy::UpdateCallStateForSlotId(
|
||||
int32_t slotId, int32_t callId, int32_t callStatus, const std::u16string &number)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -156,7 +160,8 @@ int32_t TelephonyStateRegistryProxy::UpdateSignalInfo(
|
||||
int32_t slotId, const std::vector<sptr<SignalInformation>> &vec)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -190,7 +195,8 @@ int32_t TelephonyStateRegistryProxy::UpdateCellInfo(
|
||||
int32_t slotId, const std::vector<sptr<CellInformation>> &vec)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -224,7 +230,8 @@ int32_t TelephonyStateRegistryProxy::UpdateNetworkState(
|
||||
int32_t slotId, const sptr<NetworkState> &networkState)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -251,7 +258,8 @@ int32_t TelephonyStateRegistryProxy::UpdateSimState(
|
||||
int32_t slotId, CardType type, SimState state, LockReason reason)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -284,7 +292,8 @@ int32_t TelephonyStateRegistryProxy::RegisterStateChange(
|
||||
const sptr<TelephonyObserverBroker> &callback, int32_t slotId, uint32_t mask, bool isUpdate)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
@ -317,7 +326,8 @@ int32_t TelephonyStateRegistryProxy::UnregisterStateChange(
|
||||
int32_t slotId, uint32_t mask)
|
||||
{
|
||||
MessageOption option;
|
||||
MessageParcel in, out;
|
||||
MessageParcel in;
|
||||
MessageParcel out;
|
||||
if (!in.WriteInterfaceToken(TelephonyStateRegistryProxy::GetDescriptor())) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
|
@ -31,28 +31,16 @@ class ImsCoreServiceClient {
|
||||
DECLARE_DELAYED_SINGLETON(ImsCoreServiceClient);
|
||||
|
||||
public:
|
||||
/**
|
||||
* Get ImsCoreService Remote Object
|
||||
*
|
||||
* @return sptr<ImsCoreServiceInterface>
|
||||
*/
|
||||
sptr<ImsCoreServiceInterface> GetImsCoreServiceProxy();
|
||||
|
||||
void Init();
|
||||
void UnInit();
|
||||
int32_t RegisterImsCoreServiceCallbackHandler(int32_t slotId,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
|
||||
/**
|
||||
* Get Handler
|
||||
*
|
||||
* @param slotId
|
||||
* @return AppExecFwk::EventHandler
|
||||
*/
|
||||
int32_t RegisterImsCoreServiceCallbackHandler(
|
||||
int32_t slotId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
std::shared_ptr<AppExecFwk::EventHandler> GetHandler(int32_t slotId);
|
||||
|
||||
int32_t GetImsRegistrationStatus(int32_t slotId);
|
||||
|
||||
public:
|
||||
sptr<ImsCoreServiceInterface> GetImsCoreServiceProxy();
|
||||
|
||||
private:
|
||||
class SystemAbilityListener : public SystemAbilityStatusChangeStub {
|
||||
public:
|
||||
@ -63,11 +51,7 @@ private:
|
||||
void OnRemoveSystemAbility(int32_t systemAbilityId, const std::string& deviceId) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* Is Connect ImsCoreService Remote Object
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private:
|
||||
bool IsConnect() const;
|
||||
int32_t RegisterImsCoreServiceCallback();
|
||||
int32_t ReConnectService();
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
int32_t GetDefaultSlotId(void);
|
||||
int32_t GetMaxSimCount(void);
|
||||
|
||||
/******************** telRilManager start *******************/
|
||||
/******************** telRilManager start *******************/
|
||||
int32_t SetRadioState(
|
||||
int32_t slotId, int32_t eventId, int fun, int rst, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
int32_t GetRadioState(
|
||||
@ -90,7 +90,7 @@ public:
|
||||
int32_t SetCallRestriction(int32_t slotId, int32_t eventId, const CallRestrictionParam &callRestriction,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
/* PDP start */
|
||||
int32_t SetDataPermitted(int32_t slotId, int32_t eventId, int32_t ataPermitted,
|
||||
int32_t SetDataPermitted(int32_t slotId, int32_t eventId, int32_t dataPermitted,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
int32_t SetInitApnInfo(int32_t slotId, int32_t eventId, const DataProfile &dataProfile,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
@ -120,20 +120,19 @@ public:
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetPsRegStatus(
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetCallPreferenceMode(int32_t slotId, int32_t eventId, int32_t mode,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetCallPreferenceMode(
|
||||
int32_t slotId, int32_t eventId, int32_t mode, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetCallPreferenceMode(
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetUssd(int32_t slotId, int32_t eventId, const std::string str,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetUssd(
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetUssd(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetMute(int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetMute(int32_t slotId, int32_t eventId, int32_t mute,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetMute(
|
||||
int32_t slotId, int32_t eventId, int32_t mute, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetEmergencyCallList(
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t SetEmergencyCallList(int32_t slotId, int32_t eventId, std::vector<EmergencyCall> &eccVec,
|
||||
int32_t SetEmergencyCallList(int32_t slotId, int32_t eventId, std::vector<EmergencyCall> &eccVec,
|
||||
const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
int32_t GetCallFailReason(
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler) const;
|
||||
@ -183,16 +182,15 @@ public:
|
||||
int32_t slotId, int32_t eventId, const std::shared_ptr<AppExecFwk::EventHandler> &handler);
|
||||
std::vector<std::shared_ptr<DiallingNumbersInfo>> QueryIccDiallingNumbers(int slotId, int type);
|
||||
|
||||
/******************** telRilManager end *******************/
|
||||
/******************** networkSearchManager start *******************/
|
||||
/******************** telRilManager end *******************/
|
||||
/******************** networkSearchManager start *******************/
|
||||
int32_t GetPsRadioTech(int32_t slotId);
|
||||
int32_t GetCsRadioTech(int32_t slotId);
|
||||
int32_t GetPsRegState(int32_t slotId);
|
||||
int32_t GetCsRegState(int32_t slotId);
|
||||
int32_t GetPsRoamingState(int32_t slotId);
|
||||
bool SetNetworkSelectionMode(int32_t slotId, int32_t selectMode,
|
||||
const sptr<NetworkInformation> &networkInformation, bool resumeSelection,
|
||||
const sptr<INetworkSearchCallback> &callback);
|
||||
bool SetNetworkSelectionMode(int32_t slotId, int32_t selectMode, const sptr<NetworkInformation> &networkInformation,
|
||||
bool resumeSelection, const sptr<INetworkSearchCallback> &callback);
|
||||
std::vector<sptr<SignalInformation>> GetSignalInfoList(int32_t slotId);
|
||||
std::u16string GetOperatorNumeric(int32_t slotId);
|
||||
std::u16string GetOperatorName(int32_t slotId);
|
||||
@ -220,8 +218,8 @@ public:
|
||||
FrequencyType GetFrequencyType(int32_t slotId) const;
|
||||
NrState GetNrState(int32_t slotId) const;
|
||||
void DcPhysicalLinkActiveUpdate(int32_t slotId, bool isActive);
|
||||
/******************** networkSearchManager end *******************/
|
||||
/******************** simManager start ***************************/
|
||||
/******************** networkSearchManager end *******************/
|
||||
/******************** simManager start ***************************/
|
||||
int32_t ObtainSpnCondition(int32_t slotId, bool roaming, std::string operatorNum);
|
||||
std::u16string GetSpn(int32_t slotId);
|
||||
bool SetVoiceMailInfo(int32_t slotId, const std::u16string &mailName, const std::u16string &mailNumber);
|
||||
@ -233,15 +231,16 @@ public:
|
||||
bool HasSimCard(int32_t slotId);
|
||||
int32_t GetSimState(int32_t slotId);
|
||||
int32_t GetCardType(int32_t slotId);
|
||||
bool UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response);
|
||||
bool AlterPin(int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response);
|
||||
bool UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response);
|
||||
bool AlterPin(int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response);
|
||||
bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response);
|
||||
int32_t GetLockState(int32_t slotId, LockType lockType);
|
||||
int32_t RefreshSimState(int32_t slotId);
|
||||
bool UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response);
|
||||
bool AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response);
|
||||
bool UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response);
|
||||
bool AlterPin2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response);
|
||||
std::u16string GetShowNumber(int32_t slotId);
|
||||
std::u16string GetShowName(int32_t slotId);
|
||||
bool GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList);
|
||||
@ -278,8 +277,8 @@ public:
|
||||
bool SetDefaultSmsSlotId(int32_t slotId);
|
||||
bool SetDefaultCellularDataSlotId(int32_t slotId);
|
||||
bool SetPrimarySlotId(int32_t slotId);
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string number);
|
||||
bool SetShowName(int32_t slotId, const std::u16string name);
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string &number);
|
||||
bool SetShowName(int32_t slotId, const std::u16string &name);
|
||||
int32_t GetDefaultVoiceSlotId();
|
||||
int32_t GetDefaultSmsSlotId();
|
||||
int32_t GetDefaultCellularDataSlotId();
|
||||
|
@ -67,19 +67,23 @@ public:
|
||||
bool GetSimAccountInfo(int32_t slotId, IccAccountInfo &info);
|
||||
bool SetDefaultVoiceSlotId(int32_t slotId);
|
||||
int32_t GetDefaultVoiceSlotId();
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string number);
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string &number);
|
||||
std::u16string GetShowNumber(int32_t slotId);
|
||||
bool SetShowName(int32_t slotId, const std::u16string name);
|
||||
bool SetShowName(int32_t slotId, const std::u16string &name);
|
||||
std::u16string GetShowName(int32_t slotId);
|
||||
bool GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList);
|
||||
bool GetOperatorConfigs(int32_t slotId, OperatorConfig &poc);
|
||||
|
||||
bool UnlockPin(int32_t slotId, std::u16string pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(int32_t slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response);
|
||||
bool AlterPin(int32_t slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response);
|
||||
bool UnlockPin2(int32_t slotId, std::u16string pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(int32_t slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response);
|
||||
bool AlterPin2(int32_t slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response);
|
||||
bool UnlockPin(int32_t slotId, const std::u16string &pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response);
|
||||
bool AlterPin(
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin, LockStatusResponse &response);
|
||||
bool UnlockPin2(int32_t slotId, const std::u16string &pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2, LockStatusResponse &response);
|
||||
bool AlterPin2(
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2, LockStatusResponse &response);
|
||||
bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response);
|
||||
int32_t GetLockState(int32_t slotId, LockType lockType);
|
||||
int32_t RefreshSimState(int32_t slotId);
|
||||
|
@ -62,9 +62,9 @@ public:
|
||||
int32_t GetDefaultVoiceSlotId() override;
|
||||
int32_t GetPrimarySlotId() override;
|
||||
bool SetPrimarySlotId(int32_t slotId) override;
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string number) override;
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string &number) override;
|
||||
std::u16string GetShowNumber(int32_t slotId) override;
|
||||
bool SetShowName(int32_t slotId, const std::u16string name) override;
|
||||
bool SetShowName(int32_t slotId, const std::u16string &name) override;
|
||||
std::u16string GetShowName(int32_t slotId) override;
|
||||
bool GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList) override;
|
||||
bool GetOperatorConfigs(int32_t slotId, OperatorConfig &poc) override;
|
||||
@ -73,16 +73,16 @@ public:
|
||||
bool IsValidStringLength(std::u16string str);
|
||||
bool IsValidServiceType(ImsServiceType serviceType);
|
||||
|
||||
bool UnlockPin(const int32_t slotId, std::u16string pin, LockStatusResponse &response) override;
|
||||
bool UnlockPuk(
|
||||
const int32_t slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response) override;
|
||||
bool AlterPin(
|
||||
const int32_t slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response) override;
|
||||
bool UnlockPin2(const int32_t slotId, std::u16string pin2, LockStatusResponse &response) override;
|
||||
bool UnlockPuk2(
|
||||
const int32_t slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response) override;
|
||||
bool AlterPin2(
|
||||
const int32_t slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response) override;
|
||||
bool UnlockPin(const int32_t slotId, const std::u16string &pin, LockStatusResponse &response) override;
|
||||
bool UnlockPuk(const int32_t slotId, const std::u16string &newPin, const std::u16string &puk,
|
||||
LockStatusResponse &response) override;
|
||||
bool AlterPin(const int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin,
|
||||
LockStatusResponse &response) override;
|
||||
bool UnlockPin2(const int32_t slotId, const std::u16string &pin2, LockStatusResponse &response) override;
|
||||
bool UnlockPuk2(const int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2,
|
||||
LockStatusResponse &response) override;
|
||||
bool AlterPin2(const int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2,
|
||||
LockStatusResponse &response) override;
|
||||
bool SetLockState(const int32_t slotId, const LockInfo &options, LockStatusResponse &response) override;
|
||||
int32_t GetLockState(int32_t slotId, LockType lockType) override;
|
||||
int32_t RefreshSimState(int32_t slotId) override;
|
||||
|
@ -50,15 +50,16 @@ public:
|
||||
virtual bool HasSimCard(int32_t slotId) = 0;
|
||||
virtual int32_t GetSimState(int32_t slotId) = 0;
|
||||
virtual int32_t GetCardType(int32_t slotId) = 0;
|
||||
virtual bool UnlockPin(int32_t slotId, std::u16string pin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk(int32_t slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPin(int32_t slotId, const std::u16string &pin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk(
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response) = 0;
|
||||
virtual bool AlterPin(
|
||||
int32_t slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPin2(int32_t slotId, std::u16string pin2, LockStatusResponse &response) = 0;
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPin2(int32_t slotId, const std::u16string &pin2, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk2(
|
||||
int32_t slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response) = 0;
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2, LockStatusResponse &response) = 0;
|
||||
virtual bool AlterPin2(
|
||||
int32_t slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response) = 0;
|
||||
int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2, LockStatusResponse &response) = 0;
|
||||
virtual bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response) = 0;
|
||||
virtual int32_t GetLockState(int32_t slotId, LockType lockType) = 0;
|
||||
virtual std::u16string GetSimOperatorNumeric(int32_t slotId) = 0;
|
||||
@ -84,9 +85,9 @@ public:
|
||||
virtual int32_t GetDefaultVoiceSlotId() = 0;
|
||||
virtual bool SetPrimarySlotId(int32_t slotId) = 0;
|
||||
virtual int32_t GetPrimarySlotId() = 0;
|
||||
virtual bool SetShowNumber(int32_t slotId, const std::u16string number) = 0;
|
||||
virtual bool SetShowNumber(int32_t slotId, const std::u16string &number) = 0;
|
||||
virtual std::u16string GetShowNumber(int32_t slotId) = 0;
|
||||
virtual bool SetShowName(int32_t slotId, const std::u16string name) = 0;
|
||||
virtual bool SetShowName(int32_t slotId, const std::u16string &name) = 0;
|
||||
virtual std::u16string GetShowName(int32_t slotId) = 0;
|
||||
virtual bool GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList) = 0;
|
||||
virtual bool GetOperatorConfigs(int32_t slotId, OperatorConfig &poc) = 0;
|
||||
|
@ -33,17 +33,19 @@ public:
|
||||
virtual bool HasSimCard(int32_t slotId) = 0;
|
||||
virtual int32_t GetSimState(int32_t slotId) = 0;
|
||||
virtual int32_t GetCardType(int32_t slotId) = 0;
|
||||
virtual bool UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk(int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response) = 0;
|
||||
virtual bool AlterPin(int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk(
|
||||
int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response) = 0;
|
||||
virtual bool AlterPin(
|
||||
int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response) = 0;
|
||||
virtual bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response) = 0;
|
||||
virtual int32_t GetLockState(int32_t slotId, LockType lockType) = 0;
|
||||
virtual int32_t RefreshSimState(int32_t slotId) = 0;
|
||||
virtual bool UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockPuk2(
|
||||
int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response) = 0;
|
||||
int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response) = 0;
|
||||
virtual bool AlterPin2(
|
||||
int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response) = 0;
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response) = 0;
|
||||
virtual bool UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response) = 0;
|
||||
// SimAccount
|
||||
virtual bool IsSimActive(int32_t slotId) = 0;
|
||||
@ -53,8 +55,8 @@ public:
|
||||
virtual bool SetDefaultSmsSlotId(int32_t slotId) = 0;
|
||||
virtual bool SetDefaultCellularDataSlotId(int32_t slotId) = 0;
|
||||
virtual bool SetPrimarySlotId(int32_t slotId) = 0;
|
||||
virtual bool SetShowNumber(int32_t slotId, const std::u16string number) = 0;
|
||||
virtual bool SetShowName(int32_t slotId, const std::u16string name) = 0;
|
||||
virtual bool SetShowNumber(int32_t slotId, const std::u16string &number) = 0;
|
||||
virtual bool SetShowName(int32_t slotId, const std::u16string &name) = 0;
|
||||
virtual int32_t GetDefaultVoiceSlotId() = 0;
|
||||
virtual int32_t GetDefaultSmsSlotId() = 0;
|
||||
virtual int32_t GetDefaultCellularDataSlotId() = 0;
|
||||
|
@ -17,10 +17,10 @@
|
||||
#define I_TEL_RIL_MANAGER_H
|
||||
|
||||
#include "event_runner.h"
|
||||
#include "hril_types.h"
|
||||
#include "hril_network_parcel.h"
|
||||
#include "hril_sim_parcel.h"
|
||||
#include "hril_sms_parcel.h"
|
||||
#include "hril_network_parcel.h"
|
||||
#include "hril_types.h"
|
||||
#include "telephony_types.h"
|
||||
|
||||
namespace OHOS {
|
||||
@ -88,8 +88,8 @@ public:
|
||||
virtual int32_t GetCallRestriction(
|
||||
int32_t slotId, std::string fac, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
|
||||
virtual int32_t SetCallRestriction(int32_t slotId, const CallRestrictionParam &callrestriction,
|
||||
const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t SetCallRestriction(
|
||||
int32_t slotId, const CallRestrictionParam &callrestriction, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t SendDtmf(
|
||||
int32_t slotId, const DtmfParam &dtmfParam, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t SendDtmf(
|
||||
@ -191,12 +191,14 @@ public:
|
||||
int32_t slotId, const SimLockParam &simLock, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t ChangeSimPassword(
|
||||
int32_t slotId, const SimPasswordParam &simPassword, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPin(int32_t slotId, std::string pin, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPuk(
|
||||
int32_t slotId, std::string puk, std::string pin, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPin2(int32_t slotId, std::string pin2, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPuk2(
|
||||
int32_t slotId, std::string puk2, std::string pin2, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPin(
|
||||
int32_t slotId, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPuk(int32_t slotId, const std::string &puk, const std::string &pin,
|
||||
const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPin2(
|
||||
int32_t slotId, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t UnlockPuk2(int32_t slotId, const std::string &puk2, const std::string &pin2,
|
||||
const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t SetActiveSim(
|
||||
int32_t slotId, int32_t index, int32_t enable, const AppExecFwk::InnerEvent::Pointer &result) = 0;
|
||||
virtual int32_t SendTerminalResponseCmd(
|
||||
@ -223,25 +225,24 @@ public:
|
||||
virtual int32_t SetCallPreferenceMode(
|
||||
int32_t slotId, const int32_t mode, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t GetCallPreferenceMode(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SetUssd(
|
||||
int32_t slotId, const std::string str, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SetUssd(int32_t slotId, const std::string str, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t GetUssd(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SetMute(int32_t slotId, const int32_t mute, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t GetMute(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t GetEmergencyCallList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SetEmergencyCallList(int32_t slotId, std::vector<EmergencyCall> &eccVec,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SetEmergencyCallList(
|
||||
int32_t slotId, const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t GetCallFailReason(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimOpenLogicalChannel(int32_t slotId, const std::string &appID, const int32_t p2,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimCloseLogicalChannel(
|
||||
int32_t slotId, const int32_t channelId, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimTransmitApduLogicalChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimTransmitApduBasicChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimAuthentication(
|
||||
int32_t slotId, SimAuthenticationRequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
virtual int32_t SimAuthentication(int32_t slotId, const SimAuthenticationRequestInfo &reqInfo,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
|
||||
virtual int32_t SetNotificationFilter(
|
||||
int32_t slotId, int32_t newFilter, const AppExecFwk::InnerEvent::Pointer &response) = 0;
|
||||
|
@ -24,7 +24,7 @@ class NetworkSearchResult : public Parcelable {
|
||||
public:
|
||||
NetworkSearchResult();
|
||||
virtual ~NetworkSearchResult() = default;
|
||||
void SetNetworkSearchResultValue(int32_t listSize, std::vector<NetworkInformation> &operatorInfo);
|
||||
void SetNetworkSearchResultValue(int32_t listSize, const std::vector<NetworkInformation> &operatorInfo);
|
||||
std::vector<NetworkInformation> GetNetworkSearchInformation() const;
|
||||
int32_t GetNetworkSearchInformationSize() const;
|
||||
bool ReadFromParcel(Parcel &parcel);
|
||||
|
@ -103,18 +103,21 @@ public:
|
||||
|
||||
std::u16string GetIsoCountryCodeForNetwork(int32_t slotId) override;
|
||||
|
||||
bool UnlockPin(int32_t slotId, std::u16string pin, LockStatusResponse &response) override;
|
||||
bool UnlockPin(int32_t slotId, const std::u16string &pin, LockStatusResponse &response) override;
|
||||
|
||||
bool UnlockPuk(int32_t slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response) override;
|
||||
bool UnlockPuk(
|
||||
int32_t slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response) override;
|
||||
|
||||
bool AlterPin(int32_t slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response) override;
|
||||
bool AlterPin(int32_t slotId, const std::u16string &newPin, const std::u16string &oldPin,
|
||||
LockStatusResponse &response) override;
|
||||
|
||||
bool UnlockPin2(int32_t slotId, std::u16string pin2, LockStatusResponse &response) override;
|
||||
bool UnlockPin2(int32_t slotId, const std::u16string &pin2, LockStatusResponse &response) override;
|
||||
|
||||
bool UnlockPuk2(int32_t slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response) override;
|
||||
bool UnlockPuk2(int32_t slotId, const std::u16string &newPin2, const std::u16string &puk2,
|
||||
LockStatusResponse &response) override;
|
||||
|
||||
bool AlterPin2(
|
||||
int32_t slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response) override;
|
||||
bool AlterPin2(int32_t slotId, const std::u16string &newPin2, const std::u16string &oldPin2,
|
||||
LockStatusResponse &response) override;
|
||||
|
||||
bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response) override;
|
||||
|
||||
@ -130,11 +133,11 @@ public:
|
||||
|
||||
int32_t GetPrimarySlotId() override;
|
||||
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string number) override;
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string &number) override;
|
||||
|
||||
std::u16string GetShowNumber(int32_t slotId) override;
|
||||
|
||||
bool SetShowName(int32_t slotId, const std::u16string name) override;
|
||||
bool SetShowName(int32_t slotId, const std::u16string &name) override;
|
||||
|
||||
std::u16string GetShowName(int32_t slotId) override;
|
||||
|
||||
|
@ -34,20 +34,19 @@ enum class SmsMmsMessageType {
|
||||
|
||||
class CoreServiceHiSysEvent : public TelephonyHiSysEvent {
|
||||
public:
|
||||
static void WriteSignalLevelBehaviorEvent(const int32_t slotId, const int32_t level);
|
||||
static void WriteNetworkStateBehaviorEvent(
|
||||
const int32_t slotId, const int32_t domain, const int32_t tech, const int32_t state);
|
||||
static void WriteDefaultDataSlotIdBehaviorEvent(const int32_t slotId);
|
||||
static void WriteSimStateBehaviorEvent(const int32_t slotId, const int32_t state);
|
||||
static void WriteDialCallFaultEvent(const int32_t slotId, const int32_t errCode, const std::string &desc);
|
||||
static void WriteAnswerCallFaultEvent(const int32_t slotId, const int32_t errCode, const std::string &desc);
|
||||
static void WriteHangUpFaultEvent(const int32_t slotId, const int32_t errCode, const std::string &desc);
|
||||
static void WriteSignalLevelBehaviorEvent(int32_t slotId, int32_t level);
|
||||
static void WriteNetworkStateBehaviorEvent(int32_t slotId, int32_t domain, int32_t tech, int32_t state);
|
||||
static void WriteDefaultDataSlotIdBehaviorEvent(int32_t slotId);
|
||||
static void WriteSimStateBehaviorEvent(int32_t slotId, int32_t state);
|
||||
static void WriteDialCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
|
||||
static void WriteAnswerCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
|
||||
static void WriteHangUpFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc);
|
||||
static void WriteSmsSendFaultEvent(
|
||||
const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc);
|
||||
int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc);
|
||||
static void WriteSmsReceiveFaultEvent(
|
||||
const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc);
|
||||
static void WriteDataActivateFaultEvent(const int32_t slotId, const int32_t switchState,
|
||||
const CellularDataErrorCode errorType, const std::string &errorMsg);
|
||||
int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc);
|
||||
static void WriteDataActivateFaultEvent(
|
||||
int32_t slotId, int32_t switchState, CellularDataErrorCode errorType, const std::string &errorMsg);
|
||||
};
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -113,9 +113,11 @@ void CoreService::OnStop()
|
||||
int32_t CoreService::GetPsRadioTech(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_NETWORK_INFO)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return TELEPHONY_PERMISSION_ERROR;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return networkSearchManager_->GetPsRadioTech(slotId);
|
||||
@ -124,9 +126,11 @@ int32_t CoreService::GetPsRadioTech(int32_t slotId)
|
||||
int32_t CoreService::GetCsRadioTech(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_NETWORK_INFO)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return TELEPHONY_PERMISSION_ERROR;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return networkSearchManager_->GetCsRadioTech(slotId);
|
||||
@ -137,9 +141,11 @@ bool CoreService::SetNetworkSelectionMode(int32_t slotId, int32_t selectMode,
|
||||
const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetNetworkSelectionMode selectMode:%{public}d", selectMode);
|
||||
@ -150,6 +156,7 @@ bool CoreService::SetNetworkSelectionMode(int32_t slotId, int32_t selectMode,
|
||||
std::vector<sptr<SignalInformation>> CoreService::GetSignalInfoList(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::vector<sptr<SignalInformation>>();
|
||||
}
|
||||
return networkSearchManager_->GetSignalInfoList(slotId);
|
||||
@ -158,6 +165,7 @@ std::vector<sptr<SignalInformation>> CoreService::GetSignalInfoList(int32_t slot
|
||||
std::u16string CoreService::GetOperatorNumeric(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetOperatorNumeric(slotId);
|
||||
@ -166,6 +174,7 @@ std::u16string CoreService::GetOperatorNumeric(int32_t slotId)
|
||||
std::u16string CoreService::GetOperatorName(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetOperatorName(slotId);
|
||||
@ -174,9 +183,11 @@ std::u16string CoreService::GetOperatorName(int32_t slotId)
|
||||
const sptr<NetworkState> CoreService::GetNetworkState(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_NETWORK_INFO)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return nullptr;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return nullptr;
|
||||
}
|
||||
return networkSearchManager_->GetNetworkStatus(slotId);
|
||||
@ -185,9 +196,11 @@ const sptr<NetworkState> CoreService::GetNetworkState(int32_t slotId)
|
||||
bool CoreService::SetRadioState(int32_t slotId, bool isOn, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetRadioState --> slotId:%{public}d, isOn:%{public}d", slotId, isOn);
|
||||
@ -197,9 +210,11 @@ bool CoreService::SetRadioState(int32_t slotId, bool isOn, const sptr<INetworkSe
|
||||
bool CoreService::GetRadioState(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_NETWORK_INFO)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->GetRadioState(slotId, callback);
|
||||
@ -208,6 +223,7 @@ bool CoreService::GetRadioState(int32_t slotId, const sptr<INetworkSearchCallbac
|
||||
std::u16string CoreService::GetIsoCountryCodeForNetwork(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetIsoCountryCodeForNetwork(slotId);
|
||||
@ -216,9 +232,11 @@ std::u16string CoreService::GetIsoCountryCodeForNetwork(int32_t slotId)
|
||||
std::u16string CoreService::GetImei(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetImei(slotId);
|
||||
@ -227,9 +245,11 @@ std::u16string CoreService::GetImei(int32_t slotId)
|
||||
std::u16string CoreService::GetMeid(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetMeid(slotId);
|
||||
@ -238,9 +258,11 @@ std::u16string CoreService::GetMeid(int32_t slotId)
|
||||
std::u16string CoreService::GetUniqueDeviceId(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return networkSearchManager_->GetUniqueDeviceId(slotId);
|
||||
@ -249,6 +271,7 @@ std::u16string CoreService::GetUniqueDeviceId(int32_t slotId)
|
||||
bool CoreService::IsNrSupported(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->IsNrSupported(slotId);
|
||||
@ -257,6 +280,7 @@ bool CoreService::IsNrSupported(int32_t slotId)
|
||||
NrMode CoreService::GetNrOptionMode(int32_t slotId)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return NrMode::NR_MODE_UNKNOWN;
|
||||
}
|
||||
return networkSearchManager_->GetNrOptionMode(slotId);
|
||||
@ -266,6 +290,7 @@ bool CoreService::HasSimCard(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::HasSimCard(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->HasSimCard(slotId);
|
||||
@ -275,6 +300,7 @@ int32_t CoreService::GetSimState(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetSimState(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
|
||||
@ -285,6 +311,7 @@ int32_t CoreService::GetCardType(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetCardType(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
|
||||
@ -295,6 +322,7 @@ std::u16string CoreService::GetISOCountryCodeForSim(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetISOCountryCodeForSim(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
|
||||
@ -305,6 +333,7 @@ std::u16string CoreService::GetSimSpn(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetSimSpn(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimSpn(slotId);
|
||||
@ -313,10 +342,12 @@ std::u16string CoreService::GetSimSpn(int32_t slotId)
|
||||
std::u16string CoreService::GetSimIccId(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimIccId(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimIccId(slotId);
|
||||
@ -326,6 +357,7 @@ std::u16string CoreService::GetSimOperatorNumeric(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetSimOperatorNumeric(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimOperatorNumeric(slotId);
|
||||
@ -334,10 +366,12 @@ std::u16string CoreService::GetSimOperatorNumeric(int32_t slotId)
|
||||
std::u16string CoreService::GetIMSI(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetIMSI(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetIMSI(slotId);
|
||||
@ -347,6 +381,7 @@ bool CoreService::IsSimActive(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::IsSimActive(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->IsSimActive(slotId);
|
||||
@ -375,9 +410,11 @@ int32_t CoreService::GetSimId(int32_t slotId)
|
||||
bool CoreService::GetNetworkSearchInformation(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->GetNetworkSearchInformation(slotId, callback);
|
||||
@ -386,6 +423,7 @@ bool CoreService::GetNetworkSearchInformation(int32_t slotId, const sptr<INetwor
|
||||
bool CoreService::GetNetworkSelectionMode(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->GetNetworkSelectionMode(slotId, callback);
|
||||
@ -399,6 +437,7 @@ std::u16string CoreService::GetLocaleFromDefaultSim()
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimAccountInfo()");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
int32_t slotId = simManager_->GetPrimarySlotId();
|
||||
@ -411,10 +450,12 @@ std::u16string CoreService::GetLocaleFromDefaultSim()
|
||||
std::u16string CoreService::GetSimGid1(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("CoreService::GetSimGid1, Permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimGid1(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimGid1(slotId);
|
||||
@ -423,10 +464,12 @@ std::u16string CoreService::GetSimGid1(int32_t slotId)
|
||||
std::u16string CoreService::GetSimGid2(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("CoreService::GetSimGid2, Permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimGid2(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimGid2(slotId);
|
||||
@ -436,6 +479,7 @@ std::u16string CoreService::GetSimEons(int32_t slotId, const std::string &plmn,
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetSimEons(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("CoreService::GetSimEons, Permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimEons(slotId, plmn, lac, longNameRequired);
|
||||
@ -444,10 +488,12 @@ std::u16string CoreService::GetSimEons(int32_t slotId, const std::string &plmn,
|
||||
bool CoreService::GetSimAccountInfo(int32_t slotId, IccAccountInfo &info)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimAccountInfo(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->GetSimAccountInfo(slotId, info);
|
||||
@ -456,10 +502,12 @@ bool CoreService::GetSimAccountInfo(int32_t slotId, IccAccountInfo &info)
|
||||
bool CoreService::SetDefaultVoiceSlotId(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetDefaultVoiceSlotId(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetDefaultVoiceSlotId(slotId);
|
||||
@ -469,6 +517,7 @@ int32_t CoreService::GetDefaultVoiceSlotId()
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetDefaultVoiceSlotId()");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return simManager_->GetDefaultVoiceSlotId();
|
||||
@ -477,10 +526,12 @@ int32_t CoreService::GetDefaultVoiceSlotId()
|
||||
bool CoreService::SetPrimarySlotId(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetPrimarySlotId(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetPrimarySlotId(slotId);
|
||||
@ -490,18 +541,21 @@ int32_t CoreService::GetPrimarySlotId()
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetPrimarySlotId()");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return simManager_->GetPrimarySlotId();
|
||||
}
|
||||
|
||||
bool CoreService::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
bool CoreService::SetShowNumber(int32_t slotId, const std::u16string &number)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetShowNumber(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetShowNumber(slotId, number);
|
||||
@ -510,22 +564,26 @@ bool CoreService::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
std::u16string CoreService::GetShowNumber(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetShowNumber(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetShowNumber(slotId);
|
||||
}
|
||||
|
||||
bool CoreService::SetShowName(int32_t slotId, const std::u16string name)
|
||||
bool CoreService::SetShowName(int32_t slotId, const std::u16string &name)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetShowName(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetShowName(slotId, name);
|
||||
@ -534,10 +592,12 @@ bool CoreService::SetShowName(int32_t slotId, const std::u16string name)
|
||||
std::u16string CoreService::GetShowName(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetShowName(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetShowName(slotId);
|
||||
@ -546,10 +606,12 @@ std::u16string CoreService::GetShowName(int32_t slotId)
|
||||
bool CoreService::GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAccountInfoList)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetActiveSimAccountInfoList");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->GetActiveSimAccountInfoList(iccAccountInfoList);
|
||||
@ -558,90 +620,106 @@ bool CoreService::GetActiveSimAccountInfoList(std::vector<IccAccountInfo> &iccAc
|
||||
bool CoreService::GetOperatorConfigs(int32_t slotId, OperatorConfig &poc)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetOperatorConfigs");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->GetOperatorConfigs(slotId, poc);
|
||||
}
|
||||
|
||||
bool CoreService::UnlockPin(const int32_t slotId, std::u16string pin, LockStatusResponse &response)
|
||||
bool CoreService::UnlockPin(const int32_t slotId, const std::u16string &pin, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI(
|
||||
"CoreService::UnlockPin(), pinLen = %{public}lu, slotId = %{public}d", (unsigned long)pin.length(), slotId);
|
||||
TELEPHONY_LOGI("CoreService::UnlockPin(), pinLen = %{public}lu, slotId = %{public}d",
|
||||
static_cast<unsigned long>(pin.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UnlockPin(slotId, Str16ToStr8(pin), response);
|
||||
}
|
||||
|
||||
bool CoreService::UnlockPuk(const int slotId, std::u16string newPin, std::u16string puk, LockStatusResponse &response)
|
||||
bool CoreService::UnlockPuk(
|
||||
const int slotId, const std::u16string &newPin, const std::u16string &puk, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::UnlockPuk(), newPinLen = %{public}lu, pukLen = %{public}lu, slotId = %{public}d",
|
||||
(unsigned long)newPin.length(), (unsigned long)puk.length(), slotId);
|
||||
static_cast<unsigned long>(newPin.length()), static_cast<unsigned long>(puk.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UnlockPuk(slotId, Str16ToStr8(newPin), Str16ToStr8(puk), response);
|
||||
}
|
||||
|
||||
bool CoreService::AlterPin(const int slotId, std::u16string newPin, std::u16string oldPin, LockStatusResponse &response)
|
||||
bool CoreService::AlterPin(
|
||||
const int slotId, const std::u16string &newPin, const std::u16string &oldPin, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::AlterPin(), newPinLen = %{public}lu, oldPinLen = %{public}lu, slotId = %{public}d",
|
||||
(unsigned long)newPin.length(), (unsigned long)oldPin.length(), slotId);
|
||||
static_cast<unsigned long>(newPin.length()), static_cast<unsigned long>(oldPin.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->AlterPin(slotId, Str16ToStr8(newPin), Str16ToStr8(oldPin), response);
|
||||
}
|
||||
|
||||
bool CoreService::UnlockPin2(const int32_t slotId, std::u16string pin2, LockStatusResponse &response)
|
||||
bool CoreService::UnlockPin2(const int32_t slotId, const std::u16string &pin2, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI(
|
||||
"CoreService::UnlockPin2(), pin2Len = %{public}lu, slotId = %{public}d", (unsigned long)pin2.length(), slotId);
|
||||
TELEPHONY_LOGI("CoreService::UnlockPin2(), pin2Len = %{public}lu, slotId = %{public}d",
|
||||
static_cast<unsigned long>(pin2.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UnlockPin2(slotId, Str16ToStr8(pin2), response);
|
||||
}
|
||||
|
||||
bool CoreService::UnlockPuk2(
|
||||
const int slotId, std::u16string newPin2, std::u16string puk2, LockStatusResponse &response)
|
||||
const int slotId, const std::u16string &newPin2, const std::u16string &puk2, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::UnlockPuk2(), newPin2Len = %{public}lu, puk2Len = %{public}lu, slotId = %{public}d",
|
||||
(unsigned long)newPin2.length(), (unsigned long)puk2.length(), slotId);
|
||||
static_cast<unsigned long>(newPin2.length()), static_cast<unsigned long>(puk2.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UnlockPuk2(slotId, Str16ToStr8(newPin2), Str16ToStr8(puk2), response);
|
||||
}
|
||||
|
||||
bool CoreService::AlterPin2(
|
||||
const int slotId, std::u16string newPin2, std::u16string oldPin2, LockStatusResponse &response)
|
||||
const int slotId, const std::u16string &newPin2, const std::u16string &oldPin2, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::AlterPin2(), newPin2Len = %{public}lu, oldPin2Len = %{public}lu, slotId = %{public}d",
|
||||
(unsigned long)newPin2.length(), (unsigned long)oldPin2.length(), slotId);
|
||||
static_cast<unsigned long>(newPin2.length()), static_cast<unsigned long>(oldPin2.length()), slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->AlterPin2(slotId, Str16ToStr8(newPin2), Str16ToStr8(oldPin2), response);
|
||||
@ -650,6 +728,7 @@ bool CoreService::AlterPin2(
|
||||
bool CoreService::SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
std::u16string strPin = options.password;
|
||||
@ -657,8 +736,9 @@ bool CoreService::SetLockState(int32_t slotId, const LockInfo &options, LockStat
|
||||
"CoreService::SetLockState(),lockType = %{public}d, pinLen = %{public}lu, lockState = %{public}d, slotId "
|
||||
"= "
|
||||
"%{public}d",
|
||||
options.lockType, (unsigned long)strPin.length(), options.lockState, slotId);
|
||||
options.lockType, static_cast<unsigned long>(strPin.length()), options.lockState, slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetLockState(slotId, options, response);
|
||||
@ -672,6 +752,7 @@ int32_t CoreService::GetLockState(int32_t slotId, LockType lockType)
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetLockState(), lockType = %{public}d, slotId = %{public}d", lockType, slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return simManager_->GetLockState(slotId, lockType);
|
||||
@ -681,6 +762,7 @@ int32_t CoreService::RefreshSimState(int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::RefreshSimState(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERROR;
|
||||
}
|
||||
return simManager_->RefreshSimState(slotId);
|
||||
@ -689,10 +771,12 @@ int32_t CoreService::RefreshSimState(int32_t slotId)
|
||||
bool CoreService::SetActiveSim(int32_t slotId, int32_t enable)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetActiveSim(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetActiveSim(slotId, enable);
|
||||
@ -701,9 +785,11 @@ bool CoreService::SetActiveSim(int32_t slotId, int32_t enable)
|
||||
bool CoreService::GetPreferredNetwork(int32_t slotId, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->GetPreferredNetwork(slotId, callback);
|
||||
@ -712,9 +798,11 @@ bool CoreService::GetPreferredNetwork(int32_t slotId, const sptr<INetworkSearchC
|
||||
bool CoreService::SetPreferredNetwork(int32_t slotId, int32_t networkMode, const sptr<INetworkSearchCallback> &callback)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->SetPreferredNetwork(slotId, networkMode, callback);
|
||||
@ -723,10 +811,12 @@ bool CoreService::SetPreferredNetwork(int32_t slotId, int32_t networkMode, const
|
||||
std::u16string CoreService::GetSimTelephoneNumber(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimTelephoneNumber(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimTelephoneNumber(slotId);
|
||||
@ -740,6 +830,7 @@ std::u16string CoreService::GetSimTeleNumberIdentifier(const int32_t slotId)
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetSimTeleNumberIdentifier(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetSimTeleNumberIdentifier(slotId);
|
||||
@ -748,10 +839,12 @@ std::u16string CoreService::GetSimTeleNumberIdentifier(const int32_t slotId)
|
||||
std::u16string CoreService::GetVoiceMailIdentifier(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetVoiceMailIdentifier(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetVoiceMailIdentifier(slotId);
|
||||
@ -760,10 +853,12 @@ std::u16string CoreService::GetVoiceMailIdentifier(int32_t slotId)
|
||||
std::u16string CoreService::GetVoiceMailNumber(int32_t slotId)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return std::u16string();
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::GetVoiceMailNumber(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::u16string();
|
||||
}
|
||||
return simManager_->GetVoiceMailNumber(slotId);
|
||||
@ -776,6 +871,7 @@ std::vector<std::shared_ptr<DiallingNumbersInfo>> CoreService::QueryIccDiallingN
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::QueryIccDiallingNumbers");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return std::vector<std::shared_ptr<DiallingNumbersInfo>>();
|
||||
}
|
||||
return simManager_->QueryIccDiallingNumbers(slotId, type);
|
||||
@ -785,10 +881,12 @@ bool CoreService::AddIccDiallingNumbers(
|
||||
int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::WRITE_CONTACTS)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::AddIccDiallingNumbers");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->AddIccDiallingNumbers(slotId, type, diallingNumber);
|
||||
@ -798,10 +896,12 @@ bool CoreService::DelIccDiallingNumbers(
|
||||
int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::WRITE_CONTACTS)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::DelIccDiallingNumbers");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->DelIccDiallingNumbers(slotId, type, diallingNumber);
|
||||
@ -811,10 +911,12 @@ bool CoreService::UpdateIccDiallingNumbers(
|
||||
int slotId, int type, const std::shared_ptr<DiallingNumbersInfo> &diallingNumber)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::WRITE_CONTACTS)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::UpdateIccDiallingNumbers");
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UpdateIccDiallingNumbers(slotId, type, diallingNumber);
|
||||
@ -824,10 +926,12 @@ bool CoreService::SetVoiceMailInfo(
|
||||
const int32_t slotId, const std::u16string &mailName, const std::u16string &mailNumber)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SetVoiceMailInfo(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SetVoiceMailInfo(slotId, mailName, mailNumber);
|
||||
@ -845,6 +949,7 @@ int32_t CoreService::GetOpKey(int32_t slotId, std::u16string &opkey)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetOpKey(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
return simManager_->GetOpKey(slotId, opkey);
|
||||
@ -854,6 +959,7 @@ int32_t CoreService::GetOpKeyExt(int32_t slotId, std::u16string &opkeyExt)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetOpKeyExt(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
return simManager_->GetOpKeyExt(slotId, opkeyExt);
|
||||
@ -863,6 +969,7 @@ int32_t CoreService::GetOpName(int32_t slotId, std::u16string &opname)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::GetOpName(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
return simManager_->GetOpName(slotId, opname);
|
||||
@ -875,6 +982,7 @@ bool CoreService::SendEnvelopeCmd(int32_t slotId, const std::string &cmd)
|
||||
return false;
|
||||
}
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("CoreService::SendEnvelopeCmd, Permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SendEnvelopeCmd(), slotId = %{public}d", slotId);
|
||||
@ -888,6 +996,7 @@ bool CoreService::SendTerminalResponseCmd(int32_t slotId, const std::string &cmd
|
||||
return false;
|
||||
}
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("CoreService::SendTerminalResponseCmd, Permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SendTerminalResponseCmd(), slotId = %{public}d", slotId);
|
||||
@ -911,11 +1020,13 @@ int32_t CoreService::SendCallSetupRequestResult(int32_t slotId, bool accept)
|
||||
bool CoreService::UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("permission denied!");
|
||||
return false;
|
||||
}
|
||||
TELEPHONY_LOGI(
|
||||
"CoreService::UnlockSimLock(), lockType = %{public}d, slotId = %{public}d", lockInfo.lockType, slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->UnlockSimLock(slotId, lockInfo, response);
|
||||
@ -941,6 +1052,7 @@ std::vector<sptr<CellInformation>> CoreService::GetCellInfoList(int32_t slotId)
|
||||
return std::vector<sptr<CellInformation>>();
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return std::vector<sptr<CellInformation>>();
|
||||
}
|
||||
return networkSearchManager_->GetCellInfoList(slotId);
|
||||
@ -953,6 +1065,7 @@ bool CoreService::SendUpdateCellLocationRequest(int32_t slotId)
|
||||
return false;
|
||||
}
|
||||
if (networkSearchManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("networkSearchManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return networkSearchManager_->SendUpdateCellLocationRequest(slotId);
|
||||
@ -962,6 +1075,7 @@ bool CoreService::HasOperatorPrivileges(const int32_t slotId)
|
||||
{
|
||||
TELEPHONY_LOGI("CoreService::HasOperatorPrivileges(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->HasOperatorPrivileges(slotId);
|
||||
@ -971,10 +1085,12 @@ int32_t CoreService::SimAuthentication(
|
||||
int32_t slotId, const std::string &aid, const std::string &authData, SimAuthenticationResponse &response)
|
||||
{
|
||||
if (!TelephonyPermission::CheckPermission(Permission::GET_TELEPHONY_STATE)) {
|
||||
TELEPHONY_LOGE("Failed because no permission:GET_TELEPHONY_STATE");
|
||||
return TELEPHONY_ERR_PERMISSION_ERR;
|
||||
}
|
||||
TELEPHONY_LOGI("CoreService::SimAuthentication(), slotId = %{public}d", slotId);
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->SimAuthentication(slotId, aid, authData, response);
|
||||
|
@ -53,64 +53,61 @@ static constexpr const char *DATASTATE_KEY = "DATASTATE";
|
||||
// VALUE
|
||||
static constexpr const char *CORE_SERVICE_MODULE = "CORE_SERVICE";
|
||||
|
||||
void CoreServiceHiSysEvent::WriteSignalLevelBehaviorEvent(const int32_t slotId, const int32_t level)
|
||||
void CoreServiceHiSysEvent::WriteSignalLevelBehaviorEvent(int32_t slotId, int32_t level)
|
||||
{
|
||||
HiWriteBehaviorEvent(SIGNAL_LEVEL_EVENT, SLOT_ID_KEY, slotId, SIGANL_LEVEL_KEY, level);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteNetworkStateBehaviorEvent(
|
||||
const int32_t slotId, const int32_t domain, const int32_t tech, const int32_t state)
|
||||
void CoreServiceHiSysEvent::WriteNetworkStateBehaviorEvent(int32_t slotId, int32_t domain, int32_t tech, int32_t state)
|
||||
{
|
||||
HiWriteBehaviorEvent(NETWORK_REGISTER_EVENT, SLOT_ID_KEY, slotId, NETWORK_DOMAIN_KEY, domain, NETWORK_TECH_KEY,
|
||||
tech, NETWORK_STATE_KEY, state);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteDefaultDataSlotIdBehaviorEvent(const int32_t slotId)
|
||||
void CoreServiceHiSysEvent::WriteDefaultDataSlotIdBehaviorEvent(int32_t slotId)
|
||||
{
|
||||
HiWriteBehaviorEvent(SET_DEFAULT_CELLULAR_DATA_EVENT, SLOT_ID_KEY, slotId);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteSimStateBehaviorEvent(const int32_t slotId, const int32_t state)
|
||||
void CoreServiceHiSysEvent::WriteSimStateBehaviorEvent(int32_t slotId, int32_t state)
|
||||
{
|
||||
HiWriteBehaviorEvent(SIM_STATE_CHANGE_EVENT, SLOT_ID_KEY, slotId, STATE_KEY, state);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteDialCallFaultEvent(
|
||||
const int32_t slotId, const int32_t errCode, const std::string &desc)
|
||||
void CoreServiceHiSysEvent::WriteDialCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc)
|
||||
{
|
||||
HiWriteFaultEvent(CALL_DIAL_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId, CALL_TYPE_KEY,
|
||||
INVALID_PARAMETER, VIDEO_STATE_KEY, INVALID_PARAMETER, ERROR_TYPE_KEY, errCode, ERROR_MSG_KEY, desc);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteAnswerCallFaultEvent(
|
||||
const int32_t slotId, const int32_t errCode, const std::string &desc)
|
||||
void CoreServiceHiSysEvent::WriteAnswerCallFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc)
|
||||
{
|
||||
HiWriteFaultEvent(CALL_ANSWER_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId, CALL_ID_KEY,
|
||||
INVALID_PARAMETER, VIDEO_STATE_KEY, INVALID_PARAMETER, ERROR_TYPE_KEY, errCode, ERROR_MSG_KEY, desc);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteHangUpFaultEvent(const int32_t slotId, const int32_t errCode, const std::string &desc)
|
||||
void CoreServiceHiSysEvent::WriteHangUpFaultEvent(int32_t slotId, int32_t errCode, const std::string &desc)
|
||||
{
|
||||
HiWriteFaultEvent(CALL_HANGUP_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId, CALL_ID_KEY,
|
||||
INVALID_PARAMETER, ERROR_TYPE_KEY, errCode, ERROR_MSG_KEY, desc);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteSmsSendFaultEvent(
|
||||
const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc)
|
||||
int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc)
|
||||
{
|
||||
HiWriteFaultEvent(SMS_SEND_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId, MSG_TYPE_KEY,
|
||||
static_cast<int32_t>(type), ERROR_TYPE_KEY, static_cast<int32_t>(errorCode), ERROR_MSG_KEY, desc);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteSmsReceiveFaultEvent(
|
||||
const int32_t slotId, const SmsMmsMessageType type, const SmsMmsErrorCode errorCode, const std::string &desc)
|
||||
int32_t slotId, SmsMmsMessageType type, SmsMmsErrorCode errorCode, const std::string &desc)
|
||||
{
|
||||
HiWriteFaultEvent(SMS_RECEIVE_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId, MSG_TYPE_KEY,
|
||||
static_cast<int32_t>(type), ERROR_TYPE_KEY, static_cast<int32_t>(errorCode), ERROR_MSG_KEY, desc);
|
||||
}
|
||||
|
||||
void CoreServiceHiSysEvent::WriteDataActivateFaultEvent(
|
||||
const int32_t slotId, const int32_t switchState, const CellularDataErrorCode errorType, const std::string &errorMsg)
|
||||
int32_t slotId, int32_t switchState, CellularDataErrorCode errorType, const std::string &errorMsg)
|
||||
{
|
||||
HiWriteFaultEvent(DATA_ACTIVATE_FAILED_EVENT, MODULE_NAME_KEY, CORE_SERVICE_MODULE, SLOT_ID_KEY, slotId,
|
||||
DATA_SWITCH_KEY, switchState, UPLINK_DATA_KEY, INVALID_PARAMETER, DOWNLINK_DATA_KEY, INVALID_PARAMETER,
|
||||
|
@ -1112,6 +1112,7 @@ int32_t CoreServiceStub::OnGetOpKey(MessageParcel &data, MessageParcel &reply)
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
if (result != TELEPHONY_ERR_SUCCESS) {
|
||||
TELEPHONY_LOGE("OnRemoteRequest::OnGetOpKey failed.");
|
||||
return result;
|
||||
}
|
||||
if (!reply.WriteString16(opkey)) {
|
||||
@ -1131,6 +1132,7 @@ int32_t CoreServiceStub::OnGetOpKeyExt(MessageParcel &data, MessageParcel &reply
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
if (result != TELEPHONY_ERR_SUCCESS) {
|
||||
TELEPHONY_LOGE("OnRemoteRequest::OnGetOpKeyExt failed.");
|
||||
return result;
|
||||
}
|
||||
if (!reply.WriteString16(opkeyExt)) {
|
||||
@ -1150,6 +1152,7 @@ int32_t CoreServiceStub::OnGetOpName(MessageParcel &data, MessageParcel &reply)
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
if (result != TELEPHONY_ERR_SUCCESS) {
|
||||
TELEPHONY_LOGE("OnRemoteRequest::OnGetOpName failed.");
|
||||
return result;
|
||||
}
|
||||
if (!reply.WriteString16(opname)) {
|
||||
@ -1263,7 +1266,7 @@ int32_t CoreServiceStub::OnGetCellLocation(MessageParcel &data, MessageParcel &r
|
||||
|
||||
int32_t CoreServiceStub::OnHasOperatorPrivileges(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
const int32_t slotId = data.ReadInt32();
|
||||
int32_t slotId = data.ReadInt32();
|
||||
bool result = HasOperatorPrivileges(slotId);
|
||||
bool ret = reply.WriteBool(result);
|
||||
if (!ret) {
|
||||
@ -1275,9 +1278,9 @@ int32_t CoreServiceStub::OnHasOperatorPrivileges(MessageParcel &data, MessagePar
|
||||
|
||||
int32_t CoreServiceStub::OnSimAuthentication(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
const int32_t slotId = data.ReadInt32();
|
||||
const std::string aid = data.ReadString();
|
||||
const std::string authData = data.ReadString();
|
||||
int32_t slotId = data.ReadInt32();
|
||||
std::string aid = data.ReadString();
|
||||
std::string authData = data.ReadString();
|
||||
SimAuthenticationResponse response = { 0 };
|
||||
int32_t result = SimAuthentication(slotId, aid, authData, response);
|
||||
reply.WriteInt32(response.sw1);
|
||||
|
@ -29,6 +29,7 @@ int32_t ImsCoreServiceCallbackProxy::UpdateImsServiceStatusChanged(
|
||||
MessageParcel in;
|
||||
int32_t ret = WriteCommonInfo(__FUNCTION__, in, slotId);
|
||||
if (ret != TELEPHONY_SUCCESS) {
|
||||
TELEPHONY_LOGE("[slot%{public}d]Write imsServiceStatus fail!", slotId);
|
||||
return ret;
|
||||
}
|
||||
if (!in.WriteRawData((const void *)&imsServiceStatus, sizeof(ImsServiceStatus))) {
|
||||
@ -44,6 +45,7 @@ int32_t ImsCoreServiceCallbackProxy::GetImsRegistrationStatusResponse(
|
||||
MessageParcel in;
|
||||
int32_t ret = WriteCommonInfo(__FUNCTION__, in, slotId);
|
||||
if (ret != TELEPHONY_SUCCESS) {
|
||||
TELEPHONY_LOGE("[slot%{public}d]Write WriteCommonInfo fail!", slotId);
|
||||
return ret;
|
||||
}
|
||||
if (!in.WriteRawData((const void *)&imsRegStatus, sizeof(ImsRegistrationStatus))) {
|
||||
|
@ -123,11 +123,7 @@ int32_t ImsCoreServiceClient::RegisterImsCoreServiceCallback()
|
||||
TELEPHONY_LOGE("imsCoreServiceProxy_ is null!");
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
imsCoreServiceCallback_ = (std::make_unique<ImsCoreServiceCallbackStub>()).release();
|
||||
if (imsCoreServiceCallback_ == nullptr) {
|
||||
TELEPHONY_LOGE("RegisterImsCoreServiceCallback return, make unique error.");
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
imsCoreServiceCallback_ = new ImsCoreServiceCallbackStub();
|
||||
int32_t ret = imsCoreServiceProxy_->RegisterImsCoreServiceCallback(imsCoreServiceCallback_);
|
||||
if (ret) {
|
||||
TELEPHONY_LOGE("RegisterImsCoreServiceCallback return, register callback error.");
|
||||
|
@ -48,7 +48,7 @@ public:
|
||||
void UnregisterEvents();
|
||||
void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override;
|
||||
void GetSignalInfo(std::vector<sptr<SignalInformation>> &signals);
|
||||
void UpdatePhone(RadioTech csRadioTech, RadioTech psRadioTech) const;
|
||||
void UpdatePhone(RadioTech csRadioTech, const RadioTech &psRadioTech) const;
|
||||
void GetCellInfoList(std::vector<sptr<CellInformation>> &cells);
|
||||
void DcPhysicalLinkActiveUpdate(const AppExecFwk::InnerEvent::Pointer &event);
|
||||
void UpdateImsServiceStatus(const AppExecFwk::InnerEvent::Pointer &event);
|
||||
|
@ -181,7 +181,8 @@ public:
|
||||
std::shared_ptr<NetworkSearchState> GetNetworkSearchState(int32_t slotId);
|
||||
void TriggerSimRefresh(int32_t slotId);
|
||||
void TriggerTimezoneRefresh(int32_t slotId);
|
||||
void SetNetworkSearchResultValue(int32_t slotId, int32_t listSize, std::vector<NetworkInformation> &operatorInfo);
|
||||
void SetNetworkSearchResultValue(
|
||||
int32_t slotId, int32_t listSize, const std::vector<NetworkInformation> &operatorInfo);
|
||||
sptr<NetworkSearchResult> GetNetworkSearchInformationValue(int32_t slotId);
|
||||
int32_t GetNetworkSelectionMode(int32_t slotId);
|
||||
bool SetNetworkSelectionMode(
|
||||
@ -192,7 +193,7 @@ public:
|
||||
bool SetPreferredNetwork(int32_t slotId, int32_t networkMode);
|
||||
void SavePreferredNetworkValue(int32_t slotId, int32_t networkMode);
|
||||
int32_t GetPreferredNetworkValue(int32_t slotId) const;
|
||||
void UpdatePhone(int32_t slotId, RadioTech csRadioTech, RadioTech psRadioTech);
|
||||
void UpdatePhone(int32_t slotId, RadioTech csRadioTech, const RadioTech &psRadioTech);
|
||||
void SetImei(int32_t slotId, std::u16string imei);
|
||||
void UpdateCellLocation(int32_t slotId, int32_t techType, int32_t cellId, int32_t lac);
|
||||
void SetMeid(int32_t slotId, std::u16string meid);
|
||||
@ -204,7 +205,7 @@ public:
|
||||
bool GetAirplaneMode();
|
||||
bool IsRadioFirstPowerOn(int32_t slotId);
|
||||
void SetRadioFirstPowerOn(int32_t slotId, bool isFirstPowerOn);
|
||||
void NotifyImsRegInfoChanged(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo info);
|
||||
void NotifyImsRegInfoChanged(int32_t slotId, ImsServiceType imsSrvType, const ImsRegInfo &info);
|
||||
void InitSimRadioProtocol(int32_t slotId);
|
||||
|
||||
inline void InitMsgNum(int32_t slotId)
|
||||
|
@ -54,7 +54,9 @@ private:
|
||||
void NotifyPsRadioTechChange();
|
||||
void NotifyEmergencyChange();
|
||||
void NotifyNrStateChange();
|
||||
void NotifyImsStateChange(const ImsServiceType imsSrvType, const ImsRegInfo info);
|
||||
void NotifyImsStateChange(ImsServiceType imsSrvType, const ImsRegInfo &info);
|
||||
|
||||
private:
|
||||
std::mutex mutex_;
|
||||
std::weak_ptr<NetworkSearchManager> networkSearchManager_;
|
||||
std::unique_ptr<NetworkState> networkState_ = nullptr;
|
||||
|
@ -45,7 +45,7 @@ class NetworkUtils {
|
||||
public:
|
||||
static PreferredNetworkMode GetNetworkModeFromRaf(int32_t raf);
|
||||
static int32_t GetRafFromNetworkMode(PreferredNetworkMode PreferredNetworkMode);
|
||||
static std::vector<std::string> Split(const std::string &input, const std::string &flag);
|
||||
static std::vector<std::string> SplitString(const std::string &inputString, const std::string &flag);
|
||||
|
||||
static int64_t GetCallbackIndex64bit();
|
||||
static std::shared_ptr<NetworkSearchCallbackInfo> FindNetworkSearchCallback(int64_t index);
|
||||
|
@ -41,8 +41,8 @@ public:
|
||||
private:
|
||||
void GsmOperatorInfo(const AppExecFwk::InnerEvent::Pointer &event) const;
|
||||
void CdmaOperatorInfo(const AppExecFwk::InnerEvent::Pointer &event) const;
|
||||
void PublishEvent(const int32_t rule, const RegServiceState state, const bool showPlmn, const std::string &plmn,
|
||||
const bool showSpn, const std::string &spn);
|
||||
void PublishEvent(int32_t rule, RegServiceState state, bool showPlmn, const std::string &plmn, bool showSpn,
|
||||
const std::string &spn);
|
||||
sptr<NetworkState> GetNetworkStatus();
|
||||
void NotifyGsmSpnChanged(RegServiceState regStatus, sptr<NetworkState> &networkState);
|
||||
void NotifyCdmaSpnChanged(RegServiceState regStatus, sptr<NetworkState> &networkState);
|
||||
|
@ -33,13 +33,13 @@ public:
|
||||
void UpdatePreferredNetwork(std::shared_ptr<NetworkSearchManager> &nsm, ModemPowerState radioState) const;
|
||||
void ProcessGetImei(const AppExecFwk::InnerEvent::Pointer &event) const;
|
||||
void ProcessGetMeid(const AppExecFwk::InnerEvent::Pointer &event) const;
|
||||
void UpdatePhone(RadioTech csRadioTech, RadioTech psRadioTech);
|
||||
void UpdatePhone(RadioTech csRadioTech, const RadioTech &psRadioTech);
|
||||
void SetPhoneType(PhoneType phoneType);
|
||||
PhoneType GetPhoneType() const;
|
||||
void ProcessVoiceTechChange(const AppExecFwk::InnerEvent::Pointer &event);
|
||||
void AirplaneModeChange();
|
||||
private:
|
||||
PhoneType RadioTechToPhoneType(RadioTech csRadioTech, RadioTech psRadioTech) const;
|
||||
PhoneType RadioTechToPhoneType(RadioTech csRadioTech, const RadioTech &psRadioTech) const;
|
||||
PhoneType phoneType_ = PhoneType::PHONE_TYPE_IS_NONE;
|
||||
std::weak_ptr<NetworkSearchManager> networkSearchManager_;
|
||||
int32_t slotId_ = 0;
|
||||
|
@ -22,8 +22,10 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const uint32_t CELL_REQUEST_SHORT_INTERVAL = 2; // This is the minimum interval in seconds for cell requests
|
||||
const uint32_t CELL_REQUEST_LONG_INTERVAL = 10; // This is the maximum interval in seconds for cell requests
|
||||
} // namespace
|
||||
|
||||
DeviceStateHandler::DeviceStateHandler(
|
||||
const std::weak_ptr<NetworkSearchManager> &networkSearchManager,
|
||||
@ -132,10 +134,12 @@ void DeviceStateHandler::SetCellRequestMinInterval(uint32_t minInterval) const
|
||||
{
|
||||
std::shared_ptr<NetworkSearchManager> nsm = networkSearchManager_.lock();
|
||||
if (nsm == nullptr) {
|
||||
TELEPHONY_LOGE("DeviceStateHandler::SetCellRequestMinInterval nsm is null");
|
||||
return;
|
||||
}
|
||||
auto inner = nsm->FindManagerInner(slotId_);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("DeviceStateHandler::SetCellRequestMinInterval inner is null");
|
||||
return;
|
||||
}
|
||||
if (inner->networkSearchHandler_ != nullptr) {
|
||||
|
@ -25,7 +25,9 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const std::string NET_TYPE = "NetType";
|
||||
}
|
||||
|
||||
void DeviceStateObserver::StartEventSubscriber(const std::shared_ptr<DeviceStateHandler> &deviceStateHandler)
|
||||
{
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const char *TELEPHONY_NR_CONVERSION_CONFIG_INDEX = "persist.telephony.nr.config.index"; // "A/B/C/D"
|
||||
/**
|
||||
* System configuration format
|
||||
@ -41,6 +42,8 @@ const char *TELEPHONY_NR_CONVERSION_CONFIG_D = "persist.telephony.nr.config.d";
|
||||
const int32_t SYS_PARAMETER_SIZE = 256;
|
||||
const int32_t NR_STATE_NUM = 6;
|
||||
const int32_t KEY_VALUE_NUM = 2;
|
||||
const int32_t MAX_SIZE = 100;
|
||||
} // namespace
|
||||
|
||||
NetworkRegister::NetworkRegister(std::shared_ptr<NetworkSearchState> networkSearchState,
|
||||
std::weak_ptr<NetworkSearchManager> networkSearchManager, int32_t slotId)
|
||||
@ -51,7 +54,7 @@ NetworkRegister::NetworkRegister(std::shared_ptr<NetworkSearchState> networkSear
|
||||
|
||||
void NetworkRegister::InitNrConversionConfig()
|
||||
{
|
||||
char prase[SYS_PARAMETER_SIZE] = {0};
|
||||
char prase[SYS_PARAMETER_SIZE] = { 0 };
|
||||
int code = GetParameter(TELEPHONY_NR_CONVERSION_CONFIG_INDEX, "A", prase, SYS_PARAMETER_SIZE);
|
||||
if (code <= 0 || prase[0] > 'D' || prase[0] < 'A') {
|
||||
TELEPHONY_LOGE(
|
||||
@ -80,9 +83,8 @@ void NetworkRegister::InitNrConversionConfig()
|
||||
strNrConfig = prase;
|
||||
if (code <= 0 || strNrConfig.empty()) {
|
||||
TELEPHONY_LOGI("Failed to get system properties err:%{public}d use default config a", code);
|
||||
strNrConfig =
|
||||
"NOT_SUPPORT:4g,NO_DETECT:4g,CONNECTED_DETECT:4g,"
|
||||
"IDLE_DETECT:4g,DUAL_CONNECTED:5g,SA_ATTACHED:5g";
|
||||
strNrConfig = "NOT_SUPPORT:4g,NO_DETECT:4g,CONNECTED_DETECT:4g,"
|
||||
"IDLE_DETECT:4g,DUAL_CONNECTED:5g,SA_ATTACHED:5g";
|
||||
}
|
||||
NrConfigParse(strNrConfig);
|
||||
}
|
||||
@ -91,8 +93,7 @@ void NetworkRegister::ProcessCsRegister(const AppExecFwk::InnerEvent::Pointer &e
|
||||
{
|
||||
auto networkSearchManager = networkSearchManager_.lock();
|
||||
if (networkSearchManager == nullptr) {
|
||||
TELEPHONY_LOGE(
|
||||
"NetworkRegister::ProcessCsRegister networkSearchManager is nullptr slotId:%{public}d", slotId_);
|
||||
TELEPHONY_LOGE("NetworkRegister::ProcessCsRegister networkSearchManager is nullptr slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
networkSearchManager->decMsgNum(slotId_);
|
||||
@ -108,8 +109,7 @@ void NetworkRegister::ProcessCsRegister(const AppExecFwk::InnerEvent::Pointer &e
|
||||
RilRegister registrationStatus = static_cast<RilRegister>(csRegStateResult->regStatus);
|
||||
RegServiceState regStatus = ConvertRegFromRil(registrationStatus);
|
||||
if (networkSearchState_ == nullptr) {
|
||||
TELEPHONY_LOGE(
|
||||
"NetworkRegister::ProcessCsRegister networkSearchState_ is nullptr slotId:%{public}d", slotId_);
|
||||
TELEPHONY_LOGE("NetworkRegister::ProcessCsRegister networkSearchState_ is nullptr slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
networkSearchState_->SetNetworkState(regStatus, DomainType::DOMAIN_TYPE_CS);
|
||||
@ -148,15 +148,13 @@ void NetworkRegister::ProcessPsRegister(const AppExecFwk::InnerEvent::Pointer &e
|
||||
|
||||
std::shared_ptr<PsRegStatusResultInfo> psRegStatusResult = event->GetSharedObject<PsRegStatusResultInfo>();
|
||||
if (psRegStatusResult == nullptr) {
|
||||
TELEPHONY_LOGE(
|
||||
"NetworkRegister::ProcessPsRegister psRegStatusResult is nullptr slotId:%{public}d", slotId_);
|
||||
TELEPHONY_LOGE("NetworkRegister::ProcessPsRegister psRegStatusResult is nullptr slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
RilRegister registrationStatus = static_cast<RilRegister>(psRegStatusResult->regStatus);
|
||||
RegServiceState regStatus = ConvertRegFromRil(registrationStatus);
|
||||
if (networkSearchState_ == nullptr) {
|
||||
TELEPHONY_LOGE(
|
||||
"NetworkRegister::ProcessPsRegister networkSearchState_ is nullptr slotId:%{public}d", slotId_);
|
||||
TELEPHONY_LOGE("NetworkRegister::ProcessPsRegister networkSearchState_ is nullptr slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
networkSearchState_->SetNetworkState(regStatus, DomainType::DOMAIN_TYPE_PS);
|
||||
@ -194,8 +192,11 @@ void NetworkRegister::ProcessChannelConfigInfo(const AppExecFwk::InnerEvent::Poi
|
||||
return;
|
||||
}
|
||||
int32_t size = channelConfigInfoList->itemNum;
|
||||
TELEPHONY_LOGI(
|
||||
"NetworkRegister::ProcessChannelConfigInfo num size:%{public}d slotId:%{public}d", size, slotId_);
|
||||
TELEPHONY_LOGI("NetworkRegister::ProcessChannelConfigInfo num size:%{public}d slotId:%{public}d", size, slotId_);
|
||||
if (size >= MAX_SIZE) {
|
||||
TELEPHONY_LOGE("NetworkRegister::ProcessChannelConfigInfo num over max size");
|
||||
return;
|
||||
}
|
||||
if (channelConfigInfoList->channelConfigInfos.size() > 0 &&
|
||||
static_cast<int32_t>(channelConfigInfoList->channelConfigInfos.size()) == size) {
|
||||
std::vector<PhysicalChannelConfig> &configs = channelConfigInfoList->channelConfigInfos;
|
||||
@ -210,7 +211,7 @@ void NetworkRegister::ProcessChannelConfigInfo(const AppExecFwk::InnerEvent::Poi
|
||||
for (int i = 0; i < size; ++i) {
|
||||
if (static_cast<RadioTech>(channelConfigInfos_[i].ratType) == RadioTech::RADIO_TECHNOLOGY_NR &&
|
||||
static_cast<ConnectServiceCell>(channelConfigInfos_[i].cellConnStatus) ==
|
||||
ConnectServiceCell::CONNECTION_SECONDARY_CELL) {
|
||||
ConnectServiceCell::CONNECTION_SECONDARY_CELL) {
|
||||
isNrSecondaryCell = true;
|
||||
break;
|
||||
}
|
||||
@ -386,7 +387,7 @@ void NetworkRegister::NrConfigParse(std::string &cfgStr)
|
||||
/**
|
||||
* parse string
|
||||
* NOT_SUPPORT:4g,NO_DETECT:4g,CONNECTED_DETECT:4g,IDLE_DETECT:4g,DUAL_CONNECTED:5g,SA_ATTACHED:5g
|
||||
*/
|
||||
*/
|
||||
std::string strSep = ",";
|
||||
std::vector<std::string> strsRet;
|
||||
SplitStr(cfgStr, strSep, strsRet);
|
||||
@ -401,8 +402,7 @@ void NetworkRegister::NrConfigParse(std::string &cfgStr)
|
||||
strSep = ":";
|
||||
SplitStr(state, strSep, nrStateKv);
|
||||
if (static_cast<int>(nrStateKv.size()) != KEY_VALUE_NUM) {
|
||||
TELEPHONY_LOGE("NetworkRegister::NrConfigParse key value string error slotId:%{public}d",
|
||||
slotId_);
|
||||
TELEPHONY_LOGE("NetworkRegister::NrConfigParse key value string error slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
NrState nrState = ConvertStringToNrState(nrStateKv[0]);
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
const int32_t REQ_INTERVAL = 30;
|
||||
static const int32_t REQ_INTERVAL = 30;
|
||||
const std::map<uint32_t, NetworkSearchHandler::NsHandlerFunc> NetworkSearchHandler::memberFuncMap_ = {
|
||||
{ RadioEvent::RADIO_SIM_STATE_CHANGE, &NetworkSearchHandler::SimStateChange },
|
||||
{ RadioEvent::RADIO_IMSI_LOADED_READY, &NetworkSearchHandler::ImsiLoadedReady },
|
||||
@ -316,7 +316,7 @@ void NetworkSearchHandler::RadioRilDataRegState(const AppExecFwk::InnerEvent::Po
|
||||
{
|
||||
auto networkSearchManager = networkSearchManager_.lock();
|
||||
if (networkSearchManager == nullptr ||
|
||||
networkSearchManager->GetRadioState(slotId_) == (int)ModemPowerState::CORE_SERVICE_POWER_OFF) {
|
||||
networkSearchManager->GetRadioState(slotId_) == static_cast<int>(ModemPowerState::CORE_SERVICE_POWER_OFF)) {
|
||||
TELEPHONY_LOGI("radio is power off, no need update data reg state");
|
||||
return;
|
||||
}
|
||||
@ -330,7 +330,7 @@ void NetworkSearchHandler::RadioRilVoiceRegState(const AppExecFwk::InnerEvent::P
|
||||
{
|
||||
auto networkSearchManager = networkSearchManager_.lock();
|
||||
if (networkSearchManager == nullptr ||
|
||||
networkSearchManager->GetRadioState(slotId_) == (int)ModemPowerState::CORE_SERVICE_POWER_OFF) {
|
||||
networkSearchManager->GetRadioState(slotId_) == static_cast<int>(ModemPowerState::CORE_SERVICE_POWER_OFF)) {
|
||||
TELEPHONY_LOGI("radio is power off, no need update voice reg state");
|
||||
return;
|
||||
}
|
||||
@ -625,7 +625,7 @@ void NetworkSearchHandler::RadioGetMeid(const AppExecFwk::InnerEvent::Pointer &e
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkSearchHandler::UpdatePhone(RadioTech csRadioTech, RadioTech psRadioTech) const
|
||||
void NetworkSearchHandler::UpdatePhone(RadioTech csRadioTech, const RadioTech &psRadioTech) const
|
||||
{
|
||||
if (radioInfo_ != nullptr) {
|
||||
radioInfo_->UpdatePhone(csRadioTech, psRadioTech);
|
||||
@ -686,7 +686,7 @@ void NetworkSearchHandler::SendUpdateCellLocationRequest()
|
||||
if (cellInfo_ != nullptr) {
|
||||
cellInfo_->GetCellInfoList(cells);
|
||||
}
|
||||
uint32_t curTime = (uint32_t)time(0);
|
||||
uint32_t curTime = static_cast<uint32_t>(time(0));
|
||||
if ((curTime - lastCellRequestTime_) < cellRequestMinInterval_ && cells.size() != 0) {
|
||||
TELEPHONY_LOGE("NetworkSearchHandler::SendUpdateCellLocationRequest interval is too short");
|
||||
return;
|
||||
|
@ -26,12 +26,14 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const std::string KEY_DEFAULT_PREFERRED_NETWORK_MODE = "preferred_network_mode";
|
||||
|
||||
const int32_t AIRPLANE_MODE_UNSUPPORT = 0;
|
||||
const int32_t AIRPLANE_MODE_SUPPORT = 1;
|
||||
const std::string SUPPORT_AIRPLANE_MODE_PARAM = "persist.sys.support_air_plane_mode";
|
||||
const int32_t IS_SUPPORT_AIRPLANE_MODE = system::GetIntParameter(SUPPORT_AIRPLANE_MODE_PARAM, AIRPLANE_MODE_UNSUPPORT);
|
||||
const size_t MCC_LEN = 3;
|
||||
} // namespace
|
||||
|
||||
NetworkSearchManager::NetworkSearchManager(
|
||||
std::shared_ptr<ITelRilManager> telRilManager, std::shared_ptr<ISimManager> simManager)
|
||||
@ -96,9 +98,9 @@ bool NetworkSearchManager::InitPointer(std::shared_ptr<NetworkSearchManagerInner
|
||||
|
||||
bool NetworkSearchManagerInner::RegisterSetting()
|
||||
{
|
||||
settingAutoTimeObserver_ = std::make_unique<AutoTimeObserver>(networkSearchHandler_).release();
|
||||
settingAutoTimezoneObserver_ = std::make_unique<AutoTimezoneObserver>(networkSearchHandler_).release();
|
||||
airplaneModeObserver_ = std::make_unique<AirplaneModeObserver>(networkSearchHandler_).release();
|
||||
settingAutoTimeObserver_ = new AutoTimeObserver(networkSearchHandler_);
|
||||
settingAutoTimezoneObserver_ = new AutoTimezoneObserver(networkSearchHandler_);
|
||||
airplaneModeObserver_ = new AirplaneModeObserver(networkSearchHandler_);
|
||||
std::shared_ptr<SettingUtils> settingHelper = SettingUtils::GetInstance();
|
||||
if (settingAutoTimeObserver_ == nullptr || settingAutoTimezoneObserver_ == nullptr ||
|
||||
airplaneModeObserver_ == nullptr || settingHelper == nullptr) {
|
||||
@ -210,6 +212,7 @@ void NetworkSearchManager::SetRadioState(int32_t slotId, bool isOn, int32_t rst)
|
||||
TELEPHONY_LOGI("NetworkSearchManager SetRadioState isOn:%{public}d slotId:%{public}d", isOn, slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return;
|
||||
}
|
||||
int32_t fun = static_cast<int32_t>(isOn);
|
||||
@ -221,6 +224,7 @@ bool NetworkSearchManager::SetRadioState(int32_t slotId, bool isOn, int32_t rst,
|
||||
TELEPHONY_LOGI("NetworkSearchManager SetRadioState isOn:%{public}d slotId:%{public}d", isOn, slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
AirplaneMode_ = isOn ? false : true;
|
||||
@ -518,6 +522,7 @@ bool NetworkSearchManager::GetRadioState(int32_t slotId, NSCALLBACK &callback)
|
||||
TELEPHONY_LOGI("NetworkSearchManager::GetRadioState... slotId:%{public}d", slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
return eventSender_->SendCallback(slotId, RadioEvent::RADIO_GET_STATUS, &callback);
|
||||
@ -539,13 +544,14 @@ bool NetworkSearchManager::GetNetworkSearchInformation(int32_t slotId, NSCALLBAC
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
return eventSender_->SendCallback(slotId, RadioEvent::RADIO_NETWORK_SEARCH_RESULT, &callback);
|
||||
}
|
||||
|
||||
void NetworkSearchManager::SetNetworkSearchResultValue(
|
||||
int32_t slotId, int32_t listSize, std::vector<NetworkInformation> &operatorInfo)
|
||||
int32_t slotId, int32_t listSize, const std::vector<NetworkInformation> &operatorInfo)
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner != nullptr) {
|
||||
@ -593,6 +599,7 @@ bool NetworkSearchManager::GetNetworkSelectionMode(int32_t slotId, NSCALLBACK &c
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
return eventSender_->SendCallback(slotId, RadioEvent::RADIO_GET_NETWORK_SELECTION_MODE, &callback);
|
||||
@ -605,6 +612,7 @@ bool NetworkSearchManager::SetNetworkSelectionMode(
|
||||
"NetworkSearchManager SetNetworkSelectionMode selectMode:%{public}d slotId:%{public}d", selectMode, slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
std::string plmnNumeric = "";
|
||||
@ -621,6 +629,7 @@ bool NetworkSearchManager::SetNetworkSelectionMode(int32_t slotId, int32_t selec
|
||||
"NetworkSearchManager SetNetworkSelectionMode selectMode:%{public}d slotId:%{public}d", selectMode, slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
std::string plmnNumeric = "";
|
||||
@ -633,10 +642,10 @@ bool NetworkSearchManager::SetNetworkSelectionMode(int32_t slotId, int32_t selec
|
||||
|
||||
std::u16string NetworkSearchManager::GetIsoCountryCodeForNetwork(int32_t slotId)
|
||||
{
|
||||
const size_t MCC_LEN = 3;
|
||||
std::string iso = "";
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return Str8ToStr16(iso);
|
||||
}
|
||||
if (inner->networkSearchHandler_ == nullptr) {
|
||||
@ -669,6 +678,7 @@ bool NetworkSearchManager::GetPreferredNetwork(int32_t slotId, NSCALLBACK &callb
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
return eventSender_->SendCallback(slotId, RadioEvent::RADIO_GET_PREFERRED_NETWORK_MODE, &callback);
|
||||
@ -690,8 +700,8 @@ bool NetworkSearchManager::SetPreferredNetwork(int32_t slotId, int32_t networkMo
|
||||
int32_t raf = NetworkUtils::GetRafFromNetworkMode(static_cast<PreferredNetworkMode>(networkMode));
|
||||
if (modemRaf == static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_UNKNOWN) ||
|
||||
raf == static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_UNKNOWN)) {
|
||||
TELEPHONY_LOGE("SetPreferredNetwork failed modemRaf:%{public}d raf:%{public}d slotId:%{public}d",
|
||||
modemRaf, raf, slotId);
|
||||
TELEPHONY_LOGE(
|
||||
"SetPreferredNetwork failed modemRaf:%{public}d raf:%{public}d slotId:%{public}d", modemRaf, raf, slotId);
|
||||
return false;
|
||||
}
|
||||
int32_t filterMode = static_cast<int32_t>(NetworkUtils::GetNetworkModeFromRaf(modemRaf & raf));
|
||||
@ -704,6 +714,7 @@ bool NetworkSearchManager::GetPreferredNetwork(int32_t slotId)
|
||||
TELEPHONY_LOGI("NetworkSearchManager GetPreferredNetwork slotId:%{public}d", slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return false;
|
||||
}
|
||||
return eventSender_->SendBase(slotId, RadioEvent::RADIO_GET_PREFERRED_NETWORK_MODE);
|
||||
@ -725,8 +736,8 @@ bool NetworkSearchManager::SetPreferredNetwork(int32_t slotId, int32_t networkMo
|
||||
int32_t raf = NetworkUtils::GetRafFromNetworkMode(static_cast<PreferredNetworkMode>(networkMode));
|
||||
if (modemRaf == static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_UNKNOWN) ||
|
||||
raf == static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_UNKNOWN)) {
|
||||
TELEPHONY_LOGE("SetPreferredNetwork failed modemRaf:%{public}d raf:%{public}d slotId:%{public}d",
|
||||
modemRaf, raf, slotId);
|
||||
TELEPHONY_LOGE(
|
||||
"SetPreferredNetwork failed modemRaf:%{public}d raf:%{public}d slotId:%{public}d", modemRaf, raf, slotId);
|
||||
return false;
|
||||
}
|
||||
int32_t filterMode = static_cast<int32_t>(NetworkUtils::GetNetworkModeFromRaf(modemRaf & raf));
|
||||
@ -770,14 +781,13 @@ int32_t NetworkSearchManager::GetPreferredNetworkValue(int32_t slotId) const
|
||||
}
|
||||
|
||||
bool succ = StrToInt(value, networkMode);
|
||||
TELEPHONY_LOGI(
|
||||
"NetworkSearchManager GetPreferredNetworkValue succ:%{public}d, slotId:%{public}d, "
|
||||
"networkMode:%{public}d",
|
||||
TELEPHONY_LOGI("NetworkSearchManager GetPreferredNetworkValue succ:%{public}d, slotId:%{public}d, "
|
||||
"networkMode:%{public}d",
|
||||
slotId, succ, networkMode);
|
||||
return networkMode;
|
||||
}
|
||||
|
||||
void NetworkSearchManager::UpdatePhone(int32_t slotId, RadioTech csRadioTech, RadioTech psRadioTech)
|
||||
void NetworkSearchManager::UpdatePhone(int32_t slotId, RadioTech csRadioTech, const RadioTech &psRadioTech)
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner != nullptr) {
|
||||
@ -815,6 +825,7 @@ std::u16string NetworkSearchManager::GetImei(int32_t slotId)
|
||||
TELEPHONY_LOGI("NetworkSearchManager::GetImei start slotId:%{public}d", slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return std::u16string();
|
||||
}
|
||||
if (inner->imei_.empty()) {
|
||||
@ -884,6 +895,7 @@ std::u16string NetworkSearchManager::GetMeid(int32_t slotId)
|
||||
TELEPHONY_LOGI("NetworkSearchManager::GetMeid start slotId:%{public}d", slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return std::u16string();
|
||||
}
|
||||
if (inner->meid_.empty()) {
|
||||
@ -914,6 +926,7 @@ std::u16string NetworkSearchManager::GetUniqueDeviceId(int32_t slotId)
|
||||
TELEPHONY_LOGI("NetworkSearchManager::GetUniqueDeviceId start slotId:%{public}d", slotId);
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return std::u16string();
|
||||
}
|
||||
if (GetPhoneType(slotId) == PhoneType::PHONE_TYPE_IS_GSM) {
|
||||
@ -945,6 +958,7 @@ void NetworkSearchManager::GetVoiceTech(int32_t slotId)
|
||||
{
|
||||
auto inner = FindManagerInner(slotId);
|
||||
if (inner == nullptr) {
|
||||
TELEPHONY_LOGE("slotId:%{public}d inner is null", slotId);
|
||||
return;
|
||||
}
|
||||
eventSender_->SendBase(slotId, RadioEvent::RADIO_GET_VOICE_TECH);
|
||||
@ -1188,7 +1202,7 @@ int32_t NetworkSearchManager::UnregisterImsRegInfoCallback(
|
||||
return TELEPHONY_SUCCESS;
|
||||
}
|
||||
|
||||
void NetworkSearchManager::NotifyImsRegInfoChanged(int32_t slotId, ImsServiceType imsSrvType, ImsRegInfo info)
|
||||
void NetworkSearchManager::NotifyImsRegInfoChanged(int32_t slotId, ImsServiceType imsSrvType, const ImsRegInfo &info)
|
||||
{
|
||||
TELEPHONY_LOGI(
|
||||
"slotId:%{public}d, ImsRegState:%{public}d, ImsRegTech:%{public}d", slotId, info.imsRegState, info.imsRegTech);
|
||||
|
@ -354,7 +354,7 @@ void NetworkSearchState::NotifyNrStateChange()
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkSearchState::NotifyImsStateChange(const ImsServiceType imsSrvType, const ImsRegInfo info)
|
||||
void NetworkSearchState::NotifyImsStateChange(ImsServiceType imsSrvType, const ImsRegInfo &info)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
auto networkSearchManager = networkSearchManager_.lock();
|
||||
|
@ -34,24 +34,25 @@ using RilFunc_Int_String_Event = int32_t (ITelRilManager::*)(
|
||||
int32_t, int32_t, std::string, const AppExecFwk::InnerEvent::Pointer &);
|
||||
|
||||
// group
|
||||
const int32_t GSM = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_GSM);
|
||||
const int32_t CDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_1XRTT);
|
||||
const int32_t EVDO = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_EVDO) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_EHRPD);
|
||||
const int32_t WCDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_WCDMA) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_HSPA) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_HSPAP);
|
||||
const int32_t TDSCDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_TD_SCDMA);
|
||||
const int32_t LTE = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_LTE) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_LTE_CA);
|
||||
const int32_t NR = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_NR);
|
||||
// nG
|
||||
const int32_t RAF_2G = GSM | CDMA;
|
||||
const int32_t RAF_3G = WCDMA | EVDO | TDSCDMA;
|
||||
const int32_t RAF_4G = LTE;
|
||||
const int32_t RAF_5G = NR;
|
||||
static const int32_t GSM = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_GSM);
|
||||
static const int32_t CDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_1XRTT);
|
||||
static const int32_t EVDO = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_EVDO) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_EHRPD);
|
||||
static const int32_t WCDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_WCDMA) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_HSPA) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_HSPAP);
|
||||
static const int32_t TDSCDMA = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_TD_SCDMA);
|
||||
static const int32_t LTE = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_LTE) |
|
||||
static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_LTE_CA);
|
||||
static const int32_t NR = static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_NR);
|
||||
|
||||
// generation
|
||||
static const int32_t RAF_2G = GSM | CDMA;
|
||||
static const int32_t RAF_3G = WCDMA | EVDO | TDSCDMA;
|
||||
static const int32_t RAF_4G = LTE;
|
||||
static const int32_t RAF_5G = NR;
|
||||
// auto mode , support all radio mode
|
||||
const int32_t RAF_AUTO = RAF_2G | RAF_3G | RAF_4G | RAF_5G;
|
||||
static const int32_t RAF_AUTO = RAF_2G | RAF_3G | RAF_4G | RAF_5G;
|
||||
|
||||
static const std::map<int32_t, PreferredNetworkMode> mapNetworkModeFromRaf = {
|
||||
{ RAF_AUTO, PreferredNetworkMode::CORE_NETWORK_MODE_AUTO },
|
||||
@ -152,23 +153,23 @@ int32_t NetworkUtils::GetRafFromNetworkMode(PreferredNetworkMode PreferredNetwor
|
||||
return static_cast<int32_t>(RadioProtocolTech::RADIO_PROTOCOL_TECH_UNKNOWN);
|
||||
}
|
||||
|
||||
std::vector<std::string> NetworkUtils::Split(const std::string &input, const std::string &flag)
|
||||
std::vector<std::string> NetworkUtils::SplitString(const std::string &inputString, const std::string &flag)
|
||||
{
|
||||
std::vector<std::string> vec;
|
||||
if (input.empty()) {
|
||||
TELEPHONY_LOGE("input is null");
|
||||
return vec;
|
||||
std::vector<std::string> result;
|
||||
if (inputString.empty()) {
|
||||
TELEPHONY_LOGE("inputString is null");
|
||||
return result;
|
||||
}
|
||||
std::string::size_type start = 0;
|
||||
std::string::size_type pos = 0;
|
||||
while ((pos = input.find(flag, start)) != std::string::npos) {
|
||||
vec.push_back(input.substr(start, pos - start));
|
||||
start = pos + flag.size();
|
||||
std::string::size_type position = 0;
|
||||
while ((position = inputString.find(flag, start)) != std::string::npos) {
|
||||
result.push_back(inputString.substr(start, position - start));
|
||||
start = position + flag.size();
|
||||
}
|
||||
if (start != input.size()) {
|
||||
vec.push_back(input.substr(start, input.size() - start));
|
||||
if (start != inputString.size()) {
|
||||
result.push_back(inputString.substr(start, inputString.size() - start));
|
||||
}
|
||||
return vec;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool NetworkUtils::AddNetworkSearchCallBack(int64_t index, std::shared_ptr<NetworkSearchCallbackInfo> &callback)
|
||||
|
@ -30,9 +30,11 @@ using namespace OHOS::EventFwk;
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const int32_t FORMAT_IDX_SPN_CS = 0;
|
||||
const int32_t PNN_CUST_STRING_SIZE = 2;
|
||||
const int32_t OPL_CUST_STRING_SIZE = 4;
|
||||
} // namespace
|
||||
|
||||
OperatorName::OperatorName(const EventFwk::CommonEventSubscribeInfo &sp,
|
||||
std::shared_ptr<NetworkSearchState> networkSearchState, std::shared_ptr<ISimManager> simManager,
|
||||
@ -166,6 +168,7 @@ void OperatorName::NotifySpnChanged()
|
||||
auto networkSearchManager = networkSearchManager_.lock();
|
||||
if (networkSearchManager == nullptr) {
|
||||
TELEPHONY_LOGE("OperatorName::NotifySpnChanged networkSearchManager is nullptr slotId:%{public}d", slotId_);
|
||||
return;
|
||||
}
|
||||
TELEPHONY_LOGI("OperatorName::NotifySpnChanged slotId:%{public}d", slotId_);
|
||||
RegServiceState regStatus = RegServiceState::REG_STATE_UNKNOWN;
|
||||
@ -189,8 +192,9 @@ void OperatorName::UpdatePlmn(
|
||||
switch (regStatus) {
|
||||
case RegServiceState::REG_STATE_IN_SERVICE:
|
||||
plmn = GetPlmn(networkState, true);
|
||||
showPlmn = !plmn.empty() && (((uint32_t)spnRule & SpnShowType::SPN_CONDITION_DISPLAY_PLMN) ==
|
||||
SpnShowType::SPN_CONDITION_DISPLAY_PLMN);
|
||||
showPlmn =
|
||||
!plmn.empty() && ((static_cast<uint32_t>(spnRule) & SpnShowType::SPN_CONDITION_DISPLAY_PLMN) ==
|
||||
SpnShowType::SPN_CONDITION_DISPLAY_PLMN);
|
||||
break;
|
||||
case RegServiceState::REG_STATE_NO_SERVICE:
|
||||
case RegServiceState::REG_STATE_EMERGENCY_ONLY:
|
||||
@ -229,7 +233,7 @@ void OperatorName::UpdateSpn(
|
||||
if (!csSpnFormat_.empty()) {
|
||||
spn = NetworkUtils::FormatString(csSpnFormat_, spn.c_str());
|
||||
}
|
||||
showSpn = !spn.empty() && (((uint32_t)spnRule & SpnShowType::SPN_CONDITION_DISPLAY_SPN) ==
|
||||
showSpn = !spn.empty() && ((static_cast<uint32_t>(spnRule) & SpnShowType::SPN_CONDITION_DISPLAY_SPN) ==
|
||||
SpnShowType::SPN_CONDITION_DISPLAY_SPN);
|
||||
} else {
|
||||
spn = "";
|
||||
@ -381,13 +385,14 @@ unsigned int OperatorName::GetCustSpnRule(bool roaming)
|
||||
}
|
||||
if (roaming) {
|
||||
cond = SPN_CONDITION_DISPLAY_PLMN;
|
||||
if (((unsigned int)(displayConditionCust_) & (unsigned int)(SPN_COND)) == 0) {
|
||||
cond |= (unsigned int)SPN_CONDITION_DISPLAY_SPN;
|
||||
if ((static_cast<unsigned int>(displayConditionCust_) & static_cast<unsigned int>(SPN_COND)) == 0) {
|
||||
cond |= static_cast<unsigned int>(SPN_CONDITION_DISPLAY_SPN);
|
||||
}
|
||||
} else {
|
||||
cond = SPN_CONDITION_DISPLAY_SPN;
|
||||
if (((unsigned int)(displayConditionCust_) & (unsigned int)(SPN_COND_PLMN)) == SPN_COND_PLMN) {
|
||||
cond |= (unsigned int)SPN_CONDITION_DISPLAY_PLMN;
|
||||
if ((static_cast<unsigned int>(displayConditionCust_) & static_cast<unsigned int>(SPN_COND_PLMN)) ==
|
||||
SPN_COND_PLMN) {
|
||||
cond |= static_cast<unsigned int>(SPN_CONDITION_DISPLAY_PLMN);
|
||||
}
|
||||
}
|
||||
return cond;
|
||||
@ -395,33 +400,25 @@ unsigned int OperatorName::GetCustSpnRule(bool roaming)
|
||||
|
||||
std::string OperatorName::GetCustEons(const std::string &numeric, int32_t lac, bool roaming, bool longNameRequired)
|
||||
{
|
||||
if (!enableCust_ || numeric.empty() || pnnCust_.empty()) {
|
||||
TELEPHONY_LOGI("OperatorName::GetCustEons Cust not enable, plmn or pnnFiles is empty");
|
||||
if (!enableCust_ || numeric.empty() || pnnCust_.empty() || (oplCust_.empty() && roaming)) {
|
||||
TELEPHONY_LOGI("OperatorName::GetCustEons is empty");
|
||||
return "";
|
||||
}
|
||||
int32_t pnnIndex = -1;
|
||||
if (oplCust_.empty()) {
|
||||
TELEPHONY_LOGI("OperatorName::GetCustEons oplCust_ is empty");
|
||||
if (roaming) {
|
||||
return "";
|
||||
} else {
|
||||
pnnIndex = 1;
|
||||
int32_t pnnIndex = 1;
|
||||
for (std::shared_ptr<OperatorPlmnInfo> opl : oplCust_) {
|
||||
if (opl == nullptr) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
for (std::shared_ptr<OperatorPlmnInfo> opl : oplCust_) {
|
||||
TELEPHONY_LOGI(
|
||||
"OperatorName::GetCustEons numeric:%{public}s, opl->plmnNumeric:%{public}s, lac:%{public}d, "
|
||||
"opl->lacStart:%{public}d, opl->lacEnd:%{public}d, "
|
||||
"opl->pnnRecordId:%{public}d",
|
||||
numeric.c_str(), opl->plmnNumeric.c_str(), lac, opl->lacStart, opl->lacEnd, opl->pnnRecordId);
|
||||
if (numeric.compare(opl->plmnNumeric) == 0 &&
|
||||
((opl->lacStart == 0 && opl->lacEnd == 0xfffe) || (opl->lacStart <= lac && opl->lacEnd >= lac))) {
|
||||
if (opl->pnnRecordId == 0) {
|
||||
return "";
|
||||
}
|
||||
pnnIndex = opl->pnnRecordId;
|
||||
break;
|
||||
}
|
||||
pnnIndex = -1;
|
||||
TELEPHONY_LOGI(
|
||||
"OperatorName::GetCustEons numeric:%{public}s, opl->plmnNumeric:%{public}s, lac:%{public}d, "
|
||||
"opl->lacStart:%{public}d, opl->lacEnd:%{public}d, "
|
||||
"opl->pnnRecordId:%{public}d",
|
||||
numeric.c_str(), opl->plmnNumeric.c_str(), lac, opl->lacStart, opl->lacEnd, opl->pnnRecordId);
|
||||
if (numeric.compare(opl->plmnNumeric) == 0 &&
|
||||
((opl->lacStart == 0 && opl->lacEnd == 0xfffe) || (opl->lacStart <= lac && opl->lacEnd >= lac))) {
|
||||
pnnIndex = opl->pnnRecordId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TELEPHONY_LOGI("OperatorName::GetCustEons pnnIndex:%{public}d", pnnIndex);
|
||||
@ -522,7 +519,7 @@ void OperatorName::UpdatePnnCust(const std::vector<std::string> &pnnCust)
|
||||
}
|
||||
for (const auto &data : pnnCust) {
|
||||
TELEPHONY_LOGI("OperatorName::UpdatePnnCust: %{public}s", data.c_str());
|
||||
std::vector<std::string> pnnString = NetworkUtils::Split(data, ",");
|
||||
std::vector<std::string> pnnString = NetworkUtils::SplitString(data, ",");
|
||||
if (pnnString.size() != PNN_CUST_STRING_SIZE) {
|
||||
continue;
|
||||
}
|
||||
@ -545,7 +542,7 @@ void OperatorName::UpdateOplCust(const std::vector<std::string> &oplCust)
|
||||
}
|
||||
for (const auto &data : oplCust) {
|
||||
TELEPHONY_LOGI("OperatorName::UpdateOplCust: %{public}s", data.c_str());
|
||||
std::vector<std::string> oplString = NetworkUtils::Split(data, ",");
|
||||
std::vector<std::string> oplString = NetworkUtils::SplitString(data, ",");
|
||||
if (oplString.size() != OPL_CUST_STRING_SIZE || oplString.back().empty()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -138,7 +138,8 @@ void RadioInfo::ProcessSetRadioState(const AppExecFwk::InnerEvent::Pointer &even
|
||||
|
||||
void RadioInfo::RadioFirstPowerOn(std::shared_ptr<NetworkSearchManager> &nsm, ModemPowerState radioState) const
|
||||
{
|
||||
TELEPHONY_LOGI("RadioInfo::RadioFirstPowerOn radioState:%{public}d, slotId:%{public}d", (int)radioState, slotId_);
|
||||
TELEPHONY_LOGI(
|
||||
"RadioInfo::RadioFirstPowerOn radioState:%{public}d, slotId:%{public}d", static_cast<int>(radioState), slotId_);
|
||||
if (radioState != ModemPowerState::CORE_SERVICE_POWER_ON) {
|
||||
return;
|
||||
}
|
||||
@ -212,7 +213,7 @@ PhoneType RadioInfo::GetPhoneType() const
|
||||
return phoneType_;
|
||||
}
|
||||
|
||||
void RadioInfo::UpdatePhone(RadioTech csRadioTech, RadioTech psRadioTech)
|
||||
void RadioInfo::UpdatePhone(RadioTech csRadioTech, const RadioTech &psRadioTech)
|
||||
{
|
||||
TELEPHONY_LOGI("RadioInfo::UpdatePhone");
|
||||
std::shared_ptr<NetworkSearchManager> networkSearchManager = networkSearchManager_.lock();
|
||||
@ -263,7 +264,7 @@ void RadioInfo::ProcessVoiceTechChange(const AppExecFwk::InnerEvent::Pointer &ev
|
||||
UpdatePhone(static_cast<RadioTech>(csRadioTech->actType), psRadioTech);
|
||||
}
|
||||
|
||||
PhoneType RadioInfo::RadioTechToPhoneType(RadioTech csRadioTech, RadioTech psRadioTech) const
|
||||
PhoneType RadioInfo::RadioTechToPhoneType(RadioTech csRadioTech, const RadioTech &psRadioTech) const
|
||||
{
|
||||
PhoneType phoneType = PhoneType::PHONE_TYPE_IS_NONE;
|
||||
switch (csRadioTech) {
|
||||
|
@ -465,10 +465,12 @@ void TestInitTimeAndTimeZone()
|
||||
int64_t time = static_cast<int64_t>(retTime);
|
||||
bool result = OHOS::MiscServices::TimeServiceClient::GetInstance()->SetTime(time * MILLI_TO_BASE);
|
||||
std::string ret = result ? "ture" : "false";
|
||||
TELEPHONY_LOGI("TelephonyTestService::TestInitTime ret : %{public}s", ret.c_str());
|
||||
TELEPHONY_LOGI("TelephonyTestService::TestInitTimeAndTimeZone result : %{public}s", ret.c_str());
|
||||
|
||||
std::string timeZoneSet("America/Santiago");
|
||||
result = OHOS::MiscServices::TimeServiceClient::GetInstance()->SetTimeZone(timeZoneSet);
|
||||
ret = result ? "ture" : "false";
|
||||
TELEPHONY_LOGI("TelephonyTestService::TestInitTimeAndTimeZone SetTimeZone result : %{public}d", ret.c_str());
|
||||
|
||||
std::string timeZoneRes = OHOS::MiscServices::TimeServiceClient::GetInstance()->GetTimeZone();
|
||||
std::cout << " timezone:" << timeZoneRes << std::endl;
|
||||
|
@ -78,8 +78,8 @@ private:
|
||||
bool InitShowNumber(int slotId);
|
||||
bool InitActive(int slotId);
|
||||
bool InitIccId(int slotId);
|
||||
int32_t UpdateDataByIccId(int slotId, std::string newIccId);
|
||||
int32_t InsertData(int slotId, std::string newIccId);
|
||||
int32_t UpdateDataByIccId(int slotId, const std::string &newIccId);
|
||||
int32_t InsertData(int slotId, const std::string &newIccId);
|
||||
void SortCache();
|
||||
std::u16string GetIccId(int32_t slotId);
|
||||
bool SetIccId(int32_t slotId, std::u16string iccId);
|
||||
|
@ -58,10 +58,10 @@ public:
|
||||
std::u16string GetOpName();
|
||||
std::u16string GetOpKey();
|
||||
std::u16string GetOpKeyExt();
|
||||
void SetOpName(std::string opName);
|
||||
void SetOpKey(std::string opKey);
|
||||
void SetOpKeyExt(std::string opKeyExt);
|
||||
int ObtainSpnCondition(bool roaming, std::string operatorNum);
|
||||
void SetOpName(const std::string &opName);
|
||||
void SetOpKey(const std::string &opKey);
|
||||
void SetOpKeyExt(const std::string &opKeyExt);
|
||||
int ObtainSpnCondition(bool roaming, const std::string &operatorNum);
|
||||
void RegisterCoreNotify(const std::shared_ptr<AppExecFwk::EventHandler> &handler, int what);
|
||||
void UnRegisterCoreNotify(const std::shared_ptr<AppExecFwk::EventHandler> &observerCallBack, int what);
|
||||
void SetImsi(std::string imsi);
|
||||
|
@ -42,19 +42,19 @@ public:
|
||||
bool HasSimCard(int32_t slotId) override;
|
||||
int32_t GetSimState(int32_t slotId) override;
|
||||
int32_t GetCardType(int32_t slotId) override;
|
||||
bool UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response) override;
|
||||
bool UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response) override;
|
||||
bool UnlockPuk(
|
||||
int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response) override;
|
||||
int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response) override;
|
||||
bool AlterPin(
|
||||
int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response) override;
|
||||
int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response) override;
|
||||
bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response) override;
|
||||
int32_t GetLockState(int32_t slotId, LockType lockType) override;
|
||||
int32_t RefreshSimState(int32_t slotId) override;
|
||||
bool UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response) override;
|
||||
bool UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response) override;
|
||||
bool UnlockPuk2(
|
||||
int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response) override;
|
||||
int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response) override;
|
||||
bool AlterPin2(
|
||||
int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response) override;
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response) override;
|
||||
bool UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response) override;
|
||||
// SimAccount
|
||||
bool IsSimActive(int32_t slotId) override;
|
||||
@ -64,8 +64,8 @@ public:
|
||||
bool SetDefaultSmsSlotId(int32_t slotId) override;
|
||||
bool SetDefaultCellularDataSlotId(int32_t slotId) override;
|
||||
bool SetPrimarySlotId(int32_t slotId) override;
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string number) override;
|
||||
bool SetShowName(int32_t slotId, const std::u16string name) override;
|
||||
bool SetShowNumber(int32_t slotId, const std::u16string &number) override;
|
||||
bool SetShowName(int32_t slotId, const std::u16string &name) override;
|
||||
int32_t GetDefaultVoiceSlotId() override;
|
||||
int32_t GetDefaultSmsSlotId() override;
|
||||
int32_t GetDefaultCellularDataSlotId() override;
|
||||
|
@ -105,17 +105,17 @@ public:
|
||||
CardType GetCardType();
|
||||
bool HasSimCard();
|
||||
void ObtainRealtimeIccStatus(int32_t slotId);
|
||||
void UnlockPin(int32_t slotId, std::string pin);
|
||||
void UnlockPuk(int32_t slotId, std::string newPin, std::string puk);
|
||||
void AlterPin(int32_t slotId, std::string newPin, std::string oldPin);
|
||||
void UnlockPin(int32_t slotId, const std::string &pin);
|
||||
void UnlockPuk(int32_t slotId, const std::string &newPin, const std::string &puk);
|
||||
void AlterPin(int32_t slotId, const std::string &newPin, const std::string &oldPin);
|
||||
void SetLockState(int32_t slotId, const LockInfo &options);
|
||||
void GetLockState(int32_t slotId, LockType lockType);
|
||||
UnlockData GetUnlockData();
|
||||
LockStatusResponse GetSimlockResponse();
|
||||
bool ConnectService();
|
||||
void UnlockPin2(int32_t slotId, std::string pin2);
|
||||
void UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2);
|
||||
void AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2);
|
||||
void UnlockPin2(int32_t slotId, const std::string &pin2);
|
||||
void UnlockPuk2(int32_t slotId, const std::string &newPin2, const std::string &puk2);
|
||||
void AlterPin2(int32_t slotId, const std::string &newPin2, const std::string &oldPin2);
|
||||
void UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo);
|
||||
void SetRilManager(std::shared_ptr<Telephony::ITelRilManager> telRilManager);
|
||||
bool IsIccReady();
|
||||
|
@ -16,16 +16,13 @@
|
||||
#ifndef OHOS_SIM_STATE_MANAGER_H
|
||||
#define OHOS_SIM_STATE_MANAGER_H
|
||||
|
||||
#include "sim_state_type.h"
|
||||
#include "sim_state_handle.h"
|
||||
#include "i_tel_ril_manager.h"
|
||||
#include "sim_state_handle.h"
|
||||
#include "sim_state_type.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
enum SimHandleRun {
|
||||
STATE_NOT_START,
|
||||
STATE_RUNNING
|
||||
};
|
||||
enum SimHandleRun { STATE_NOT_START, STATE_RUNNING };
|
||||
|
||||
class SimStateManager : public std::enable_shared_from_this<SimStateManager> {
|
||||
public:
|
||||
@ -36,25 +33,21 @@ public:
|
||||
bool HasSimCard();
|
||||
SimState GetSimState();
|
||||
CardType GetCardType();
|
||||
bool UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(
|
||||
int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response);
|
||||
bool AlterPin(
|
||||
int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response);
|
||||
bool UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response);
|
||||
bool UnlockPuk(int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response);
|
||||
bool AlterPin(int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response);
|
||||
bool SetLockState(int32_t slotId, const LockInfo &options, LockStatusResponse &response);
|
||||
int32_t GetLockState(int32_t slotId, LockType lockType);
|
||||
int32_t RefreshSimState(int32_t slotId);
|
||||
bool UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(
|
||||
int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response);
|
||||
bool UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response);
|
||||
bool UnlockPuk2(int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response);
|
||||
bool AlterPin2(
|
||||
int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response);
|
||||
bool UnlockSimLock(
|
||||
int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response);
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response);
|
||||
bool UnlockSimLock(int32_t slotId, const PersoLockInfo &lockInfo, LockStatusResponse &response);
|
||||
void RegisterCoreNotify(const HANDLE &handler, int what);
|
||||
void UnRegisterCoreNotify(const HANDLE &observerCallBack, int what);
|
||||
int32_t SimAuthentication(int32_t slotId, const std::string &aid, const std::string &authData,
|
||||
SimAuthenticationResponse &response);
|
||||
int32_t SimAuthentication(
|
||||
int32_t slotId, const std::string &aid, const std::string &authData, SimAuthenticationResponse &response);
|
||||
|
||||
public:
|
||||
static bool responseReady_;
|
||||
|
@ -129,6 +129,7 @@ void IccDiallingNumbersCache::ProcessChangeDiallingNumbersDone(const AppExecFwk:
|
||||
std::shared_ptr<HRilRadioResponseInfo> responseInfo =
|
||||
std::static_pointer_cast<HRilRadioResponseInfo>(fd->exception);
|
||||
if (responseInfo == nullptr) {
|
||||
TELEPHONY_LOGE("responseInfo is nullptr");
|
||||
return;
|
||||
}
|
||||
if (responseInfo->error == HRilErrType::NONE) {
|
||||
@ -217,7 +218,7 @@ bool IccDiallingNumbersCache::CheckValueAndOperation(
|
||||
auto iter = diallingNumberFileList_.find(fileId);
|
||||
if (iter != diallingNumberFileList_.end()) {
|
||||
std::shared_ptr<std::vector<std::shared_ptr<DiallingNumbersInfo>>> &vc = iter->second;
|
||||
int size = (int)vc->size();
|
||||
int size = static_cast<int>(vc->size());
|
||||
if ((index < 1) || (index > size)) { // check index range
|
||||
TELEPHONY_LOGE("error index!!");
|
||||
return false;
|
||||
@ -241,6 +242,9 @@ void IccDiallingNumbersCache::SearchIndexByNameAndNumber(
|
||||
{
|
||||
for (auto it = list->begin(); it != list->end(); it++) {
|
||||
std::shared_ptr<DiallingNumbersInfo> &item = *it;
|
||||
if (item == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (IsDiallingNumberEqual(info, item)) {
|
||||
index = item->GetIndex();
|
||||
TELEPHONY_LOGI("Search index is %{public}d", index);
|
||||
|
@ -145,6 +145,7 @@ void IccDiallingNumbersHandler::ProcessUpdateRecordDone(const AppExecFwk::InnerE
|
||||
{
|
||||
std::unique_ptr<ControllerToFileMsg> object = event->GetUniqueObject<ControllerToFileMsg>();
|
||||
if (object == nullptr) {
|
||||
TELEPHONY_LOGE("object is nullptr!");
|
||||
return;
|
||||
}
|
||||
int loadId = object->arg1;
|
||||
@ -178,6 +179,7 @@ void IccDiallingNumbersHandler::ProcessDiallingNumberAllLoadDone(
|
||||
|
||||
std::shared_ptr<MultiRecordResult> object = event->GetSharedObject<MultiRecordResult>();
|
||||
if (object == nullptr) {
|
||||
TELEPHONY_LOGE("object is nullptr!");
|
||||
return;
|
||||
}
|
||||
loadId = object->arg1;
|
||||
|
@ -199,55 +199,39 @@ std::string IccFile::ObtainSPN()
|
||||
|
||||
std::string IccFile::ObtainEons(const std::string &plmn, int32_t lac, bool longNameRequired)
|
||||
{
|
||||
if (plmn.empty() || pnnFiles_.empty()) {
|
||||
TELEPHONY_LOGE("ObtainEons plmn or pnnFiles is empty");
|
||||
bool roaming = (plmn.compare(operatorNumeric_) == 0 ? false : true);
|
||||
TELEPHONY_LOGI("ObtainEons roaming:%{public}d", roaming);
|
||||
if (plmn.empty() || pnnFiles_.empty() || (oplFiles_.empty() && roaming)) {
|
||||
TELEPHONY_LOGE("ObtainEons is empty");
|
||||
return "";
|
||||
}
|
||||
int pnnIndex = -1;
|
||||
bool isHPLMN = (plmn.compare(operatorNumeric_) == 0 ? true : false);
|
||||
TELEPHONY_LOGI("ObtainEons isHPLMN:%{public}d", isHPLMN);
|
||||
if (oplFiles_.empty()) {
|
||||
TELEPHONY_LOGI("ObtainEons oplFiles is empty");
|
||||
if (isHPLMN) {
|
||||
pnnIndex = 1;
|
||||
} else {
|
||||
return "";
|
||||
int pnnIndex = 1;
|
||||
for (std::shared_ptr<OperatorPlmnInfo> opl : oplFiles_) {
|
||||
if (opl == nullptr) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
for (std::shared_ptr<OperatorPlmnInfo> opl : oplFiles_) {
|
||||
TELEPHONY_LOGI("ObtainEons plmn:%{public}s, opl->plmnNumeric:%{public}s, lac:%{public}d, "
|
||||
"opl->lacStart:%{public}d, opl->lacEnd:%{public}d, opl->pnnRecordId:%{public}d",
|
||||
plmn.c_str(), opl->plmnNumeric.c_str(), lac, opl->lacStart, opl->lacEnd, opl->pnnRecordId);
|
||||
if (plmn.compare(opl->plmnNumeric) == 0 &&
|
||||
((opl->lacStart == 0 && opl->lacEnd == 0xfffe) || (opl->lacStart <= lac && opl->lacEnd >= lac))) {
|
||||
if (opl->pnnRecordId == 0) {
|
||||
return "";
|
||||
}
|
||||
pnnIndex = opl->pnnRecordId;
|
||||
break;
|
||||
}
|
||||
pnnIndex = -1;
|
||||
TELEPHONY_LOGI(
|
||||
"ObtainEons plmn:%{public}s, opl->plmnNumeric:%{public}s, lac:%{public}d, "
|
||||
"opl->lacStart:%{public}d, opl->lacEnd:%{public}d, opl->pnnRecordId:%{public}d",
|
||||
plmn.c_str(), opl->plmnNumeric.c_str(), lac, opl->lacStart, opl->lacEnd, opl->pnnRecordId);
|
||||
if (plmn.compare(opl->plmnNumeric) == 0 &&
|
||||
((opl->lacStart == 0 && opl->lacEnd == 0xfffe) || (opl->lacStart <= lac && opl->lacEnd >= lac))) {
|
||||
pnnIndex = opl->pnnRecordId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::string eons = "";
|
||||
if (pnnIndex >= 1 && pnnIndex <= (int)pnnFiles_.size()) {
|
||||
if (pnnIndex >= 1 && pnnIndex <= static_cast<int>(pnnFiles_.size())) {
|
||||
TELEPHONY_LOGI("ObtainEons longNameRequired:%{public}d, longName:%{public}s, shortName:%{public}s,",
|
||||
longNameRequired, pnnFiles_.at(pnnIndex - 1)->longName.c_str(),
|
||||
pnnFiles_.at(pnnIndex - 1)->shortName.c_str());
|
||||
if (longNameRequired) {
|
||||
eons = pnnFiles_.at(pnnIndex - 1)->longName;
|
||||
if (eons.empty()) {
|
||||
eons = pnnFiles_.at(pnnIndex - 1)->shortName;
|
||||
}
|
||||
} else {
|
||||
eons = pnnFiles_.at(pnnIndex - 1)->shortName;
|
||||
if (eons.empty()) {
|
||||
eons = pnnFiles_.at(pnnIndex - 1)->longName;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (eons.empty() && !spn_.empty() && isHPLMN) {
|
||||
eons = spn_;
|
||||
}
|
||||
return eons;
|
||||
}
|
||||
|
||||
|
@ -472,7 +472,7 @@ void IccFileController::SendMultiRecordResult(
|
||||
std::unique_ptr<FileToControllerMsg> cmdData = response->GetUniqueObject<FileToControllerMsg>();
|
||||
std::shared_ptr<MultiRecordResult> object = std::make_shared<MultiRecordResult>(cmdData.get());
|
||||
object->fileResults.assign(strValue.begin(), strValue.end());
|
||||
object->resultLength = (int)strValue.size();
|
||||
object->resultLength = static_cast<int>(strValue.size());
|
||||
uint32_t id = response->GetInnerEventId();
|
||||
int eventParam = 0;
|
||||
TELEPHONY_LOGI("IccFileController::SendMultiRecordResult send end");
|
||||
@ -564,6 +564,7 @@ bool IccFileController::IsValidSizeData(const unsigned char *data)
|
||||
void IccFileController::GetFileAndDataSize(const unsigned char *data, int &fileSize, int &dataSize)
|
||||
{
|
||||
if (data == nullptr) {
|
||||
TELEPHONY_LOGE("GetFileAndDataSize null data");
|
||||
return;
|
||||
}
|
||||
fileSize = data[LENGTH_OF_RECORD] & BYTE_NUM;
|
||||
|
@ -26,7 +26,7 @@ MccAccess MccPool::AccessToMcc(int mcc)
|
||||
MccAccess m(mcc, "", 0);
|
||||
InitMccTables();
|
||||
int index = std::find(mccAccessTable_.begin(), mccAccessTable_.end(), m) - mccAccessTable_.begin();
|
||||
int len = (int)mccAccessTable_.size();
|
||||
int len = static_cast<int>(mccAccessTable_.size());
|
||||
if (index >= len) {
|
||||
return MccAccess(0, "", 0);
|
||||
} else {
|
||||
|
@ -185,7 +185,7 @@ bool MultiSimController::InitIccId(int slotId)
|
||||
}
|
||||
}
|
||||
|
||||
int32_t MultiSimController::UpdateDataByIccId(int slotId, std::string newIccId)
|
||||
int32_t MultiSimController::UpdateDataByIccId(int slotId, const std::string &newIccId)
|
||||
{
|
||||
if (simDbHelper_ == nullptr) {
|
||||
TELEPHONY_LOGE("MultiSimController::UpdateDataByIccId failed by nullptr");
|
||||
@ -205,7 +205,7 @@ int32_t MultiSimController::UpdateDataByIccId(int slotId, std::string newIccId)
|
||||
return simDbHelper_->UpdateDataByIccId(newIccId, values); // finish re active
|
||||
}
|
||||
|
||||
int32_t MultiSimController::InsertData(int slotId, std::string newIccId)
|
||||
int32_t MultiSimController::InsertData(int slotId, const std::string &newIccId)
|
||||
{
|
||||
if (simDbHelper_ == nullptr) {
|
||||
TELEPHONY_LOGE("MultiSimController::InsertData failed by nullptr");
|
||||
@ -294,7 +294,7 @@ bool MultiSimController::GetListFromDataBase()
|
||||
void MultiSimController::SortCache()
|
||||
{
|
||||
size_t count = localCacheInfo_.size();
|
||||
TELEPHONY_LOGI("MultiSimController::SortCache count = %{public}lu", (unsigned long)count);
|
||||
TELEPHONY_LOGI("MultiSimController::SortCache count = %{public}lu", static_cast<unsigned long>(count));
|
||||
if (count <= 0) {
|
||||
TELEPHONY_LOGE("MultiSimController::Sort empty");
|
||||
return;
|
||||
@ -308,8 +308,8 @@ void MultiSimController::SortCache()
|
||||
sortCache.emplace_back(emptyUnit);
|
||||
}
|
||||
for (size_t j = 0; j < count; j++) {
|
||||
TELEPHONY_LOGI(
|
||||
"MultiSimController::index = %{public}d j = %{public}lu", localCacheInfo_[j].slotIndex, (unsigned long)j);
|
||||
TELEPHONY_LOGI("MultiSimController::index = %{public}d j = %{public}lu", localCacheInfo_[j].slotIndex,
|
||||
static_cast<unsigned long>(j));
|
||||
sortCache[localCacheInfo_[j].slotIndex] = localCacheInfo_[j];
|
||||
}
|
||||
localCacheInfo_ = sortCache;
|
||||
@ -377,7 +377,7 @@ bool MultiSimController::IsSimActive(int32_t slotId)
|
||||
TELEPHONY_LOGE("MultiSimController::IsSimActive InValidData");
|
||||
return false;
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::IsSimActive failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -387,7 +387,7 @@ bool MultiSimController::IsSimActive(int32_t slotId)
|
||||
bool MultiSimController::IsSimActivatable(int32_t slotId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::IsSimActivatable failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -401,7 +401,7 @@ bool MultiSimController::SetActiveSim(int32_t slotId, int32_t enable, bool force
|
||||
return false;
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size() && enable != ACTIVE) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size() && enable != ACTIVE) {
|
||||
TELEPHONY_LOGE("MultiSimController::SetActiveSim failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -458,7 +458,7 @@ bool MultiSimController::GetSimAccountInfo(int32_t slotId, IccAccountInfo &info)
|
||||
TELEPHONY_LOGE("MultiSimController::GetSimAccountInfo InValidData");
|
||||
return false;
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::GetSimAccountInfo failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -648,7 +648,7 @@ int32_t MultiSimController::GetPrimarySlotId()
|
||||
bool MultiSimController::SetPrimarySlotId(int32_t slotId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::SetPrimarySlotId failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -687,7 +687,7 @@ std::u16string MultiSimController::GetShowNumber(int32_t slotId)
|
||||
TELEPHONY_LOGE("MultiSimController::GetShowNumber InValidData");
|
||||
return u"";
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::GetShowNumber failed by nullptr");
|
||||
return u"";
|
||||
}
|
||||
@ -705,7 +705,7 @@ bool MultiSimController::SetShowNumber(int32_t slotId, std::u16string number, bo
|
||||
TELEPHONY_LOGE("MultiSimController::SetShowNumber InValidData");
|
||||
return false;
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::SetShowNumber failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -731,7 +731,7 @@ std::u16string MultiSimController::GetShowName(int32_t slotId)
|
||||
TELEPHONY_LOGE("MultiSimController::GetShowNumber InValidData");
|
||||
return u"";
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::GetShowName failed by nullptr");
|
||||
return u"";
|
||||
}
|
||||
@ -749,7 +749,7 @@ bool MultiSimController::SetShowName(int32_t slotId, std::u16string name, bool f
|
||||
TELEPHONY_LOGE("MultiSimController::SetShowNumber InValidData");
|
||||
return false;
|
||||
}
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::SetShowName failed by out of range");
|
||||
return false;
|
||||
}
|
||||
@ -771,7 +771,7 @@ bool MultiSimController::SetShowName(int32_t slotId, std::u16string name, bool f
|
||||
std::u16string MultiSimController::GetIccId(int32_t slotId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::GetIccId failed by nullptr");
|
||||
return u"";
|
||||
}
|
||||
@ -781,7 +781,7 @@ std::u16string MultiSimController::GetIccId(int32_t slotId)
|
||||
bool MultiSimController::SetIccId(int32_t slotId, std::u16string iccId)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
if ((uint32_t)slotId >= localCacheInfo_.size()) {
|
||||
if (static_cast<uint32_t>(slotId) >= localCacheInfo_.size()) {
|
||||
TELEPHONY_LOGE("MultiSimController::SetIccId failed by out of range");
|
||||
return false;
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ PlmnFile::PlmnFile(unsigned char *bytes, int offset)
|
||||
{
|
||||
this->plmn_ = SIMUtils::BcdPlmnConvertToString("", offset);
|
||||
const char *plmnData = reinterpret_cast<const char *>(bytes);
|
||||
uint32_t aValue = (uint32_t)atoi(plmnData + offset + OFFSET_A);
|
||||
uint32_t bValue = (uint32_t)atoi(plmnData + offset + OFFSET_B);
|
||||
uint32_t aValue = static_cast<uint32_t>(atoi(plmnData + offset + OFFSET_A));
|
||||
uint32_t bValue = static_cast<uint32_t>(atoi(plmnData + offset + OFFSET_B));
|
||||
this->rat_ = (aValue << OFFSET_ALL) | bValue;
|
||||
}
|
||||
|
||||
|
@ -273,10 +273,10 @@ bool RuimFile::ProcessGetSpnDone(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
int dataLen = 0;
|
||||
std::shared_ptr<unsigned char> fileData = SIMUtils::HexStringConvertToBytes(iccData, dataLen);
|
||||
unsigned char* data = fileData.get();
|
||||
displayConditionOfCsimSpn_ = (((unsigned int)SPN_FLAG & (unsigned int)data[0]) != 0);
|
||||
displayConditionOfCsimSpn_ = ((static_cast<unsigned int>(SPN_FLAG) & static_cast<unsigned int>(data[0])) != 0);
|
||||
|
||||
int encoding = (int)data[ENCODING_POS];
|
||||
int language = (int)data[LANG_POS];
|
||||
int encoding = static_cast<int>(data[ENCODING_POS]);
|
||||
int language = static_cast<int>(data[LANG_POS]);
|
||||
unsigned char spnData[BUFFER_SIZE] = {0};
|
||||
|
||||
int len = ((dataLen - FLAG_NUM) < MAX_DATA_BYTE) ? (dataLen - FLAG_NUM) : MAX_DATA_BYTE;
|
||||
|
@ -57,7 +57,7 @@ std::string SimFile::ObtainSimOperator()
|
||||
return "";
|
||||
}
|
||||
int length = MCC_LEN + lengthOfMnc_;
|
||||
int imsiLen = (int)imsi.size();
|
||||
int imsiLen = static_cast<int>(imsi.size());
|
||||
operatorNumeric_ = ((imsiLen >= length) ? imsi.substr(0, MCC_LEN + lengthOfMnc_) : "");
|
||||
}
|
||||
return operatorNumeric_;
|
||||
@ -70,7 +70,7 @@ std::string SimFile::ObtainIsoCountryCode()
|
||||
TELEPHONY_LOGE("SimFile ObtainIsoCountryCode: numeric is null");
|
||||
return "";
|
||||
}
|
||||
int len = (int)numeric.length();
|
||||
int len = static_cast<int>(numeric.length());
|
||||
std::string mcc = numeric.substr(0, MCC_LEN);
|
||||
if (len >= MCC_LEN && IsValidDecValue(mcc)) {
|
||||
std::string iso = MccPool::MccCountryCode(std::stoi(mcc));
|
||||
@ -392,14 +392,15 @@ void SimFile::ParsePnn(const std::vector<std::string> &records)
|
||||
std::shared_ptr<PlmnNetworkName> file = std::make_shared<PlmnNetworkName>();
|
||||
int tagAndLength = NETWORK_NAME_LENGTH + 1;
|
||||
if (recordLen > tagAndLength) {
|
||||
if (recordLen >= (tagAndLength + (int)tlv[NETWORK_NAME_LENGTH]) &&
|
||||
if (recordLen >= (tagAndLength + static_cast<int>(tlv[NETWORK_NAME_LENGTH])) &&
|
||||
tlv[NETWORK_NAME_IEI] == (unsigned char)LONG_NAME_FLAG) {
|
||||
file->longName =
|
||||
SIMUtils::Gsm7bitConvertToString(tlv + NETWORK_NAME_TEXT_STRING, tlv[NETWORK_NAME_LENGTH] - 1);
|
||||
}
|
||||
int shortNameOffset = tagAndLength + tlv[NETWORK_NAME_LENGTH];
|
||||
if (recordLen > (shortNameOffset + tagAndLength)) {
|
||||
if (recordLen >= (shortNameOffset + tagAndLength + (int)tlv[shortNameOffset + NETWORK_NAME_LENGTH]) &&
|
||||
if (recordLen >= (shortNameOffset + tagAndLength +
|
||||
static_cast<int>(tlv[shortNameOffset + NETWORK_NAME_LENGTH])) &&
|
||||
tlv[shortNameOffset + NETWORK_NAME_IEI] == (unsigned char)SHORT_NAME_FLAG) {
|
||||
file->shortName =
|
||||
SIMUtils::Gsm7bitConvertToString(tlv + (shortNameOffset + NETWORK_NAME_TEXT_STRING),
|
||||
@ -779,7 +780,7 @@ bool SimFile::ProcessGetAdDone(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
doneData = false;
|
||||
}
|
||||
TELEPHONY_LOGI("SimFile ELEMENTARY_FILE_AD: %{public}s", rawData);
|
||||
int dataSize = (int)iccData.size();
|
||||
int dataSize = static_cast<int>(iccData.size());
|
||||
if (dataSize <= MCC_LEN) {
|
||||
TELEPHONY_LOGI("SimFile MNC length dataSize = %{public}d", dataSize);
|
||||
doneData = false;
|
||||
@ -803,7 +804,7 @@ bool SimFile::ProcessGetAdDone(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
void SimFile::CheckMncLength()
|
||||
{
|
||||
std::string imsi = ObtainIMSI();
|
||||
int imsiSize = (int)imsi.size();
|
||||
int imsiSize = static_cast<int>(imsi.size());
|
||||
if (((lengthOfMnc_ == UNINITIALIZED_MNC) || (lengthOfMnc_ == UNKNOWN_MNC) || (lengthOfMnc_ == MNC_LEN)) &&
|
||||
((!imsi.empty()) && (imsiSize >= MCCMNC_LEN))) {
|
||||
std::string mccMncCode = imsi.substr(0, MCCMNC_LEN);
|
||||
@ -826,7 +827,7 @@ void SimFile::CheckMncLength()
|
||||
}
|
||||
}
|
||||
int lenNum = MCC_LEN + lengthOfMnc_;
|
||||
int sz = (int)imsi.size();
|
||||
int sz = static_cast<int>(imsi.size());
|
||||
bool cond = sz >= lenNum;
|
||||
if ((!imsi.empty()) && (lengthOfMnc_ != UNKNOWN_MNC) && cond) {
|
||||
operatorNumeric_ = imsi.substr(0, lenNum);
|
||||
@ -1202,13 +1203,14 @@ int SimFile::ObtainSpnCondition(bool roaming, const std::string &operatorNum)
|
||||
}
|
||||
if (roaming) {
|
||||
cond = SPN_CONDITION_DISPLAY_PLMN;
|
||||
if (((unsigned int)(displayConditionOfSpn_) & (unsigned int)(SPN_COND)) == 0) {
|
||||
cond |= (unsigned int)SPN_CONDITION_DISPLAY_SPN;
|
||||
if ((static_cast<unsigned int>(displayConditionOfSpn_) & static_cast<unsigned int>(SPN_COND)) == 0) {
|
||||
cond |= static_cast<unsigned int>(SPN_CONDITION_DISPLAY_SPN);
|
||||
}
|
||||
} else {
|
||||
cond = SPN_CONDITION_DISPLAY_SPN;
|
||||
if (((unsigned int)(displayConditionOfSpn_) & (unsigned int)(SPN_COND_PLMN)) == SPN_COND_PLMN) {
|
||||
cond |= (unsigned int)SPN_CONDITION_DISPLAY_PLMN;
|
||||
if ((static_cast<unsigned int>(displayConditionOfSpn_) & static_cast<unsigned int>(SPN_COND_PLMN)) ==
|
||||
SPN_COND_PLMN) {
|
||||
cond |= static_cast<unsigned int>(SPN_CONDITION_DISPLAY_PLMN);
|
||||
}
|
||||
}
|
||||
return cond;
|
||||
|
@ -331,22 +331,22 @@ std::u16string SimFileManager::GetOpKeyExt()
|
||||
return Str8ToStr16(opKeyExt_);
|
||||
}
|
||||
|
||||
void SimFileManager::SetOpName(std::string opName)
|
||||
void SimFileManager::SetOpName(const std::string &opName)
|
||||
{
|
||||
opName_ = opName;
|
||||
}
|
||||
|
||||
void SimFileManager::SetOpKey(std::string opKey)
|
||||
void SimFileManager::SetOpKey(const std::string &opKey)
|
||||
{
|
||||
opKey_ = opKey;
|
||||
}
|
||||
|
||||
void SimFileManager::SetOpKeyExt(std::string opKeyExt)
|
||||
void SimFileManager::SetOpKeyExt(const std::string &opKeyExt)
|
||||
{
|
||||
opKeyExt_ = opKeyExt;
|
||||
}
|
||||
|
||||
int SimFileManager::ObtainSpnCondition(bool roaming, std::string operatorNum)
|
||||
int SimFileManager::ObtainSpnCondition(bool roaming, const std::string &operatorNum)
|
||||
{
|
||||
if (simFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("SimFileManager::ObtainSpnCondition simFile nullptr");
|
||||
|
@ -168,7 +168,7 @@ int32_t SimManager::GetCardType(int32_t slotId)
|
||||
return static_cast<int32_t>(simStateManager_[slotId]->GetCardType());
|
||||
}
|
||||
|
||||
bool SimManager::UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response)
|
||||
bool SimManager::UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -177,7 +177,8 @@ bool SimManager::UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &
|
||||
return simStateManager_[slotId]->UnlockPin(slotId, pin, response);
|
||||
}
|
||||
|
||||
bool SimManager::UnlockPuk(int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response)
|
||||
bool SimManager::UnlockPuk(
|
||||
int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -186,7 +187,8 @@ bool SimManager::UnlockPuk(int32_t slotId, std::string newPin, std::string puk,
|
||||
return simStateManager_[slotId]->UnlockPuk(slotId, newPin, puk, response);
|
||||
}
|
||||
|
||||
bool SimManager::AlterPin(int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response)
|
||||
bool SimManager::AlterPin(
|
||||
int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -222,7 +224,7 @@ int32_t SimManager::RefreshSimState(int32_t slotId)
|
||||
return simStateManager_[slotId]->RefreshSimState(slotId);
|
||||
}
|
||||
|
||||
bool SimManager::UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response)
|
||||
bool SimManager::UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -231,7 +233,8 @@ bool SimManager::UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse
|
||||
return simStateManager_[slotId]->UnlockPin2(slotId, pin2, response);
|
||||
}
|
||||
|
||||
bool SimManager::UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response)
|
||||
bool SimManager::UnlockPuk2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -240,7 +243,8 @@ bool SimManager::UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk
|
||||
return simStateManager_[slotId]->UnlockPuk2(slotId, newPin2, puk2, response);
|
||||
}
|
||||
|
||||
bool SimManager::AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response)
|
||||
bool SimManager::AlterPin2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (simStateManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simStateManager is null!");
|
||||
@ -337,7 +341,7 @@ bool SimManager::SetPrimarySlotId(int32_t slotId)
|
||||
return multiSimController_->SetPrimarySlotId(slotId);
|
||||
}
|
||||
|
||||
bool SimManager::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
bool SimManager::SetShowNumber(int32_t slotId, const std::u16string &number)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (multiSimController_ == nullptr)) {
|
||||
TELEPHONY_LOGE("slotId is invalid or multiSimController_ is nullptr");
|
||||
@ -346,7 +350,7 @@ bool SimManager::SetShowNumber(int32_t slotId, const std::u16string number)
|
||||
return multiSimController_->SetShowNumber(slotId, number);
|
||||
}
|
||||
|
||||
bool SimManager::SetShowName(int32_t slotId, const std::u16string name)
|
||||
bool SimManager::SetShowName(int32_t slotId, const std::u16string &name)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId)) || (multiSimController_ == nullptr)) {
|
||||
TELEPHONY_LOGE("slotId is invalid or multiSimController_ is nullptr");
|
||||
|
@ -91,7 +91,7 @@ CardType SimStateHandle::GetCardType()
|
||||
return externalType_;
|
||||
}
|
||||
|
||||
void SimStateHandle::UnlockPin(int32_t slotId, std::string pin)
|
||||
void SimStateHandle::UnlockPin(int32_t slotId, const std::string &pin)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::UnlockPin1() slotId = %{public}d", slotId);
|
||||
auto event = AppExecFwk::InnerEvent::Get(MSG_SIM_UNLOCK_PIN_DONE);
|
||||
@ -99,7 +99,7 @@ void SimStateHandle::UnlockPin(int32_t slotId, std::string pin)
|
||||
telRilManager_->UnlockPin(slotId, pin, event);
|
||||
}
|
||||
|
||||
void SimStateHandle::UnlockPuk(int32_t slotId, std::string newPin, std::string puk)
|
||||
void SimStateHandle::UnlockPuk(int32_t slotId, const std::string &newPin, const std::string &puk)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::UnlockPuk1() slotId = %{public}d", slotId);
|
||||
auto event = AppExecFwk::InnerEvent::Get(MSG_SIM_UNLOCK_PUK_DONE);
|
||||
@ -107,7 +107,7 @@ void SimStateHandle::UnlockPuk(int32_t slotId, std::string newPin, std::string p
|
||||
telRilManager_->UnlockPuk(slotId, puk, newPin, event);
|
||||
}
|
||||
|
||||
void SimStateHandle::AlterPin(int32_t slotId, std::string newPin, std::string oldPin)
|
||||
void SimStateHandle::AlterPin(int32_t slotId, const std::string &newPin, const std::string &oldPin)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::AlterPin() slotId = %{public}d", slotId);
|
||||
int32_t length = (int32_t)newPin.size();
|
||||
@ -121,7 +121,7 @@ void SimStateHandle::AlterPin(int32_t slotId, std::string newPin, std::string ol
|
||||
telRilManager_->ChangeSimPassword(slotId, simPinPassword, event);
|
||||
}
|
||||
|
||||
void SimStateHandle::UnlockPin2(int32_t slotId, std::string pin2)
|
||||
void SimStateHandle::UnlockPin2(int32_t slotId, const std::string &pin2)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::UnlockPin2() slotId = %{public}d", slotId);
|
||||
auto event = AppExecFwk::InnerEvent::Get(MSG_SIM_UNLOCK_PIN2_DONE);
|
||||
@ -129,7 +129,7 @@ void SimStateHandle::UnlockPin2(int32_t slotId, std::string pin2)
|
||||
telRilManager_->UnlockPin2(slotId, pin2, event);
|
||||
}
|
||||
|
||||
void SimStateHandle::UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2)
|
||||
void SimStateHandle::UnlockPuk2(int32_t slotId, const std::string &newPin2, const std::string &puk2)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::UnlockPuk2() slotId = %{public}d", slotId);
|
||||
auto event = AppExecFwk::InnerEvent::Get(MSG_SIM_UNLOCK_PUK2_DONE);
|
||||
@ -137,7 +137,7 @@ void SimStateHandle::UnlockPuk2(int32_t slotId, std::string newPin2, std::string
|
||||
telRilManager_->UnlockPuk2(slotId, puk2, newPin2, event);
|
||||
}
|
||||
|
||||
void SimStateHandle::AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2)
|
||||
void SimStateHandle::AlterPin2(int32_t slotId, const std::string &newPin2, const std::string &oldPin2)
|
||||
{
|
||||
TELEPHONY_LOGI("SimStateHandle::AlterPin2() slotId = %{public}d", slotId);
|
||||
int32_t length = (int32_t)newPin2.size();
|
||||
|
@ -103,7 +103,7 @@ CardType SimStateManager::GetCardType()
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SimStateManager::UnlockPin(int32_t slotId, std::string pin, LockStatusResponse &response)
|
||||
bool SimStateManager::UnlockPin(int32_t slotId, const std::string &pin, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
@ -132,7 +132,8 @@ bool SimStateManager::UnlockPin(int32_t slotId, std::string pin, LockStatusRespo
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimStateManager::UnlockPuk(int32_t slotId, std::string newPin, std::string puk, LockStatusResponse &response)
|
||||
bool SimStateManager::UnlockPuk(
|
||||
int32_t slotId, const std::string &newPin, const std::string &puk, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
@ -161,7 +162,8 @@ bool SimStateManager::UnlockPuk(int32_t slotId, std::string newPin, std::string
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimStateManager::AlterPin(int32_t slotId, std::string newPin, std::string oldPin, LockStatusResponse &response)
|
||||
bool SimStateManager::AlterPin(
|
||||
int32_t slotId, const std::string &newPin, const std::string &oldPin, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
@ -255,7 +257,7 @@ int32_t SimStateManager::GetLockState(int32_t slotId, LockType lockType)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool SimStateManager::UnlockPin2(int32_t slotId, std::string pin2, LockStatusResponse &response)
|
||||
bool SimStateManager::UnlockPin2(int32_t slotId, const std::string &pin2, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
@ -284,7 +286,8 @@ bool SimStateManager::UnlockPin2(int32_t slotId, std::string pin2, LockStatusRes
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimStateManager::UnlockPuk2(int32_t slotId, std::string newPin2, std::string puk2, LockStatusResponse &response)
|
||||
bool SimStateManager::UnlockPuk2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &puk2, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
@ -313,7 +316,8 @@ bool SimStateManager::UnlockPuk2(int32_t slotId, std::string newPin2, std::strin
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SimStateManager::AlterPin2(int32_t slotId, std::string newPin2, std::string oldPin2, LockStatusResponse &response)
|
||||
bool SimStateManager::AlterPin2(
|
||||
int32_t slotId, const std::string &newPin2, const std::string &oldPin2, LockStatusResponse &response)
|
||||
{
|
||||
int32_t ret = UNLOCK_OK;
|
||||
if (simStateHandle_ != nullptr) {
|
||||
|
@ -37,7 +37,7 @@ std::shared_ptr<unsigned char> SIMUtils::HexStringConvertToBytes(const std::stri
|
||||
return nullptr;
|
||||
}
|
||||
int id = 0;
|
||||
int sz = (int)s.length();
|
||||
int sz = static_cast<int>(s.length());
|
||||
if (sz % HALF_LEN != 0) {
|
||||
return nullptr;
|
||||
}
|
||||
@ -55,8 +55,7 @@ std::shared_ptr<unsigned char> SIMUtils::HexStringConvertToBytes(const std::stri
|
||||
unsigned char *ret = ptr.get();
|
||||
for (int i = 0; i < sz; i += HALF_LEN) {
|
||||
id = i / HALF_LEN;
|
||||
ret[id] =
|
||||
(unsigned char)((HexCharConvertToInt(s.at(i)) << HALF_BYTE_LEN) | HexCharConvertToInt(s.at(i + 1)));
|
||||
ret[id] = (unsigned char)((HexCharConvertToInt(s.at(i)) << HALF_BYTE_LEN) | HexCharConvertToInt(s.at(i + 1)));
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
@ -95,7 +94,7 @@ bool SIMUtils::IsShowableAscii(char c)
|
||||
|
||||
bool SIMUtils::IsShowableAsciiOnly(const std::string &str)
|
||||
{
|
||||
int len = (int)str.length();
|
||||
int len = static_cast<int>(str.length());
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (!IsShowableAscii(str.at(i))) {
|
||||
return false;
|
||||
@ -144,7 +143,7 @@ std::shared_ptr<char16_t> SIMUtils::CharsConvertToChar16(
|
||||
std::string SIMUtils::BcdPlmnConvertToString(const std::string &data, int offset)
|
||||
{
|
||||
std::string plmn = "";
|
||||
if ((int)data.size() >= (offset + MCCMNC_LEN) && data.at(offset) != 'F') {
|
||||
if (static_cast<int>(data.size()) >= (offset + MCCMNC_LEN) && data.at(offset) != 'F') {
|
||||
plmn.push_back(data[offset + BCD_PLMN_MCC1]);
|
||||
plmn.push_back(data[offset + BCD_PLMN_MCC2]);
|
||||
plmn.push_back(data[offset + BCD_PLMN_MCC3]);
|
||||
@ -164,7 +163,8 @@ std::string SIMUtils::Gsm7bitConvertToString(const unsigned char *bytes, int byt
|
||||
int n = 0;
|
||||
int pos = 0;
|
||||
int left = 0;
|
||||
uint8_t high, low;
|
||||
uint8_t high = 0;
|
||||
uint8_t low = 0;
|
||||
left = BYTE_LENGTH;
|
||||
n = (byteLen * BYTE_LENGTH) / CHAR_GSM_7BIT;
|
||||
TELEPHONY_LOGI("Gsm7bitConvertToString byteLen:%{public}d", byteLen);
|
||||
@ -177,8 +177,7 @@ std::string SIMUtils::Gsm7bitConvertToString(const unsigned char *bytes, int byt
|
||||
left = BYTE_LENGTH;
|
||||
pos++;
|
||||
} else {
|
||||
low = high = 0;
|
||||
low = (bytes[pos] & (unsigned char)(0xFF << (BYTE_LENGTH - left))) >> (BYTE_LENGTH -left);
|
||||
low = (bytes[pos] & (unsigned char)(0xFF << (BYTE_LENGTH - left))) >> (BYTE_LENGTH - left);
|
||||
high = (bytes[pos + 1] & (unsigned char)(~(0xFF << (CHAR_GSM_7BIT - left)))) << left;
|
||||
str.push_back(high | low);
|
||||
left = BYTE_LENGTH - (CHAR_GSM_7BIT - left);
|
||||
@ -204,7 +203,7 @@ std::string SIMUtils::DiallingNumberStringFieldConvertToString(
|
||||
std::shared_ptr<char16_t> cs = CharsConvertToChar16(data + 1, ucslen * HALF_LEN, outlen, true);
|
||||
std::u16string hs(cs.get(), 0, outlen);
|
||||
if (!hs.empty()) {
|
||||
ucslen = (int)hs.length();
|
||||
ucslen = static_cast<int>(hs.length());
|
||||
wchar_t c = L'\uFFFF';
|
||||
while (ucslen > 0 && hs.at(ucslen - 1) == c) {
|
||||
ucslen--;
|
||||
@ -233,8 +232,7 @@ std::string SIMUtils::DiallingNumberStringFieldConvertToString(
|
||||
return UcsCodeConvertToString(array, offset, length, offPos);
|
||||
}
|
||||
|
||||
std::string SIMUtils::UcsCodeConvertToString(
|
||||
std::shared_ptr<unsigned char> array, int offset, int length, int offPos)
|
||||
std::string SIMUtils::UcsCodeConvertToString(std::shared_ptr<unsigned char> array, int offset, int length, int offPos)
|
||||
{
|
||||
bool isucs2 = false;
|
||||
char base = '\0';
|
||||
@ -253,8 +251,7 @@ std::string SIMUtils::UcsCodeConvertToString(
|
||||
if (len > length - END_POS)
|
||||
len = length - END_POS;
|
||||
|
||||
base =
|
||||
(char)(((data[offset + HALF_LEN] & BYTE_VALUE) << BYTE_BIT) | (data[offset + START_POS] & BYTE_VALUE));
|
||||
base = (char)(((data[offset + HALF_LEN] & BYTE_VALUE) << BYTE_BIT) | (data[offset + START_POS] & BYTE_VALUE));
|
||||
offset += END_POS;
|
||||
isucs2 = true;
|
||||
}
|
||||
@ -286,7 +283,7 @@ std::string SIMUtils::UcsCodeConvertToString(
|
||||
return defaultCharset;
|
||||
}
|
||||
|
||||
std::string SIMUtils::Trim(std::string& str)
|
||||
std::string SIMUtils::Trim(std::string &str)
|
||||
{
|
||||
string::size_type pos = str.find_last_not_of(' ');
|
||||
if (pos != string::npos) {
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
const int32_t ICC_CARD_STATE_ABSENT = 0;
|
||||
const int32_t ICC_CARD_STATE_PRESENT = 1;
|
||||
const int32_t WAIT_TIME_SECOND = 2; // Set the timeout for sending the stk command
|
||||
@ -34,6 +35,7 @@ const std::string PARAM_MSG_CMD = "msgCmd";
|
||||
const std::string PARAM_CARD_STATUS = "cardStatus";
|
||||
const std::string PARAM_ALPHA_STRING = "alphaString";
|
||||
const std::string PARAM_REFRESH_RESULT = "refreshResult";
|
||||
} // namespace
|
||||
|
||||
StkController::StkController(const std::shared_ptr<AppExecFwk::EventRunner> &runner,
|
||||
const std::weak_ptr<Telephony::ITelRilManager> &telRilManager,
|
||||
|
@ -38,7 +38,7 @@ TagService::~TagService() {}
|
||||
int TagService::GetTagCode() const
|
||||
{
|
||||
TELEPHONY_LOGI("GetTagCode : %{public}s", tag_.c_str());
|
||||
if (IsValidHexValue(tag_)) {
|
||||
if (!IsValidHexValue(tag_)) {
|
||||
return ERR;
|
||||
}
|
||||
int i = std::stoi(tag_, nullptr, HEX_TYPE);
|
||||
|
@ -27,6 +27,10 @@ UsimDiallingNumbersService::UsimDiallingNumbersService(const std::shared_ptr<App
|
||||
|
||||
void UsimDiallingNumbersService::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
{
|
||||
if (event == nullptr) {
|
||||
TELEPHONY_LOGI("UsimDiallingNumbersService::ProcessEvent event is null");
|
||||
return;
|
||||
}
|
||||
uint32_t id = event->GetInnerEventId();
|
||||
TELEPHONY_LOGI("UsimDiallingNumbersService::ProcessEvent Id is %{public}d", id);
|
||||
std::unique_ptr<ControllerToFileMsg> fd = event->GetUniqueObject<ControllerToFileMsg>();
|
||||
@ -134,7 +138,7 @@ void UsimDiallingNumbersService::LoadPbrFiles()
|
||||
|
||||
bool UsimDiallingNumbersService::LoadDiallingNumberFiles(int recId)
|
||||
{
|
||||
if (recId >= (int)pbrFiles_.size()) {
|
||||
if (recId >= static_cast<int>(pbrFiles_.size())) {
|
||||
TELEPHONY_LOGI("LoadDiallingNumberFiles finish %{public}d", recId);
|
||||
NextStep(MSG_USIM_USIM_ADN_LOAD_DONE);
|
||||
return false;
|
||||
@ -274,7 +278,7 @@ void UsimDiallingNumbersService::StorePbrDetailInfo(
|
||||
efid <<= BIT_OF_BYTE;
|
||||
efid |= *dataIt;
|
||||
++dataIt;
|
||||
int sfi = (dataIt == data.end()) ? 0 : (int)(*dataIt);
|
||||
int sfi = (dataIt == data.end()) ? 0 : static_cast<int>((*dataIt));
|
||||
std::shared_ptr<TagData> deltaFile = std::make_shared<TagData>(parentTag, efid, sfi, count);
|
||||
TELEPHONY_LOGI(
|
||||
"MakeFiles result[ parentTag:%{public}d, efid:%{public}d, sfi:%{public}d, count:%{public}d ]",
|
||||
|
@ -63,7 +63,8 @@ public:
|
||||
int32_t SetMute(const int32_t mute, const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t GetMute(const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t GetEmergencyCallList(const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t SetEmergencyCallList(std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t SetEmergencyCallList(
|
||||
const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t GetCallFailReason(const AppExecFwk::InnerEvent::Pointer &result);
|
||||
int32_t SetBarringPassword(std::string fac, std::string oldPassword,
|
||||
std::string newPassword, const AppExecFwk::InnerEvent::Pointer &result);
|
||||
|
@ -211,12 +211,12 @@ public:
|
||||
int32_t slotId, const SimLockParam &simLock, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t ChangeSimPassword(
|
||||
int32_t slotId, const SimPasswordParam &simPassword, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPin(int32_t slotId, std::string pin, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPuk(
|
||||
int32_t slotId, std::string puk, std::string pin, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPin2(int32_t slotId, std::string pin2, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPuk2(
|
||||
int32_t slotId, std::string puk2, std::string pin2, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPin(int32_t slotId, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPuk(int32_t slotId, const std::string &puk, const std::string &pin,
|
||||
const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPin2(int32_t slotId, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t UnlockPuk2(int32_t slotId, const std::string &puk2, const std::string &pin2,
|
||||
const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t SetActiveSim(
|
||||
int32_t slotId, int32_t index, int32_t enable, const AppExecFwk::InnerEvent::Pointer &result) override;
|
||||
int32_t SendTerminalResponseCmd(
|
||||
@ -248,19 +248,19 @@ public:
|
||||
int32_t SetMute(int32_t slotId, const int32_t mute, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t GetMute(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t GetEmergencyCallList(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SetEmergencyCallList(
|
||||
int32_t slotId, std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SetEmergencyCallList(int32_t slotId, const std::vector<EmergencyCall> &eccVec,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t GetCallFailReason(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimOpenLogicalChannel(int32_t slotId, const std::string &appID, const int32_t p2,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimCloseLogicalChannel(
|
||||
int32_t slotId, const int32_t channelId, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimTransmitApduLogicalChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimTransmitApduBasicChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimAuthentication(
|
||||
int32_t slotId, SimAuthenticationRequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
int32_t SimAuthentication(int32_t slotId, const SimAuthenticationRequestInfo &reqInfo,
|
||||
const AppExecFwk::InnerEvent::Pointer &response) override;
|
||||
|
||||
/**
|
||||
* Register hdf status listener
|
||||
@ -315,7 +315,7 @@ private:
|
||||
*/
|
||||
template<typename ResponsePtr, typename ClassTypePtr, typename FuncType, typename... ParamTypes>
|
||||
inline int32_t TaskSchedule(ResponsePtr &_result, const std::string _module, ClassTypePtr &_obj, FuncType &&_func,
|
||||
ParamTypes &&..._args) const
|
||||
ParamTypes &&... _args) const
|
||||
{
|
||||
if (_func != nullptr) {
|
||||
// The reason for using native member function access here is to
|
||||
|
@ -58,12 +58,12 @@ public:
|
||||
int32_t SetRadioProtocol(RadioProtocol radioProtocol, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimOpenLogicalChannel(std::string appID, int32_t p2, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimCloseLogicalChannel(int32_t channelId, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimTransmitApduLogicalChannel(ApduSimIORequestInfo reqInfo,
|
||||
const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimTransmitApduBasicChannel(ApduSimIORequestInfo reqInfo,
|
||||
const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimAuthentication(SimAuthenticationRequestInfo reqInfo,
|
||||
const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimTransmitApduLogicalChannel(
|
||||
const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimTransmitApduBasicChannel(
|
||||
const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t SimAuthentication(
|
||||
const SimAuthenticationRequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
int32_t UnlockSimLock(int32_t lockType, std::string password, const AppExecFwk::InnerEvent::Pointer &response);
|
||||
|
||||
int32_t GetSimStatusResponse(
|
||||
|
@ -441,8 +441,8 @@ int32_t TelRilCall::GetUssd(const AppExecFwk::InnerEvent::Pointer &result)
|
||||
return Request(TELEPHONY_LOG_FUNC_NAME, result, HREQ_CALL_GET_USSD, &HDI::Ril::V1_0::IRil::GetUssd);
|
||||
}
|
||||
|
||||
int32_t TelRilCall::SetBarringPassword(std::string fac, std::string oldPassword,
|
||||
std::string newPassword, const AppExecFwk::InnerEvent::Pointer &result)
|
||||
int32_t TelRilCall::SetBarringPassword(
|
||||
std::string fac, std::string oldPassword, std::string newPassword, const AppExecFwk::InnerEvent::Pointer &result)
|
||||
{
|
||||
HDI::Ril::V1_0::SetBarringInfo setBarringInfo = {};
|
||||
setBarringInfo.fac = fac;
|
||||
@ -466,8 +466,7 @@ int32_t TelRilCall::CallUssdNotice(const HDI::Ril::V1_0::UssdNoticeInfo &ussdNot
|
||||
}
|
||||
ussdNotice->m = ussdNoticeInfo.type;
|
||||
ussdNotice->str = ussdNoticeInfo.message;
|
||||
return Notify<UssdNoticeInfo>(
|
||||
TELEPHONY_LOG_FUNC_NAME, ussdNotice, RadioEvent::RADIO_CALL_USSD_NOTICE);
|
||||
return Notify<UssdNoticeInfo>(TELEPHONY_LOG_FUNC_NAME, ussdNotice, RadioEvent::RADIO_CALL_USSD_NOTICE);
|
||||
}
|
||||
|
||||
int32_t TelRilCall::CallSsNotice(const HDI::Ril::V1_0::SsNoticeInfo &ssNoticeInfo)
|
||||
@ -481,8 +480,7 @@ int32_t TelRilCall::CallSsNotice(const HDI::Ril::V1_0::SsNoticeInfo &ssNoticeInf
|
||||
ssNotice->requestType = ssNoticeInfo.requestType;
|
||||
ssNotice->serviceClass = ssNoticeInfo.serviceClass;
|
||||
ssNotice->result = ssNoticeInfo.result;
|
||||
return Notify<SsNoticeInfo>(
|
||||
TELEPHONY_LOG_FUNC_NAME, ssNotice, RadioEvent::RADIO_CALL_SS_NOTICE);
|
||||
return Notify<SsNoticeInfo>(TELEPHONY_LOG_FUNC_NAME, ssNotice, RadioEvent::RADIO_CALL_SS_NOTICE);
|
||||
}
|
||||
|
||||
int32_t TelRilCall::CallRingbackVoiceNotice(const HDI::Ril::V1_0::RingbackVoice &ringbackVoice)
|
||||
@ -493,8 +491,7 @@ int32_t TelRilCall::CallRingbackVoiceNotice(const HDI::Ril::V1_0::RingbackVoice
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
ringbackVoiceInfo->status = ringbackVoice.status;
|
||||
return Notify<RingbackVoice>(
|
||||
TELEPHONY_LOG_FUNC_NAME, ringbackVoiceInfo, RadioEvent::RADIO_CALL_RINGBACK_VOICE);
|
||||
return Notify<RingbackVoice>(TELEPHONY_LOG_FUNC_NAME, ringbackVoiceInfo, RadioEvent::RADIO_CALL_RINGBACK_VOICE);
|
||||
}
|
||||
|
||||
int32_t TelRilCall::CallSrvccStatusNotice(const HDI::Ril::V1_0::SrvccStatus &srvccStatus)
|
||||
@ -505,8 +502,7 @@ int32_t TelRilCall::CallSrvccStatusNotice(const HDI::Ril::V1_0::SrvccStatus &srv
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
srvccStatusInfo->status = srvccStatus.status;
|
||||
return Notify<SrvccStatus>(
|
||||
TELEPHONY_LOG_FUNC_NAME, srvccStatusInfo, RadioEvent::RADIO_CALL_SRVCC_STATUS);
|
||||
return Notify<SrvccStatus>(TELEPHONY_LOG_FUNC_NAME, srvccStatusInfo, RadioEvent::RADIO_CALL_SRVCC_STATUS);
|
||||
}
|
||||
|
||||
int32_t TelRilCall::CallRsrvccStatusNotify()
|
||||
@ -531,10 +527,10 @@ int32_t TelRilCall::GetEmergencyCallList(const AppExecFwk::InnerEvent::Pointer &
|
||||
}
|
||||
|
||||
int32_t TelRilCall::SetEmergencyCallList(
|
||||
std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &result)
|
||||
const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &result)
|
||||
{
|
||||
HDI::Ril::V1_0::EmergencyInfoList emergencyInfoList;
|
||||
emergencyInfoList.callSize = (int32_t)eccVec.size();
|
||||
emergencyInfoList.callSize = static_cast<int32_t>(eccVec.size());
|
||||
int index = 1;
|
||||
for (EmergencyCall ecc : eccVec) {
|
||||
HDI::Ril::V1_0::EmergencyCall emergencyCall = {};
|
||||
|
@ -29,7 +29,7 @@ void TelRilHandler::ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event)
|
||||
auto serial = event->GetParam();
|
||||
TELEPHONY_LOGI(
|
||||
"ProcessEvent, id:%{public}d, serial:%{public}d, reqLockSerialNum_:%{public}d, ackLockSerialNum_:%{public}d",
|
||||
id, (int)serial, (int)reqLockSerialNum_, (int)ackLockSerialNum_);
|
||||
id, static_cast<int>(serial), static_cast<int>(reqLockSerialNum_), static_cast<int>(ackLockSerialNum_));
|
||||
switch (id) {
|
||||
case RUNNING_LOCK_TIMEOUT_EVENT_ID:
|
||||
if (serial == reqLockSerialNum_) {
|
||||
@ -81,13 +81,14 @@ void TelRilHandler::ApplyRunningLock(int32_t lockType)
|
||||
reqRunningLockCount_++;
|
||||
reqLockSerialNum_++;
|
||||
reqRunningLock_->Lock();
|
||||
TELEPHONY_LOGI("ApplyRunningLock,reqLockSerialNum_:%{public}d", (int)reqLockSerialNum_);
|
||||
TELEPHONY_LOGI("ApplyRunningLock,reqLockSerialNum_:%{public}d", static_cast<int>(reqLockSerialNum_));
|
||||
this->SendEvent(RUNNING_LOCK_TIMEOUT_EVENT_ID, reqLockSerialNum_, RUNNING_LOCK_DEFAULT_TIMEOUT_MS);
|
||||
} else if (ackRunningLock_ != nullptr && lockType == ACK_RUNNING_LOCK) {
|
||||
ackLockSerialNum_++;
|
||||
ackRunningLock_->Lock();
|
||||
TELEPHONY_LOGI("ApplyRunningLock,ackLockSerialNum_:%{public}d", (int)ackLockSerialNum_);
|
||||
TELEPHONY_LOGI("ApplyRunningLock,ackLockSerialNum_:%{public}d", static_cast<int>(ackLockSerialNum_));
|
||||
this->SendEvent(ACK_RUNNING_LOCK_TIMEOUT_EVENT_ID, ackLockSerialNum_, ACK_RUNNING_LOCK_DEFAULT_TIMEOUT_MS);
|
||||
|
||||
} else {
|
||||
TELEPHONY_LOGE("ApplyRunningLock,lockType:%{public}d is invalid", lockType);
|
||||
}
|
||||
@ -96,7 +97,7 @@ void TelRilHandler::ApplyRunningLock(int32_t lockType)
|
||||
void TelRilHandler::ReduceRunningLock(int32_t lockType)
|
||||
{
|
||||
std::lock_guard<std::mutex> lockRequest(mutexRunningLock_);
|
||||
TELEPHONY_LOGI("ReduceRunningLock,reqRunningLockCount_:%{public}d", (int)reqRunningLockCount_);
|
||||
TELEPHONY_LOGI("ReduceRunningLock,reqRunningLockCount_:%{public}d", static_cast<int>(reqRunningLockCount_));
|
||||
if ((reqRunningLock_ != nullptr) && (lockType == NORMAL_RUNNING_LOCK)) {
|
||||
if (reqRunningLockCount_ > 1) {
|
||||
reqRunningLockCount_--;
|
||||
|
@ -28,8 +28,10 @@ using OHOS::IRemoteObject;
|
||||
using OHOS::sptr;
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
namespace {
|
||||
constexpr const char *RIL_INTERFACE_SERVICE_NAME = "ril_service";
|
||||
constexpr int32_t STATUS_OK = 0;
|
||||
} // namespace
|
||||
TelRilManager::TelRilManager() {}
|
||||
|
||||
bool TelRilManager::OnInit()
|
||||
@ -37,6 +39,7 @@ bool TelRilManager::OnInit()
|
||||
int32_t res = ConnectRilInterface();
|
||||
TELEPHONY_LOGI("TelRilManager, connect ril interface result is %{public}d", res);
|
||||
res = RegisterHdfStatusListener();
|
||||
TELEPHONY_LOGI("TelRilManager, register hdf status is %{public}d", res);
|
||||
CreatTelRilHandler();
|
||||
for (int32_t slotId = SIM_SLOT_0; slotId < SIM_SLOT_COUNT; slotId++) {
|
||||
InitTelModule(slotId);
|
||||
@ -424,7 +427,7 @@ int32_t TelRilManager::GetEmergencyCallList(int32_t slotId, const AppExecFwk::In
|
||||
}
|
||||
|
||||
int32_t TelRilManager::SetEmergencyCallList(
|
||||
int32_t slotId, std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const std::vector<EmergencyCall> &eccVec, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
TELEPHONY_LOGI("SetEmergencyCallList start");
|
||||
return TaskSchedule(response, "TelRilCall", GetTelRilCall(slotId), &TelRilCall::SetEmergencyCallList, eccVec);
|
||||
@ -700,24 +703,26 @@ int32_t TelRilManager::ChangeSimPassword(
|
||||
simPassword.oldPassword, simPassword.newPassword, simPassword.passwordLength);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::UnlockPin(int32_t slotId, std::string pin, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t TelRilManager::UnlockPin(
|
||||
int32_t slotId, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::UnlockPin, pin);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::UnlockPuk(
|
||||
int32_t slotId, std::string puk, std::string pin, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const std::string &puk, const std::string &pin, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::UnlockPuk, puk, pin);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::UnlockPin2(int32_t slotId, std::string pin2, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t TelRilManager::UnlockPin2(
|
||||
int32_t slotId, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::UnlockPin2, pin2);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::UnlockPuk2(
|
||||
int32_t slotId, std::string puk2, std::string pin2, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const std::string &puk2, const std::string &pin2, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::UnlockPuk2, puk2, pin2);
|
||||
}
|
||||
@ -766,20 +771,20 @@ int32_t TelRilManager::SimCloseLogicalChannel(
|
||||
}
|
||||
|
||||
int32_t TelRilManager::SimTransmitApduLogicalChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(
|
||||
response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::SimTransmitApduLogicalChannel, reqInfo);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::SimTransmitApduBasicChannel(
|
||||
int32_t slotId, ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::SimTransmitApduBasicChannel, reqInfo);
|
||||
}
|
||||
|
||||
int32_t TelRilManager::SimAuthentication(
|
||||
int32_t slotId, SimAuthenticationRequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
int32_t slotId, const SimAuthenticationRequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
return TaskSchedule(response, "TelRilSim", GetTelRilSim(slotId), &TelRilSim::SimAuthentication, reqInfo);
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ int32_t TelRilSim::SimCloseLogicalChannel(int32_t channelId, const AppExecFwk::I
|
||||
}
|
||||
|
||||
int32_t TelRilSim::SimTransmitApduLogicalChannel(
|
||||
ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
OHOS::HDI::Ril::V1_0::ApduSimIORequestInfo ApduRequestInfo;
|
||||
BuildApduRequestInfo(ApduRequestInfo, reqInfo);
|
||||
@ -447,7 +447,7 @@ int32_t TelRilSim::SimTransmitApduLogicalChannel(
|
||||
}
|
||||
|
||||
int32_t TelRilSim::SimTransmitApduBasicChannel(
|
||||
ApduSimIORequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
const ApduSimIORequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
OHOS::HDI::Ril::V1_0::ApduSimIORequestInfo ApduRequestInfo;
|
||||
BuildApduRequestInfo(ApduRequestInfo, reqInfo);
|
||||
@ -456,7 +456,7 @@ int32_t TelRilSim::SimTransmitApduBasicChannel(
|
||||
}
|
||||
|
||||
int32_t TelRilSim::SimAuthentication(
|
||||
SimAuthenticationRequestInfo reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
const SimAuthenticationRequestInfo &reqInfo, const AppExecFwk::InnerEvent::Pointer &response)
|
||||
{
|
||||
OHOS::HDI::Ril::V1_0::SimAuthenticationRequestInfo simAuthInfo;
|
||||
simAuthInfo.aid = reqInfo.aid;
|
||||
|
@ -232,7 +232,7 @@ uint8_t *TelRilSms::ConvertHexStringToBytes(const uint8_t *hexString, size_t len
|
||||
free(bytes);
|
||||
return nullptr;
|
||||
}
|
||||
bytes[i / HEX_NUM_PER_BYTE] = (((uint32_t)hexCh1 << BIT_NUM_PER_HEX) | hexCh2);
|
||||
bytes[i / HEX_NUM_PER_BYTE] = ((hexCh1 << BIT_NUM_PER_HEX) | hexCh2);
|
||||
i += HEX_NUM_PER_BYTE;
|
||||
}
|
||||
return bytes;
|
||||
|
@ -66,7 +66,7 @@ sptr<ICoreService> SimTest::GetProxy()
|
||||
TELEPHONY_LOGI("TelephonyTestService GetProxy ... ");
|
||||
sptr<ISystemAbilityManager> systemAbilityMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
|
||||
if (systemAbilityMgr == nullptr) {
|
||||
TELEPHONY_LOGI("TelephonyTestService Get ISystemAbilityManager failed!!!");
|
||||
TELEPHONY_LOGE("TelephonyTestService Get ISystemAbilityManager failed!!!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ sptr<ICoreService> SimTest::GetProxy()
|
||||
sptr<ICoreService> telephonyService = iface_cast<ICoreService>(remote);
|
||||
return telephonyService;
|
||||
} else {
|
||||
TELEPHONY_LOGI("TelephonyTestService Get TELEPHONY_CORE_SERVICE_SYS_ABILITY_ID fail ...");
|
||||
TELEPHONY_LOGE("TelephonyTestService Get TELEPHONY_CORE_SERVICE_SYS_ABILITY_ID fail ...");
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
@ -1254,7 +1254,6 @@ HWTEST_F(SimTest, Telephony_Sim_QueryIccFdnDiallingNumbers_0200, Function | Medi
|
||||
CoreServiceTestHelper helper;
|
||||
if (!helper.Run(QueryIccFdnDiallingNumbersTestFunc1, std::ref(helper))) {
|
||||
TELEPHONY_LOGI("Interface out of time");
|
||||
ASSERT_TRUE(true);
|
||||
}
|
||||
ASSERT_TRUE(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user