mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-11-26 17:50:36 +00:00
commit
fb367e36db
@ -105,10 +105,9 @@ struct AsyncProfileNickname {
|
||||
};
|
||||
|
||||
struct AsyncCancelSession {
|
||||
AsyncContext<napi_value> asyncContext;
|
||||
AsyncContext<int32_t> asyncContext;
|
||||
std::string transactionId = "";
|
||||
int32_t cancelReason = static_cast<int32_t>(CancelReason::CANCEL_REASON_POSTPONED);
|
||||
ResponseEsimResult responseResult;
|
||||
};
|
||||
|
||||
struct AsyncProfileMetadataInfo {
|
||||
|
@ -62,7 +62,7 @@ napi_value NapiCreateAsyncWork(napi_env env, napi_callback_info info, std::strin
|
||||
auto inParaTp = std::make_tuple(&asyncContext->slotId, &context.callbackRef);
|
||||
std::optional<NapiError> errCode = MatchParameters(env, argv, argc, inParaTp);
|
||||
if (errCode.has_value()) {
|
||||
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
||||
JsError error = NapiUtil::ConverEsimErrorMessageForJs(errCode.value());
|
||||
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
||||
return nullptr;
|
||||
}
|
||||
@ -102,7 +102,7 @@ napi_value NapiCreateAsyncWork2(const AsyncPara ¶, AsyncContextType *asyncCo
|
||||
|
||||
std::optional<NapiError> errCode = MatchParameters(env, argv, argc, theTuple);
|
||||
if (errCode.has_value()) {
|
||||
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
||||
JsError error = NapiUtil::ConverEsimErrorMessageForJs(errCode.value());
|
||||
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
||||
return nullptr;
|
||||
}
|
||||
@ -186,7 +186,7 @@ napi_value DownloadProfileResultConversion(napi_env env, const DownloadProfileRe
|
||||
{
|
||||
napi_value val = nullptr;
|
||||
napi_create_object(env, &val);
|
||||
SetPropertyToNapiObject(env, val, "requestResponseResult", static_cast<int32_t>(resultInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "responseResult", static_cast<int32_t>(resultInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "solvableErrors", static_cast<int32_t>(resultInfo.resolvableErrors_));
|
||||
SetPropertyToNapiObject(env, val, "cardId", resultInfo.cardId_);
|
||||
|
||||
@ -226,7 +226,7 @@ napi_value ProfileResultListConversion(napi_env env, const GetDownloadableProfil
|
||||
{
|
||||
napi_value val = nullptr;
|
||||
napi_create_object(env, &val);
|
||||
SetPropertyToNapiObject(env, val, "requestResponseResult", static_cast<int32_t>(resultListInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "responseResult", static_cast<int32_t>(resultListInfo.result_));
|
||||
napi_value resultArray = nullptr;
|
||||
napi_create_array(env, &resultArray);
|
||||
for (size_t i = 0; i < resultListInfo.downloadableProfiles_.size(); i++) {
|
||||
@ -251,7 +251,7 @@ napi_value MetadataResultConversion(napi_env env, const GetDownloadableProfileMe
|
||||
SetPropertyToNapiObject(env, val, "profileName", NapiUtil::ToUtf8(metadataInfo.profileName_));
|
||||
SetPropertyToNapiObject(env, val, "profileClass", static_cast<int32_t>(metadataInfo.profileClass_));
|
||||
SetPropertyToNapiObject(env, val, "solvableErrors", static_cast<int32_t>(metadataInfo.resolvableErrors_));
|
||||
SetPropertyToNapiObject(env, val, "requestResponseResult", static_cast<int32_t>(metadataInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "responseResult", static_cast<int32_t>(metadataInfo.result_));
|
||||
|
||||
return val;
|
||||
}
|
||||
@ -296,7 +296,7 @@ napi_value EuiccProfileListConversion(napi_env env, const GetEuiccProfileInfoLis
|
||||
{
|
||||
napi_value val = nullptr;
|
||||
napi_create_object(env, &val);
|
||||
SetPropertyToNapiObject(env, val, "requestResponseResult", static_cast<int32_t>(euiccListInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "responseResult", static_cast<int32_t>(euiccListInfo.result_));
|
||||
SetPropertyToNapiObject(env, val, "isRemovable", euiccListInfo.isRemovable_);
|
||||
napi_value resultArray = nullptr;
|
||||
napi_create_array(env, &resultArray);
|
||||
@ -309,16 +309,6 @@ napi_value EuiccProfileListConversion(napi_env env, const GetEuiccProfileInfoLis
|
||||
return val;
|
||||
}
|
||||
|
||||
napi_value ResponseEsimResultConversion(napi_env env, const ResponseEsimResult &resultInfo)
|
||||
{
|
||||
napi_value val = nullptr;
|
||||
napi_create_object(env, &val);
|
||||
SetPropertyToNapiObject(env, val, "requestResponseResult", static_cast<int32_t>(resultInfo.resultCode_));
|
||||
SetPropertyToNapiObject(env, val, "response", NapiUtil::ToUtf8(resultInfo.response_));
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
AccessRule GetAccessRuleInfo(AsyncAccessRule &accessType)
|
||||
{
|
||||
AccessRule access;
|
||||
@ -435,7 +425,7 @@ napi_value GetEid(napi_env env, napi_callback_info info)
|
||||
return value;
|
||||
}
|
||||
|
||||
napi_value IsEsimSupported(napi_env env, napi_callback_info info)
|
||||
napi_value IsSupported(napi_env env, napi_callback_info info)
|
||||
{
|
||||
size_t parameterCount = PARAMETER_COUNT_ONE;
|
||||
napi_value parameters[] = { nullptr };
|
||||
@ -443,18 +433,18 @@ napi_value IsEsimSupported(napi_env env, napi_callback_info info)
|
||||
bool isSupported = false;
|
||||
napi_value value = nullptr;
|
||||
if (parameterCount != PARAMETER_COUNT_ONE) {
|
||||
TELEPHONY_LOGE("isEsimSupported parameter count is incorrect");
|
||||
TELEPHONY_LOGE("isSupported parameter count is incorrect");
|
||||
NAPI_CALL(env, napi_create_int32(env, isSupported, &value));
|
||||
return value;
|
||||
}
|
||||
int32_t slotId = UNDEFINED_VALUE;
|
||||
if (napi_get_value_int32(env, parameters[0], &slotId) != napi_ok) {
|
||||
TELEPHONY_LOGE("isEsimSupported convert parameter fail");
|
||||
TELEPHONY_LOGE("isSupported convert parameter fail");
|
||||
NAPI_CALL(env, napi_create_int32(env, isSupported, &value));
|
||||
return value;
|
||||
}
|
||||
if (IsValidSlotId(slotId)) {
|
||||
isSupported = DelayedRefSingleton<EsimServiceClient>::GetInstance().IsEsimSupported(slotId);
|
||||
isSupported = DelayedRefSingleton<EsimServiceClient>::GetInstance().IsSupported(slotId);
|
||||
}
|
||||
NAPI_CALL(env, napi_get_boolean(env, isSupported, &value));
|
||||
return value;
|
||||
@ -664,7 +654,7 @@ void SwitchToProfileCallback(napi_env env, napi_status status, void *data)
|
||||
return;
|
||||
}
|
||||
NapiAsyncPermissionCompleteCallback(
|
||||
env, status, context->asyncContext, false, { "SwitchToProfile", Permission::SET_TELEPHONY_ESIM_STATE_OPEN });
|
||||
env, status, context->asyncContext, false, { "SwitchToProfile", Permission::SET_TELEPHONY_ESIM_STATE });
|
||||
}
|
||||
|
||||
napi_value SwitchToProfile(napi_env env, napi_callback_info info)
|
||||
@ -1086,7 +1076,7 @@ void SetProfileNicknameCallback(napi_env env, napi_status status, void *data)
|
||||
return;
|
||||
}
|
||||
NapiAsyncPermissionCompleteCallback(
|
||||
env, status, context->asyncContext, false, { "SetProfileNickname", Permission::SET_TELEPHONY_ESIM_STATE_OPEN });
|
||||
env, status, context->asyncContext, false, { "SetProfileNickname", Permission::SET_TELEPHONY_ESIM_STATE });
|
||||
}
|
||||
|
||||
napi_value SetProfileNickname(napi_env env, napi_callback_info info)
|
||||
@ -1123,7 +1113,7 @@ void NativeCancelSession(napi_env env, void *data)
|
||||
return;
|
||||
}
|
||||
AsyncCancelSession *sessionContext = static_cast<AsyncCancelSession *>(data);
|
||||
AsyncContext<napi_value> &asyncContext = sessionContext->asyncContext;
|
||||
AsyncContext<int32_t> &asyncContext = sessionContext->asyncContext;
|
||||
if (!IsValidSlotId(asyncContext.slotId)) {
|
||||
TELEPHONY_LOGE("NativeCancelSession slotId is invalid");
|
||||
asyncContext.context.errorCode = ERROR_SLOT_ID_INVALID;
|
||||
@ -1135,7 +1125,7 @@ void NativeCancelSession(napi_env env, void *data)
|
||||
asyncContext.slotId, sessionContext->transactionId, sessionContext->cancelReason, responseResult);
|
||||
TELEPHONY_LOGI("NAPI NativeCancelSession %{public}d", errorCode);
|
||||
if (errorCode == ERROR_NONE) {
|
||||
sessionContext->responseResult = responseResult;
|
||||
sessionContext->asyncContext.callbackVal = static_cast<int32_t>(responseResult.resultCode_);
|
||||
sessionContext->asyncContext.context.resolved = true;
|
||||
} else {
|
||||
sessionContext->asyncContext.context.resolved = false;
|
||||
@ -1151,10 +1141,6 @@ void CancelSessionCallback(napi_env env, napi_status status, void *data)
|
||||
TELEPHONY_LOGE("CancelSessionCallback context is nullptr");
|
||||
return;
|
||||
}
|
||||
AsyncContext<napi_value> &asyncContext = context->asyncContext;
|
||||
if (asyncContext.context.resolved) {
|
||||
asyncContext.callbackVal = ResponseEsimResultConversion(env, context->responseResult);
|
||||
}
|
||||
NapiAsyncPermissionCompleteCallback(
|
||||
env, status, context->asyncContext, false, { "CancelSession", Permission::SET_TELEPHONY_ESIM_STATE });
|
||||
}
|
||||
@ -1418,16 +1404,16 @@ napi_status InitEnumCancelReason(napi_env env, napi_value exports)
|
||||
napi_status InitEnumOsuStatus(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRAD_IN_PROGRESS",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRAD_IN_PROGRESS))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRAD_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRAD_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRAD_SUCCESSFUL",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRAD_SUCCESSFUL))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRAD_ALREADY_LATEST",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRAD_ALREADY_LATEST))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRAD_SERVICE_UNAVAILABLE",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRAD_SERVICE_UNAVAILABLE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRADE_IN_PROGRESS",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRADE_IN_PROGRESS))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRADE_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRADE_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRADE_SUCCESSFUL",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRADE_SUCCESSFUL))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRADE_ALREADY_LATEST",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRADE_ALREADY_LATEST))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("EUICC_UPGRADE_SERVICE_UNAVAILABLE",
|
||||
GetNapiValue(env, static_cast<int32_t>(OsuStatus::EUICC_UPGRADE_SERVICE_UNAVAILABLE))),
|
||||
};
|
||||
|
||||
constexpr size_t arrSize = sizeof(desc) / sizeof(desc[0]);
|
||||
@ -1485,31 +1471,145 @@ napi_status InitEnumPolicyRules(napi_env env, napi_value exports)
|
||||
return napi_define_properties(env, exports, arrSize, desc);
|
||||
}
|
||||
|
||||
napi_status InitEnumResult(napi_env env, napi_value exports)
|
||||
napi_status InitEnumResultFirst(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_STATIC_PROPERTY("RESULT_SOLVABLE_ERRORS",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultState::RESULT_SOLVABLE_ERRORS))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("RESULT_MUST_DISABLE_PROFILE",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultState::RESULT_MUST_DISABLE_PROFILE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("RESULT_OK",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultState::RESULT_OK))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("RESULT_UNDEFINED_ERROR",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultState::RESULT_UNDEFINED_ERROR))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SOLVABLE_ERRORS", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SOLVABLE_ERRORS))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_MUST_DISABLE_PROFILE",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_MUST_DISABLE_PROFILE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("RESULT_OK", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_OK))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_GET_EID_FAILED", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_GET_EID_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_ACTIVATION_CODE_CHANGED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_ACTIVATION_CODE_CHANGED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_ACTIVATION_CODE_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_ACTIVATION_CODE_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SMDP_ADDRESS_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SMDP_ADDRESS_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_EUICC_INFO_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_EUICC_INFO_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_TLS_HANDSHAKE_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_TLS_HANDSHAKE_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CERTIFICATE_IO_ERROR",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CERTIFICATE_IO_ERROR))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CERTIFICATE_RESPONSE_TIMEOUT",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CERTIFICATE_RESPONSE_TIMEOUT))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_AUTHENTICATION_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_AUTHENTICATION_FAILED))),
|
||||
};
|
||||
|
||||
constexpr size_t arrSize = sizeof(desc) / sizeof(desc[0]);
|
||||
NapiUtil::DefineEnumClassByName(env, exports, "ResultState", arrSize, desc);
|
||||
NapiUtil::DefineEnumClassByName(env, exports, "ResultCode", arrSize, desc);
|
||||
return napi_define_properties(env, exports, arrSize, desc);
|
||||
}
|
||||
|
||||
napi_status InitEnumResultSecond(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_RESPONSE_HTTP_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_RESPONSE_HTTP_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CONFIRMATION_CODE_INCORRECT",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CONFIRMATION_CODE_INCORRECT))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_EXCEEDED_CONFIRMATION_CODE_TRY_LIMIT",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_EXCEEDED_CONFIRMATION_CODE_TRY_LIMIT))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_NO_PROFILE_ON_SERVER",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_NO_PROFILE_ON_SERVER))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_TRANSACTION_ID_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_TRANSACTION_ID_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SERVER_ADDRESS_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SERVER_ADDRESS_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_GET_BOUND_PROFILE_PACKAGE_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_GET_BOUND_PROFILE_PACKAGE_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_USER_CANCEL_DOWNLOAD",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_USER_CANCEL_DOWNLOAD))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SERVER_UNAVAILABLE",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SERVER_UNAVAILABLE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_PROFILE_NON_DELETE",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_PROFILE_NON_DELETE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SMDP_ADDRESS_INCORRECT",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SMDP_ADDRESS_INCORRECT))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_ANALYZE_AUTHENTICATION_SERVER_RESPONSE_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_ANALYZE_AUTHENTICATION_SERVER_RESPONSE_FAILED))),
|
||||
};
|
||||
|
||||
constexpr size_t arrSize = sizeof(desc) / sizeof(desc[0]);
|
||||
NapiUtil::DefineEnumClassByName(env, exports, "ResultCode", arrSize, desc);
|
||||
return napi_define_properties(env, exports, arrSize, desc);
|
||||
}
|
||||
|
||||
napi_status InitEnumResultOther(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_ANALYZE_AUTHENTICATION_CLIENT_RESPONSE_FAILED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_ANALYZE_AUTHENTICATION_CLIENT_RESPONSE_FAILED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_ANALYZE_AUTHENTICATION_CLIENT_MATCHING_ID_REFUSED",
|
||||
GetNapiValue(
|
||||
env, static_cast<int32_t>(ResultCode::RESULT_ANALYZE_AUTHENTICATION_CLIENT_MATCHING_ID_REFUSED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_PROFILE_TYPE_ERROR_AUTHENTICATION_STOPPED",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_PROFILE_TYPE_ERROR_AUTHENTICATION_STOPPED))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CARRIER_SERVER_REFUSED_ERRORS",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CARRIER_SERVER_REFUSED_ERRORS))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CERTIFICATE_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CERTIFICATE_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_OUT_OF_MEMORY",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_OUT_OF_MEMORY))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_PPR_FORBIDDEN", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_PPR_FORBIDDEN))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_NOTHING_TO_DELETE", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_NOTHING_TO_DELETE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_PPR_NOT_MATCH", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_PPR_NOT_MATCH))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_CAT_BUSY", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_CAT_BUSY))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_PROFILE_EID_INVALID",
|
||||
GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_PROFILE_EID_INVALID))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_DOWNLOAD_TIMEOUT", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_DOWNLOAD_TIMEOUT))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY(
|
||||
"RESULT_SGP_22_OTHER", GetNapiValue(env, static_cast<int32_t>(ResultCode::RESULT_SGP_22_OTHER))),
|
||||
};
|
||||
|
||||
constexpr size_t arrSize = sizeof(desc) / sizeof(desc[0]);
|
||||
NapiUtil::DefineEnumClassByName(env, exports, "ResultCode", arrSize, desc);
|
||||
return napi_define_properties(env, exports, arrSize, desc);
|
||||
}
|
||||
|
||||
napi_status InitEnumResolvableErrors(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_STATIC_PROPERTY("SOLVABLE_ERROR_NEEED_CONFIRMATION_CODE",
|
||||
GetNapiValue(env, static_cast<int32_t>(SolvableErrors::SOLVABLE_ERROR_NEEED_CONFIRMATION_CODE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("SOLVABLE_ERROR_NEEED_POLICY_RULE",
|
||||
GetNapiValue(env, static_cast<int32_t>(SolvableErrors::SOLVABLE_ERROR_NEEED_POLICY_RULE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("SOLVABLE_ERROR_NEED_CONFIRMATION_CODE",
|
||||
GetNapiValue(env, static_cast<int32_t>(SolvableErrors::SOLVABLE_ERROR_NEED_CONFIRMATION_CODE))),
|
||||
DECLARE_NAPI_STATIC_PROPERTY("SOLVABLE_ERROR_NEED_POLICY_RULE",
|
||||
GetNapiValue(env, static_cast<int32_t>(SolvableErrors::SOLVABLE_ERROR_NEED_POLICY_RULE))),
|
||||
};
|
||||
|
||||
constexpr size_t arrSize = sizeof(desc) / sizeof(desc[0]);
|
||||
@ -1520,7 +1620,7 @@ napi_status InitEnumResolvableErrors(napi_env env, napi_value exports)
|
||||
napi_status InitEuiccServiceInterface(napi_env env, napi_value exports)
|
||||
{
|
||||
napi_property_descriptor desc[] = {
|
||||
DECLARE_NAPI_FUNCTION("isEsimSupported", IsEsimSupported),
|
||||
DECLARE_NAPI_FUNCTION("isSupported", IsSupported),
|
||||
DECLARE_NAPI_FUNCTION("getEid", GetEid),
|
||||
DECLARE_NAPI_FUNCTION("getOsuStatus", GetOsuStatus),
|
||||
DECLARE_NAPI_FUNCTION("startOsu", StartOsu),
|
||||
@ -1552,7 +1652,9 @@ napi_value InitNapiEsim(napi_env env, napi_value exports)
|
||||
NAPI_CALL(env, InitEnumProfileState(env, exports));
|
||||
NAPI_CALL(env, InitEnumProfileClass(env, exports));
|
||||
NAPI_CALL(env, InitEnumPolicyRules(env, exports));
|
||||
NAPI_CALL(env, InitEnumResult(env, exports));
|
||||
NAPI_CALL(env, InitEnumResultFirst(env, exports));
|
||||
NAPI_CALL(env, InitEnumResultSecond(env, exports));
|
||||
NAPI_CALL(env, InitEnumResultOther(env, exports));
|
||||
NAPI_CALL(env, InitEnumResolvableErrors(env, exports));
|
||||
return exports;
|
||||
}
|
||||
|
@ -176,6 +176,21 @@ enum JsErrorCode {
|
||||
* VCard file invalid.
|
||||
*/
|
||||
JS_ERROR_VCARD_FILE_INVALID,
|
||||
|
||||
/**
|
||||
* Success.
|
||||
*/
|
||||
JS_ERROR_ESIM_SUCCESS = 3120000,
|
||||
|
||||
/**
|
||||
* Service connection failed.
|
||||
*/
|
||||
JS_ERROR_ESIM_SERVICE_ERROR = 3120001,
|
||||
|
||||
/**
|
||||
* System internal error.
|
||||
*/
|
||||
JS_ERROR_ESIM_SYSTEM_ERROR = 3120002,
|
||||
};
|
||||
|
||||
struct JsError {
|
||||
|
@ -60,6 +60,9 @@ static constexpr const char *JS_ERROR_CONFERENCE_CALL_IS_NOT_ACTIVE_STRING = "Co
|
||||
static constexpr const char *JS_ERROR_TELEPHONY_CALL_COUNTS_EXCEED_LIMIT_STRING = "call count exceeds limit";
|
||||
static constexpr const char *JS_ERROR_TELEPHONY_DIAL_IS_BUSY_STRING =
|
||||
"Current on a call, unable to initiate a new call";
|
||||
static constexpr const char *JS_ERROR_ESIM_SUCCESS_STRING = "Success.";
|
||||
static constexpr const char *JS_ERROR_ESIM_SERVICE_ERROR_STRING = "Service connection failed.";
|
||||
static constexpr const char *JS_ERROR_ESIM_SYSTEM_ERROR_STRING = "System internal error.";
|
||||
|
||||
static std::unordered_map<int32_t, const char *> errorMap_ = {
|
||||
{ JsErrorCode::JS_ERROR_TELEPHONY_PERMISSION_DENIED, JS_ERROR_TELEPHONY_PERMISSION_DENIED_STRING },
|
||||
@ -89,6 +92,9 @@ static std::unordered_map<int32_t, const char *> errorMap_ = {
|
||||
{ JsErrorCode::JS_ERROR_TELEPHONY_CONFERENCE_CALL_NOT_ACTIVE, JS_ERROR_CONFERENCE_CALL_IS_NOT_ACTIVE_STRING },
|
||||
{ JsErrorCode::JS_ERROR_TELEPHONY_CALL_COUNTS_EXCEED_LIMIT, JS_ERROR_TELEPHONY_CALL_COUNTS_EXCEED_LIMIT_STRING },
|
||||
{ JsErrorCode::JS_ERROR_TELEPHONY_DIAL_IS_BUSY, JS_ERROR_TELEPHONY_DIAL_IS_BUSY_STRING },
|
||||
{ JsErrorCode::JS_ERROR_ESIM_SUCCESS, JS_ERROR_ESIM_SUCCESS_STRING },
|
||||
{ JsErrorCode::JS_ERROR_ESIM_SERVICE_ERROR, JS_ERROR_ESIM_SERVICE_ERROR_STRING },
|
||||
{ JsErrorCode::JS_ERROR_ESIM_SYSTEM_ERROR, JS_ERROR_ESIM_SYSTEM_ERROR_STRING },
|
||||
};
|
||||
const std::string ERROR_STRING = "error";
|
||||
const std::u16string ERROR_USTRING = u"error";
|
||||
@ -473,6 +479,90 @@ JsError NapiUtil::ConverErrorMessageForJs(int32_t errorCode)
|
||||
return error;
|
||||
}
|
||||
|
||||
bool NapiUtil::CreateEsimParameterErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode)
|
||||
{
|
||||
bool flag = true;
|
||||
switch (errorCode) {
|
||||
case ERROR_PARAMETER_COUNTS_INVALID:
|
||||
case ERROR_PARAMETER_TYPE_INVALID:
|
||||
case ERROR_SLOT_ID_INVALID:
|
||||
case napi_status::napi_generic_failure:
|
||||
case napi_status::napi_invalid_arg:
|
||||
jsErrorCode = JS_ERROR_TELEPHONY_INVALID_INPUT_PARAMETER;
|
||||
break;
|
||||
default:
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
bool NapiUtil::CreateEsimServiceErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode)
|
||||
{
|
||||
bool flag = true;
|
||||
|
||||
switch (errorCode) {
|
||||
case TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL:
|
||||
case TELEPHONY_ERR_WRITE_DATA_FAIL:
|
||||
case TELEPHONY_ERR_WRITE_REPLY_FAIL:
|
||||
case TELEPHONY_ERR_READ_DATA_FAIL:
|
||||
case TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL:
|
||||
jsErrorCode = JS_ERROR_ESIM_SERVICE_ERROR;
|
||||
break;
|
||||
case TELEPHONY_ERR_NOT_SUPPORT_ESIM:
|
||||
jsErrorCode = JS_ERROR_DEVICE_NOT_SUPPORT_THIS_API;
|
||||
break;
|
||||
default:
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
bool NapiUtil::CreateEsimSystemErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode)
|
||||
{
|
||||
bool flag = true;
|
||||
|
||||
switch (errorCode) {
|
||||
case TELEPHONY_ERR_FAIL:
|
||||
case TELEPHONY_ERR_LOCAL_PTR_NULL:
|
||||
jsErrorCode = JS_ERROR_ESIM_SYSTEM_ERROR;
|
||||
break;
|
||||
case TELEPHONY_ERR_ILLEGAL_USE_OF_SYSTEM_API:
|
||||
jsErrorCode = JS_ERROR_ILLEGAL_USE_OF_SYSTEM_API;
|
||||
break;
|
||||
default:
|
||||
flag = false;
|
||||
break;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
JsError NapiUtil::ConverEsimErrorMessageForJs(int32_t errorCode)
|
||||
{
|
||||
JsError error = {};
|
||||
if (errorCode == TELEPHONY_ERR_SUCCESS) {
|
||||
error.errorCode = JS_ERROR_ESIM_SUCCESS;
|
||||
error.errorMessage = GetErrorMessage(JS_ERROR_ESIM_SUCCESS);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (CreateEsimParameterErrorMessageForJs(errorCode, error.errorCode)) {
|
||||
error.errorMessage = GetErrorMessage(error.errorCode);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (!CreateEsimServiceErrorMessageForJs(errorCode, error.errorCode) &&
|
||||
!CreateEsimSystemErrorMessageForJs(errorCode, error.errorCode)) {
|
||||
error.errorCode = JS_ERROR_ESIM_SYSTEM_ERROR;
|
||||
TELEPHONY_LOGE("NapiUtil::ConverEsimErrorMessageForJs errorCode is out of range");
|
||||
}
|
||||
error.errorMessage = GetErrorMessage(error.errorCode);
|
||||
TELEPHONY_LOGI("errorCode from %{public}d to %{public}d", errorCode, error.errorCode);
|
||||
return error;
|
||||
}
|
||||
|
||||
bool NapiUtil::CreateParameterErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode)
|
||||
{
|
||||
bool flag = true;
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
static void ThrowError(napi_env env, int32_t errorCode, const std::string &message);
|
||||
static void ThrowParameterError(napi_env env);
|
||||
static void ReleaseBaseContext(napi_env env, BaseContext *baseContext);
|
||||
static JsError ConverEsimErrorMessageForJs(int32_t errorCode);
|
||||
|
||||
private:
|
||||
static bool CreateParameterErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode);
|
||||
@ -82,6 +83,9 @@ private:
|
||||
static napi_value CreateError(napi_env env, int32_t err, const std::string &msg);
|
||||
static std::string GetErrorMessage(int32_t errorCode);
|
||||
static bool CreateVcardErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode);
|
||||
static bool CreateEsimParameterErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode);
|
||||
static bool CreateEsimServiceErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode);
|
||||
static bool CreateEsimSystemErrorMessageForJs(int32_t errorCode, JsErrorCode &jsErrorCode);
|
||||
};
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -1115,7 +1115,7 @@ int32_t CoreServiceClient::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1189,7 +1189,7 @@ int32_t CoreServiceClient::GetProfile(
|
||||
return proxy->GetProfile(slotId, portIndex, iccId, eUiccProfile);
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult)
|
||||
int32_t CoreServiceClient::ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1200,7 +1200,7 @@ int32_t CoreServiceClient::ResetMemory(int32_t slotId, ResetOption resetOption,
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1210,14 +1210,14 @@ int32_t CoreServiceClient::SetDefaultSmdpAddress(
|
||||
return proxy->SetDefaultSmdpAddress(slotId, defaultSmdpAddress, enumResult);
|
||||
}
|
||||
|
||||
bool CoreServiceClient::IsEsimSupported(int32_t slotId)
|
||||
bool CoreServiceClient::IsSupported(int32_t slotId)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
TELEPHONY_LOGE("proxy is null!");
|
||||
return false;
|
||||
}
|
||||
return proxy->IsEsimSupported(slotId);
|
||||
return proxy->IsSupported(slotId);
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::SendApduData(
|
||||
@ -1287,7 +1287,7 @@ int32_t CoreServiceClient::RetrieveNotification(
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1297,7 +1297,7 @@ int32_t CoreServiceClient::RemoveNotificationFromList(
|
||||
return proxy->RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult)
|
||||
int32_t CoreServiceClient::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1308,7 +1308,7 @@ int32_t CoreServiceClient::DeleteProfile(int32_t slotId, const std::u16string &i
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::SwitchToProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
@ -1319,7 +1319,7 @@ int32_t CoreServiceClient::SwitchToProfile(
|
||||
}
|
||||
|
||||
int32_t CoreServiceClient::SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
|
@ -3287,7 +3287,7 @@ int32_t CoreServiceProxy::GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfil
|
||||
ReadEuiccProfileFromReply(reply, euiccProfile);
|
||||
}
|
||||
euiccProfileInfoList.isRemovable_ = reply.ReadBool();
|
||||
euiccProfileInfoList.result_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
euiccProfileInfoList.result_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -3324,7 +3324,7 @@ int32_t CoreServiceProxy::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -3362,7 +3362,7 @@ int32_t CoreServiceProxy::DisableProfile(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -3506,7 +3506,7 @@ int32_t CoreServiceProxy::GetEuiccChallenge(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
responseResult.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
responseResult.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
responseResult.response_ = reply.ReadString16();
|
||||
}
|
||||
return result;
|
||||
@ -3579,7 +3579,7 @@ int32_t CoreServiceProxy::CancelSession(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
responseResult.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
responseResult.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
responseResult.response_ = reply.ReadString16();
|
||||
}
|
||||
return result;
|
||||
@ -3625,7 +3625,7 @@ int32_t CoreServiceProxy::GetProfile(
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult)
|
||||
int32_t CoreServiceProxy::ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -3655,13 +3655,13 @@ int32_t CoreServiceProxy::ResetMemory(int32_t slotId, ResetOption resetOption, R
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -3692,12 +3692,12 @@ int32_t CoreServiceProxy::SetDefaultSmdpAddress(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool CoreServiceProxy::IsEsimSupported(int32_t slotId)
|
||||
bool CoreServiceProxy::IsSupported(int32_t slotId)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -3718,7 +3718,7 @@ bool CoreServiceProxy::IsEsimSupported(int32_t slotId)
|
||||
int32_t requestResult =
|
||||
remote->SendRequest(static_cast<uint32_t>(CoreServiceInterfaceCode::IS_ESIM_SUPPORTED), data, reply, option);
|
||||
if (requestResult != ERR_NONE) {
|
||||
TELEPHONY_LOGE("IsEsimSupported sendRequest failed, error code is %{public}d", requestResult);
|
||||
TELEPHONY_LOGE("IsSupported sendRequest failed, error code is %{public}d", requestResult);
|
||||
return false;
|
||||
}
|
||||
return reply.ReadBool();
|
||||
@ -3796,7 +3796,7 @@ int32_t CoreServiceProxy::SendApduData(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
responseResult.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
responseResult.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
responseResult.response_ = reply.ReadString16();
|
||||
responseResult.sw1_ = reply.ReadInt32();
|
||||
responseResult.sw2_ = reply.ReadInt32();
|
||||
@ -3839,7 +3839,7 @@ int32_t CoreServiceProxy::PrepareDownload(int32_t slotId, const DownLoadConfigIn
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
responseResult.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
responseResult.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
responseResult.response_ = reply.ReadString16();
|
||||
}
|
||||
return result;
|
||||
@ -4036,7 +4036,7 @@ int32_t CoreServiceProxy::RetrieveNotification(
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -4071,12 +4071,12 @@ int32_t CoreServiceProxy::RemoveNotificationFromList(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult)
|
||||
int32_t CoreServiceProxy::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -4102,13 +4102,13 @@ int32_t CoreServiceProxy::DeleteProfile(int32_t slotId, const std::u16string &ic
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::SwitchToProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -4135,13 +4135,13 @@ int32_t CoreServiceProxy::SwitchToProfile(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult)
|
||||
{
|
||||
MessageParcel data;
|
||||
MessageParcel reply;
|
||||
@ -4167,7 +4167,7 @@ int32_t CoreServiceProxy::SetProfileNickname(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
enumResult = static_cast<ResultState>(reply.ReadInt32());
|
||||
enumResult = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -4191,7 +4191,7 @@ void CoreServiceProxy::ReadEuiccInfo2FromReply(MessageParcel &reply, EuiccInfo2
|
||||
euiccInfo2.ppVersion_ = reply.ReadString();
|
||||
euiccInfo2.sasAccreditationNumber_ = reply.ReadString();
|
||||
euiccInfo2.response_ = reply.ReadString();
|
||||
euiccInfo2.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
euiccInfo2.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
}
|
||||
|
||||
int32_t CoreServiceProxy::GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2)
|
||||
@ -4245,7 +4245,7 @@ int32_t CoreServiceProxy::RealAuthenticateServer(
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
responseResult.resultCode_ = static_cast<ResultState>(reply.ReadInt32());
|
||||
responseResult.resultCode_ = static_cast<ResultCode>(reply.ReadInt32());
|
||||
responseResult.response_ = reply.ReadString16();
|
||||
}
|
||||
return result;
|
||||
|
@ -28,7 +28,7 @@ bool DownloadProfileResult::ReadFromParcel(Parcel &parcel)
|
||||
!parcel.ReadUint32(cardId_)) {
|
||||
return false;
|
||||
}
|
||||
result_ = static_cast<ResultState>(resultValue);
|
||||
result_ = static_cast<ResultCode>(resultValue);
|
||||
resolvableErrors_ = static_cast<SolvableErrors>(resolvableErrorsValue);
|
||||
return true;
|
||||
}
|
||||
|
@ -314,14 +314,14 @@ int32_t EsimServiceClient::CancelSession(
|
||||
return proxy->CancelSession(slotId, transactionId, cancelReason, responseResult);
|
||||
}
|
||||
|
||||
bool EsimServiceClient::IsEsimSupported(int32_t slotId)
|
||||
bool EsimServiceClient::IsSupported(int32_t slotId)
|
||||
{
|
||||
auto proxy = GetProxy();
|
||||
if (proxy == nullptr) {
|
||||
TELEPHONY_LOGE("proxy is null!");
|
||||
return false;
|
||||
}
|
||||
return proxy->IsEsimSupported(slotId);
|
||||
return proxy->IsSupported(slotId);
|
||||
}
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -26,7 +26,7 @@ bool GetDownloadableProfilesResult::ReadFromParcel(Parcel &parcel)
|
||||
if (!parcel.ReadInt32(resultValue)) {
|
||||
return false;
|
||||
}
|
||||
result_ = static_cast<ResultState>(resultValue);
|
||||
result_ = static_cast<ResultCode>(resultValue);
|
||||
|
||||
uint32_t size;
|
||||
if (!parcel.ReadUint32(size)) {
|
||||
|
@ -61,7 +61,7 @@ bool GetEuiccProfileInfoListResult::ReadFromParcel(Parcel &parcel)
|
||||
if (!parcel.ReadInt32(resultValue)) {
|
||||
return false;
|
||||
}
|
||||
result_ = static_cast<ResultState>(resultValue);
|
||||
result_ = static_cast<ResultCode>(resultValue);
|
||||
|
||||
uint32_t size;
|
||||
if (!parcel.ReadUint32(size)) {
|
||||
|
@ -55,7 +55,7 @@ bool GetDownloadableProfileMetadataResult::ReadFromParcel(Parcel &parcel)
|
||||
return false;
|
||||
}
|
||||
resolvableErrors_ = static_cast<SolvableErrors>(resolvableErrorsValue);
|
||||
result_ = static_cast<ResultState>(resultValue);
|
||||
result_ = static_cast<ResultCode>(resultValue);
|
||||
profileClass_ = static_cast<ProfileClass>(profileClassValue);
|
||||
|
||||
return true;
|
||||
|
@ -25,7 +25,7 @@ bool ResponseEsimResult::ReadFromParcel(Parcel &parcel)
|
||||
if (!parcel.ReadInt32(resultValue) || !parcel.ReadString16(response_)) {
|
||||
return false;
|
||||
}
|
||||
resultCode_ = static_cast<ResultState>(resultValue);
|
||||
resultCode_ = static_cast<ResultCode>(resultValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -64,5 +64,5 @@ interface OHOS.Telephony.IEsimService {
|
||||
void GetDefaultSmdpAddress([in] int slotId, [out] String defaultSmdpAddress);
|
||||
void CancelSession([in] int slotId, [in] String transactionId, [in] int cancelReason,
|
||||
[out] ResponseEsimResult responseResult);
|
||||
void IsEsimSupported([in] int slotId);
|
||||
void IsSupported([in] int slotId);
|
||||
}
|
@ -957,7 +957,7 @@ public:
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult);
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Requests the SM-DS address from eUICC.
|
||||
@ -1029,7 +1029,7 @@ public:
|
||||
* @param enumResult[out], the response to obtain
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult);
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief This procedure is used to set or update the Default SM-DP+ address stored in an eUICC.
|
||||
@ -1039,7 +1039,7 @@ public:
|
||||
* @param enumResult[out], the response to obtain
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t SetDefaultSmdpAddress(int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult);
|
||||
int32_t SetDefaultSmdpAddress(int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Whether support for esim
|
||||
@ -1047,7 +1047,7 @@ public:
|
||||
* @param slotId[in], sim slot id
|
||||
* @return returns true if the device support; returns false otherwise.
|
||||
*/
|
||||
bool IsEsimSupported(int32_t slotId);
|
||||
bool IsSupported(int32_t slotId);
|
||||
|
||||
/**
|
||||
* @brief Provide sending upgrade or card binding data to the ESIM channel.
|
||||
@ -1137,7 +1137,7 @@ public:
|
||||
* @param enumResult[out], get the result code
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t RemoveNotificationFromList(int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult);
|
||||
int32_t RemoveNotificationFromList(int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Deletes the given profile.
|
||||
@ -1147,7 +1147,7 @@ public:
|
||||
* @param enumResult[out], the response to obtain
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult);
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Obtain the international mobile subscriber identity
|
||||
@ -1161,7 +1161,7 @@ public:
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t SwitchToProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile,
|
||||
ResultState &enumResult);
|
||||
ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Obtain the international mobile subscriber identity
|
||||
@ -1173,7 +1173,7 @@ public:
|
||||
* @return int32_t TELEPHONY_SUCCESS on success, others on failure.
|
||||
*/
|
||||
int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult);
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult);
|
||||
|
||||
/**
|
||||
* @brief Gets the eUICC info2 defined in GSMA RSP v2.0+ for new profile downloading.
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
int32_t GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListResult &euiccProfileInfoList) override;
|
||||
int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo) override;
|
||||
int32_t DisableProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh,
|
||||
ResultState &enumResult) override;
|
||||
ResultCode &enumResult) override;
|
||||
int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress) override;
|
||||
int32_t ParseRulesAuthTableReply(MessageParcel &reply, EuiccRulesAuthTable &eUiccRulesAuthTable);
|
||||
int32_t GetRulesAuthTable(
|
||||
@ -162,10 +162,10 @@ public:
|
||||
CancelReason cancelReason, ResponseEsimResult &responseResult) override;
|
||||
int32_t GetProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId,
|
||||
EuiccProfile &eUiccProfile) override;
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) override;
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) override;
|
||||
int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) override;
|
||||
bool IsEsimSupported(int32_t slotId) override;
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) override;
|
||||
bool IsSupported(int32_t slotId) override;
|
||||
int32_t SendApduData(int32_t slotId, const std::u16string &aid, const EsimApduData &apduData,
|
||||
ResponseEsimResult &responseResult) override;
|
||||
int32_t PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
|
||||
@ -179,12 +179,12 @@ public:
|
||||
int32_t RetrieveNotification(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification) override;
|
||||
int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) override;
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) override;
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) override;
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) override;
|
||||
int32_t SwitchToProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile,
|
||||
ResultState &enumResult) override;
|
||||
ResultCode &enumResult) override;
|
||||
int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) override;
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) override;
|
||||
int32_t GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2) override;
|
||||
int32_t AuthenticateServer(int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo,
|
||||
ResponseEsimResult &responseResult) override;
|
||||
|
@ -26,7 +26,7 @@ namespace Telephony {
|
||||
* @brief Result set for downloading configuration files.
|
||||
*/
|
||||
struct DownloadProfileResult : public Parcelable {
|
||||
ResultState result_;
|
||||
ResultCode result_;
|
||||
SolvableErrors resolvableErrors_;
|
||||
uint32_t cardId_ = 0;
|
||||
|
||||
|
@ -219,7 +219,7 @@ public:
|
||||
* @param slotId[in], indicates the card slot index number.
|
||||
* @return Return true if the eSIM capability is supported; return false otherwise.
|
||||
*/
|
||||
bool IsEsimSupported(int32_t slotId);
|
||||
bool IsSupported(int32_t slotId);
|
||||
|
||||
private:
|
||||
void RemoveDeathRecipient(const wptr<IRemoteObject> &remote, bool isRemoteDied);
|
||||
|
@ -24,24 +24,57 @@
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
/**
|
||||
* @brief Result state.
|
||||
* @brief Result code.
|
||||
*/
|
||||
enum class ResultState {
|
||||
enum class ResultCode {
|
||||
RESULT_SOLVABLE_ERRORS = -2,
|
||||
RESULT_MUST_DISABLE_PROFILE = -1,
|
||||
RESULT_OK = 0,
|
||||
RESULT_UNDEFINED_ERROR = 1,
|
||||
RESULT_GET_EID_FAILED = 201,
|
||||
RESULT_ACTIVATION_CODE_CHANGED = 203,
|
||||
RESULT_ACTIVATION_CODE_INVALID = 204,
|
||||
RESULT_SMDP_ADDRESS_INVALID = 205,
|
||||
RESULT_EUICC_INFO_INVALID = 206,
|
||||
RESULT_TLS_HANDSHAKE_FAILED = 207,
|
||||
RESULT_CERTIFICATE_IO_ERROR = 208,
|
||||
RESULT_CERTIFICATE_RESPONSE_TIMEOUT = 209,
|
||||
RESULT_AUTHENTICATION_FAILED = 210,
|
||||
RESULT_RESPONSE_HTTP_FAILED = 211,
|
||||
RESULT_CONFIRMATION_CODE_INCORRECT = 212,
|
||||
RESULT_EXCEEDED_CONFIRMATION_CODE_TRY_LIMIT = 213,
|
||||
RESULT_NO_PROFILE_ON_SERVER = 214,
|
||||
RESULT_TRANSACTION_ID_INVALID = 215,
|
||||
RESULT_SERVER_ADDRESS_INVALID = 216,
|
||||
RESULT_GET_BOUND_PROFILE_PACKAGE_FAILED = 217,
|
||||
RESULT_USER_CANCEL_DOWNLOAD = 218,
|
||||
RESULT_SERVER_UNAVAILABLE = 220,
|
||||
RESULT_PROFILE_NON_DELETE = 223,
|
||||
RESULT_SMDP_ADDRESS_INCORRECT = 226,
|
||||
RESULT_ANALYZE_AUTHENTICATION_SERVER_RESPONSE_FAILED = 228,
|
||||
RESULT_ANALYZE_AUTHENTICATION_CLIENT_RESPONSE_FAILED = 229,
|
||||
RESULT_ANALYZE_AUTHENTICATION_CLIENT_MATCHING_ID_REFUSED = 231,
|
||||
RESULT_PROFILE_TYPE_ERROR_AUTHENTICATION_STOPPED = 233,
|
||||
RESULT_CARRIER_SERVER_REFUSED_ERRORS = 249,
|
||||
RESULT_CERTIFICATE_INVALID = 251,
|
||||
RESULT_OUT_OF_MEMORY = 263,
|
||||
RESULT_PPR_FORBIDDEN = 268,
|
||||
RESULT_NOTHING_TO_DELETE = 270,
|
||||
RESULT_PPR_NOT_MATCH = 276,
|
||||
RESULT_CAT_BUSY = 283,
|
||||
RESULT_PROFILE_EID_INVALID = 284,
|
||||
RESULT_DOWNLOAD_TIMEOUT = 287,
|
||||
RESULT_SGP_22_OTHER = 400,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Euicc OTA update status.
|
||||
*/
|
||||
enum class OsuStatus {
|
||||
EUICC_UPGRAD_IN_PROGRESS = 1,
|
||||
EUICC_UPGRAD_FAILED = 2,
|
||||
EUICC_UPGRAD_SUCCESSFUL = 3,
|
||||
EUICC_UPGRAD_ALREADY_LATEST = 4,
|
||||
EUICC_UPGRAD_SERVICE_UNAVAILABLE = 5,
|
||||
EUICC_UPGRADE_IN_PROGRESS = 1,
|
||||
EUICC_UPGRADE_FAILED = 2,
|
||||
EUICC_UPGRADE_SUCCESSFUL = 3,
|
||||
EUICC_UPGRADE_ALREADY_LATEST = 4,
|
||||
EUICC_UPGRADE_SERVICE_UNAVAILABLE = 5,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -95,8 +128,8 @@ enum class PolicyRules {
|
||||
* @brief The bit map of resolvable errors.
|
||||
*/
|
||||
enum class SolvableErrors {
|
||||
SOLVABLE_ERROR_NEEED_CONFIRMATION_CODE = 1 << 0,
|
||||
SOLVABLE_ERROR_NEEED_POLICY_RULE = 1 << 1,
|
||||
SOLVABLE_ERROR_NEED_CONFIRMATION_CODE = 1 << 0,
|
||||
SOLVABLE_ERROR_NEED_POLICY_RULE = 1 << 1,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -282,7 +315,7 @@ struct EuiccInfo2 {
|
||||
std::string ppVersion_ = "";
|
||||
std::string sasAccreditationNumber_ = "";
|
||||
std::string response_ = "";
|
||||
ResultState resultCode_;
|
||||
ResultCode resultCode_;
|
||||
};
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -28,7 +28,7 @@ namespace Telephony {
|
||||
* @brief Series data of downloadable configuration files.
|
||||
*/
|
||||
struct GetDownloadableProfilesResult : public Parcelable {
|
||||
ResultState result_;
|
||||
ResultCode result_;
|
||||
std::vector<DownloadableProfile> downloadableProfiles_{};
|
||||
|
||||
bool ReadFromParcel(Parcel &parcel);
|
||||
|
@ -165,7 +165,7 @@ public:
|
||||
virtual int32_t GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListResult &euiccProfileInfoList) = 0;
|
||||
virtual int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo) = 0;
|
||||
virtual int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult) = 0;
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult) = 0;
|
||||
virtual int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress) = 0;
|
||||
virtual int32_t GetRulesAuthTable(
|
||||
int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable) = 0;
|
||||
@ -176,10 +176,10 @@ public:
|
||||
ResponseEsimResult &responseResult) = 0;
|
||||
virtual int32_t GetProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile) = 0;
|
||||
virtual int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) = 0;
|
||||
virtual int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) = 0;
|
||||
virtual bool IsEsimSupported(int32_t slotId) = 0;
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) = 0;
|
||||
virtual bool IsSupported(int32_t slotId) = 0;
|
||||
virtual int32_t SendApduData(int32_t slotId, const std::u16string &aid,
|
||||
const EsimApduData &apduData, ResponseEsimResult &responseResult) = 0;
|
||||
virtual int32_t PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
|
||||
@ -193,12 +193,12 @@ public:
|
||||
virtual int32_t RetrieveNotification(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification) = 0;
|
||||
virtual int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) = 0;
|
||||
virtual int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) = 0;
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) = 0;
|
||||
virtual int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SwitchToProfile(int32_t slotId, int32_t portIndex,
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult) = 0;
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) = 0;
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) = 0;
|
||||
virtual int32_t GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2) = 0;
|
||||
virtual int32_t AuthenticateServer(int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo,
|
||||
ResponseEsimResult &responseResult) = 0;
|
||||
|
@ -157,7 +157,7 @@ public:
|
||||
virtual int32_t GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListResult &euiccProfileInfoList) = 0;
|
||||
virtual int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo) = 0;
|
||||
virtual int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult) = 0;
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult) = 0;
|
||||
virtual int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress) = 0;
|
||||
virtual int32_t GetRulesAuthTable(
|
||||
int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable) = 0;
|
||||
@ -168,10 +168,10 @@ public:
|
||||
ResponseEsimResult &responseResult) = 0;
|
||||
virtual int32_t GetProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile) = 0;
|
||||
virtual int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) = 0;
|
||||
virtual int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) = 0;
|
||||
virtual bool IsEsimSupported(int32_t slotId) = 0;
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) = 0;
|
||||
virtual bool IsSupported(int32_t slotId) = 0;
|
||||
virtual int32_t SendApduData(int32_t slotId, const std::u16string &aid, const EsimApduData &apduData,
|
||||
ResponseEsimResult &responseResult) = 0;
|
||||
virtual int32_t PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
|
||||
@ -185,12 +185,12 @@ public:
|
||||
virtual int32_t RetrieveNotification(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification) = 0;
|
||||
virtual int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) = 0;
|
||||
virtual int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) = 0;
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) = 0;
|
||||
virtual int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SwitchToProfile(int32_t slotId, int32_t portIndex,
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult) = 0;
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult) = 0;
|
||||
virtual int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) = 0;
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) = 0;
|
||||
virtual int32_t GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2) = 0;
|
||||
virtual int32_t AuthenticateServer(int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo,
|
||||
ResponseEsimResult &responseResult) = 0;
|
||||
|
@ -28,7 +28,7 @@ namespace Telephony {
|
||||
* @brief Result of a operation.
|
||||
*/
|
||||
struct GetEuiccProfileInfoListResult : public Parcelable {
|
||||
ResultState result_;
|
||||
ResultCode result_;
|
||||
std::vector<EuiccProfile> profiles_{};
|
||||
bool isRemovable_ = false;
|
||||
|
||||
|
@ -33,7 +33,7 @@ struct GetDownloadableProfileMetadataResult : public Parcelable {
|
||||
int32_t pprType_ = 0;
|
||||
bool pprFlag_ = false;
|
||||
SolvableErrors resolvableErrors_;
|
||||
ResultState result_;
|
||||
ResultCode result_;
|
||||
std::u16string serviceProviderName_ = u"";
|
||||
std::u16string profileName_ = u"";
|
||||
std::u16string iccId_ = u"";
|
||||
|
@ -27,7 +27,7 @@ namespace Telephony {
|
||||
* @brief Result of a operation.
|
||||
*/
|
||||
struct ResponseEsimResult : public Parcelable {
|
||||
ResultState resultCode_;
|
||||
ResultCode resultCode_;
|
||||
std::u16string response_ = u"";
|
||||
int32_t sw1_ = 0;
|
||||
int32_t sw2_ = 0;
|
||||
|
@ -81,6 +81,7 @@ enum {
|
||||
TELEPHONY_ERR_MMS_FAIL_HTTP_ERROR,
|
||||
TELEPHONY_ERR_MMS_FAIL_DATA_NETWORK_ERROR,
|
||||
TELEPHONY_ERR_VCARD_FILE_INVALID,
|
||||
TELEPHONY_ERR_NOT_SUPPORT_ESIM,
|
||||
};
|
||||
|
||||
// Error code for telephony call manager
|
||||
|
@ -266,7 +266,7 @@ public:
|
||||
int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo) override;
|
||||
|
||||
int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult) override;
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult) override;
|
||||
|
||||
int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress) override;
|
||||
|
||||
@ -282,12 +282,12 @@ public:
|
||||
int32_t GetProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile) override;
|
||||
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) override;
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) override;
|
||||
|
||||
int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) override;
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) override;
|
||||
|
||||
bool IsEsimSupported(int32_t slotId) override;
|
||||
bool IsSupported(int32_t slotId) override;
|
||||
|
||||
int32_t SendApduData(int32_t slotId, const std::u16string &aid, const EsimApduData &apduData,
|
||||
ResponseEsimResult &responseResult) override;
|
||||
@ -313,15 +313,15 @@ public:
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification) override;
|
||||
|
||||
int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) override;
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) override;
|
||||
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) override;
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) override;
|
||||
|
||||
int32_t SwitchToProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId,
|
||||
bool forceDisableProfile, ResultState &enumResult) override;
|
||||
bool forceDisableProfile, ResultCode &enumResult) override;
|
||||
|
||||
int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) override;
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) override;
|
||||
#endif
|
||||
private:
|
||||
bool Init();
|
||||
|
@ -158,7 +158,7 @@ private:
|
||||
int32_t OnGetProfile(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnResetMemory(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnSetDefaultSmdpAddress(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnIsEsimSupported(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnIsSupported(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnSendApduData(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnPrepareDownload(MessageParcel &data, MessageParcel &reply);
|
||||
int32_t OnLoadBoundProfilePackage(MessageParcel &data, MessageParcel &reply);
|
||||
|
@ -1702,7 +1702,7 @@ int32_t CoreService::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
|
||||
}
|
||||
|
||||
int32_t CoreService::DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
@ -1823,7 +1823,7 @@ int32_t CoreService::GetProfile(
|
||||
return simManager_->GetProfile(slotId, portIndex, iccId, eUiccProfile);
|
||||
}
|
||||
|
||||
int32_t CoreService::ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult)
|
||||
int32_t CoreService::ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
@ -1841,7 +1841,7 @@ int32_t CoreService::ResetMemory(int32_t slotId, ResetOption resetOption, Result
|
||||
}
|
||||
|
||||
int32_t CoreService::SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
@ -1858,13 +1858,13 @@ int32_t CoreService::SetDefaultSmdpAddress(
|
||||
return simManager_->SetDefaultSmdpAddress(slotId, defaultSmdpAddress, enumResult);
|
||||
}
|
||||
|
||||
bool CoreService::IsEsimSupported(int32_t slotId)
|
||||
bool CoreService::IsSupported(int32_t slotId)
|
||||
{
|
||||
if (simManager_ == nullptr) {
|
||||
TELEPHONY_LOGE("simManager_ is null");
|
||||
return false;
|
||||
}
|
||||
return simManager_->IsEsimSupported(slotId);
|
||||
return simManager_->IsSupported(slotId);
|
||||
}
|
||||
|
||||
int32_t CoreService::SendApduData(
|
||||
@ -1976,7 +1976,7 @@ int32_t CoreService::RetrieveNotification(
|
||||
}
|
||||
|
||||
int32_t CoreService::RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
@ -1993,7 +1993,7 @@ int32_t CoreService::RemoveNotificationFromList(
|
||||
return simManager_->RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
|
||||
}
|
||||
|
||||
int32_t CoreService::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult)
|
||||
int32_t CoreService::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
@ -2011,14 +2011,14 @@ int32_t CoreService::DeleteProfile(int32_t slotId, const std::u16string &iccId,
|
||||
}
|
||||
|
||||
int32_t CoreService::SwitchToProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
return TELEPHONY_ERR_ILLEGAL_USE_OF_SYSTEM_API;
|
||||
}
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_ESIM_STATE_OPEN)) {
|
||||
TELEPHONY_LOGE("Failed because no permission:SET_TELEPHONY_ESIM_STATE_OPEN");
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_ESIM_STATE)) {
|
||||
TELEPHONY_LOGE("Failed because no permission:SET_TELEPHONY_ESIM_STATE");
|
||||
return TELEPHONY_ERR_PERMISSION_ERR;
|
||||
}
|
||||
if (simManager_ == nullptr) {
|
||||
@ -2029,14 +2029,14 @@ int32_t CoreService::SwitchToProfile(
|
||||
}
|
||||
|
||||
int32_t CoreService::SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult)
|
||||
{
|
||||
if (!TelephonyPermission::CheckCallerIsSystemApp()) {
|
||||
TELEPHONY_LOGE("Non-system applications use system APIs!");
|
||||
return TELEPHONY_ERR_ILLEGAL_USE_OF_SYSTEM_API;
|
||||
}
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_ESIM_STATE_OPEN)) {
|
||||
TELEPHONY_LOGE("Failed because no permission:SET_TELEPHONY_ESIM_STATE_OPEN");
|
||||
if (!TelephonyPermission::CheckPermission(Permission::SET_TELEPHONY_ESIM_STATE)) {
|
||||
TELEPHONY_LOGE("Failed because no permission:SET_TELEPHONY_ESIM_STATE");
|
||||
return TELEPHONY_ERR_PERMISSION_ERR;
|
||||
}
|
||||
if (simManager_ == nullptr) {
|
||||
|
@ -310,7 +310,7 @@ void CoreServiceStub::AddHandlerEsimToMap()
|
||||
memberFuncMap_[uint32_t(CoreServiceInterfaceCode::SET_DEFAULT_SMDP_ADDRESS)] =
|
||||
[this](MessageParcel &data, MessageParcel &reply) { return OnSetDefaultSmdpAddress(data, reply); };
|
||||
memberFuncMap_[uint32_t(CoreServiceInterfaceCode::IS_ESIM_SUPPORTED)] =
|
||||
[this](MessageParcel &data, MessageParcel &reply) { return OnIsEsimSupported(data, reply); };
|
||||
[this](MessageParcel &data, MessageParcel &reply) { return OnIsSupported(data, reply); };
|
||||
memberFuncMap_[uint32_t(CoreServiceInterfaceCode::PREPARE_DOWNLOAD)] =
|
||||
[this](MessageParcel &data, MessageParcel &reply) { return OnPrepareDownload(data, reply); };
|
||||
memberFuncMap_[uint32_t(CoreServiceInterfaceCode::LOAD_BOUND_PROFILE_PACKAGE)] =
|
||||
@ -2082,7 +2082,7 @@ int32_t CoreServiceStub::OnDisableProfile(MessageParcel &data, MessageParcel &re
|
||||
int32_t portIndex = data.ReadInt32();
|
||||
std::u16string iccId = data.ReadString16();
|
||||
bool refresh = data.ReadBool();
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = DisableProfile(slotId, portIndex, iccId, refresh, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2239,7 +2239,7 @@ int32_t CoreServiceStub::OnResetMemory(MessageParcel &data, MessageParcel &reply
|
||||
{
|
||||
int32_t slotId = data.ReadInt32();
|
||||
ResetOption resetOption = static_cast<ResetOption>(data.ReadInt32());
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = ResetMemory(slotId, resetOption, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2256,7 +2256,7 @@ int32_t CoreServiceStub::OnSetDefaultSmdpAddress(MessageParcel &data, MessagePar
|
||||
{
|
||||
int32_t slotId = data.ReadInt32();
|
||||
std::u16string defaultSmdpAddress = data.ReadString16();
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = SetDefaultSmdpAddress(slotId, defaultSmdpAddress, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2269,10 +2269,10 @@ int32_t CoreServiceStub::OnSetDefaultSmdpAddress(MessageParcel &data, MessagePar
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
int32_t CoreServiceStub::OnIsEsimSupported(MessageParcel &data, MessageParcel &reply)
|
||||
int32_t CoreServiceStub::OnIsSupported(MessageParcel &data, MessageParcel &reply)
|
||||
{
|
||||
int32_t slotId = data.ReadInt32();
|
||||
bool result = IsEsimSupported(slotId);
|
||||
bool result = IsSupported(slotId);
|
||||
bool ret = reply.WriteBool(result);
|
||||
if (!ret) {
|
||||
TELEPHONY_LOGE("write reply failed.");
|
||||
@ -2434,7 +2434,7 @@ int32_t CoreServiceStub::OnRemoveNotificationFromList(MessageParcel &data, Messa
|
||||
int32_t portIndex = data.ReadInt32();
|
||||
int32_t seqNumber = data.ReadInt32();
|
||||
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2451,7 +2451,7 @@ int32_t CoreServiceStub::OnDeleteProfile(MessageParcel &data, MessageParcel &rep
|
||||
{
|
||||
int32_t slotId = data.ReadInt32();
|
||||
std::u16string iccId = data.ReadString16();
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = DeleteProfile(slotId, iccId, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2470,7 +2470,7 @@ int32_t CoreServiceStub::OnSwitchToProfile(MessageParcel &data, MessageParcel &r
|
||||
int32_t portIndex = data.ReadInt32();
|
||||
std::u16string iccId = data.ReadString16();
|
||||
bool forceDisableProfile = data.ReadBool();
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = SwitchToProfile(slotId, portIndex, iccId, forceDisableProfile, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
@ -2488,7 +2488,7 @@ int32_t CoreServiceStub::OnSetProfileNickname(MessageParcel &data, MessageParcel
|
||||
int32_t slotId = data.ReadInt32();
|
||||
std::u16string iccId = data.ReadString16();
|
||||
std::u16string nickname = data.ReadString16();
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = SetProfileNickname(slotId, iccId, nickname, enumResult);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
std::string ObtainEid();
|
||||
GetEuiccProfileInfoListResult GetEuiccProfileInfoList();
|
||||
EuiccInfo GetEuiccInfo();
|
||||
ResultState DisableProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
ResultCode DisableProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
std::string ObtainSmdsAddress(int32_t portIndex);
|
||||
EuiccRulesAuthTable ObtainRulesAuthTable(int32_t portIndex);
|
||||
ResponseEsimResult ObtainEuiccChallenge(int32_t portIndex);
|
||||
@ -94,19 +94,19 @@ public:
|
||||
std::string ObtainDefaultSmdpAddress();
|
||||
ResponseEsimResult CancelSession(const std::u16string &transactionId, CancelReason cancelReason);
|
||||
EuiccProfile ObtainProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
ResultState ResetMemory(ResetOption resetOption);
|
||||
ResultState SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress);
|
||||
bool IsEsimSupported();
|
||||
ResultCode ResetMemory(ResetOption resetOption);
|
||||
ResultCode SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress);
|
||||
bool IsSupported();
|
||||
ResponseEsimResult SendApduData(const std::u16string &aid, const EsimApduData &apduData);
|
||||
ResponseEsimResult ObtainPrepareDownload(const DownLoadConfigInfo &downLoadConfigInfo);
|
||||
ResponseEsimBppResult ObtainLoadBoundProfilePackage(int32_t portIndex, const std::u16string boundProfilePackage);
|
||||
EuiccNotificationList ListNotifications(int32_t portIndex, Event events);
|
||||
EuiccNotificationList RetrieveNotificationList(int32_t portIndex, Event events);
|
||||
EuiccNotification ObtainRetrieveNotification(int32_t portIndex, int32_t seqNumber);
|
||||
ResultState RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber);
|
||||
ResultState DeleteProfile(const std::u16string &iccId);
|
||||
ResultState SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile);
|
||||
ResultState SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname);
|
||||
ResultCode RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber);
|
||||
ResultCode DeleteProfile(const std::u16string &iccId);
|
||||
ResultCode SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile);
|
||||
ResultCode SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname);
|
||||
EuiccInfo2 ObtainEuiccInfo2(int32_t portIndex);
|
||||
ResponseEsimResult AuthenticateServer(const AuthenticateConfigInfo &authenticateConfigInfo);
|
||||
|
||||
@ -233,14 +233,14 @@ private:
|
||||
EsimProfile esimProfile_;
|
||||
std::string eid_ = "";
|
||||
std::string defaultDpAddress_ = "";
|
||||
ResultState delProfile_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState setDpAddressResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState switchResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState setNicknameResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState resetResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState disableProfileResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState factoryResetResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState removeNotifResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode delProfile_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode setDpAddressResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode switchResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode setNicknameResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode resetResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode disableProfileResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode factoryResetResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
ResultCode removeNotifResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
GetEuiccProfileInfoListResult euiccProfileInfoList_;
|
||||
EuiccInfo eUiccInfo_;
|
||||
EuiccProfile eUiccProfile_;
|
||||
|
@ -96,26 +96,26 @@ public:
|
||||
std::u16string GetEid();
|
||||
GetEuiccProfileInfoListResult GetEuiccProfileInfoList();
|
||||
EuiccInfo GetEuiccInfo();
|
||||
ResultState DisableProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
ResultCode DisableProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
std::u16string GetSmdsAddress(int32_t portIndex);
|
||||
EuiccRulesAuthTable GetRulesAuthTable(int32_t portIndex);
|
||||
ResponseEsimResult GetEuiccChallenge(int32_t portIndex);
|
||||
std::u16string GetDefaultSmdpAddress();
|
||||
ResponseEsimResult CancelSession(const std::u16string &transactionId, CancelReason cancelReason);
|
||||
EuiccProfile GetProfile(int32_t portIndex, const std::u16string &iccId);
|
||||
ResultState ResetMemory(ResetOption resetOption);
|
||||
ResultState SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress);
|
||||
bool IsEsimSupported();
|
||||
ResultCode ResetMemory(ResetOption resetOption);
|
||||
ResultCode SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress);
|
||||
bool IsSupported();
|
||||
ResponseEsimResult SendApduData(const std::u16string &aid, const EsimApduData &apduData);
|
||||
ResponseEsimResult PrepareDownload(const DownLoadConfigInfo &downLoadConfigInfo);
|
||||
ResponseEsimBppResult LoadBoundProfilePackage(int32_t portIndex, const std::u16string &boundProfilePackage);
|
||||
EuiccNotificationList ListNotifications(int32_t portIndex, Event events);
|
||||
EuiccNotificationList RetrieveNotificationList(int32_t portIndex, Event events);
|
||||
EuiccNotification RetrieveNotification(int32_t portIndex, int32_t seqNumber);
|
||||
ResultState RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber);
|
||||
ResultState DeleteProfile(const std::u16string &iccId);
|
||||
ResultState SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile);
|
||||
ResultState SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname);
|
||||
ResultCode RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber);
|
||||
ResultCode DeleteProfile(const std::u16string &iccId);
|
||||
ResultCode SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile);
|
||||
ResultCode SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname);
|
||||
EuiccInfo2 GetEuiccInfo2(int32_t portIndex);
|
||||
ResponseEsimResult AuthenticateServer(const AuthenticateConfigInfo &authenticateConfigInfo);
|
||||
#endif
|
||||
|
@ -160,7 +160,7 @@ public:
|
||||
int32_t GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListResult &euiccProfileInfoList) override;
|
||||
int32_t GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo) override;
|
||||
int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult) override;
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult) override;
|
||||
int32_t GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress) override;
|
||||
int32_t GetRulesAuthTable(int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable) override;
|
||||
int32_t GetEuiccChallenge(int32_t slotId, int32_t portIndex, ResponseEsimResult &responseResult) override;
|
||||
@ -169,10 +169,10 @@ public:
|
||||
ResponseEsimResult &responseResult) override;
|
||||
int32_t GetProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile) override;
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) override;
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) override;
|
||||
int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) override;
|
||||
bool IsEsimSupported(int32_t slotId) override;
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) override;
|
||||
bool IsSupported(int32_t slotId) override;
|
||||
int32_t SendApduData(int32_t slotId, const std::u16string &aid, const EsimApduData &apduData,
|
||||
ResponseEsimResult &responseResult) override;
|
||||
int32_t PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
|
||||
@ -186,15 +186,15 @@ public:
|
||||
int32_t RetrieveNotification(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification ¬ification) override;
|
||||
int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) override;
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) override;
|
||||
int32_t GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2) override;
|
||||
int32_t AuthenticateServer(int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo,
|
||||
ResponseEsimResult &responseResult) override;
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) override;
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) override;
|
||||
int32_t SwitchToProfile(int32_t slotId, int32_t portIndex, const std::u16string &iccId,
|
||||
bool forceDisableProfile, ResultState &enumResult) override;
|
||||
bool forceDisableProfile, ResultCode &enumResult) override;
|
||||
int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) override;
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -495,7 +495,7 @@ bool EsimFile::RequestAllProfilesParseProfileInfo(std::shared_ptr<Asn1Node> &roo
|
||||
ConvertProfileInfoToApiStruct(euiccProfile, euiccProfileInfo);
|
||||
euiccProfileInfoList_.profiles_.push_back(euiccProfile);
|
||||
}
|
||||
euiccProfileInfoList_.result_ = ResultState::RESULT_OK;
|
||||
euiccProfileInfoList_.result_ = ResultCode::RESULT_OK;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -673,7 +673,7 @@ void EsimFile::BuildOperatorId(EuiccProfileInfo *eProfileInfo, std::shared_ptr<A
|
||||
return;
|
||||
}
|
||||
|
||||
ResultState EsimFile::DisableProfile(int32_t portIndex, const std::u16string &iccId)
|
||||
ResultCode EsimFile::DisableProfile(int32_t portIndex, const std::u16string &iccId)
|
||||
{
|
||||
esimProfile_.portIndex = portIndex;
|
||||
esimProfile_.iccId = iccId;
|
||||
@ -682,14 +682,14 @@ ResultState EsimFile::DisableProfile(int32_t portIndex, const std::u16string &ic
|
||||
if (!ProcessDisableProfile(slotId_, eventDisableProfile)) {
|
||||
TELEPHONY_LOGE("ProcessDisableProfile encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isDisableProfileReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(disableProfileMutex_);
|
||||
if (!disableProfileCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isDisableProfileReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return disableProfileResult_;
|
||||
@ -867,7 +867,7 @@ bool EsimFile::ProcessDisableProfileDone(const AppExecFwk::InnerEvent::Pointer &
|
||||
NotifyReady(disableProfileMutex_, isDisableProfileReady_, disableProfileCv_);
|
||||
return false;
|
||||
}
|
||||
disableProfileResult_ = static_cast<ResultState>(pAsn1Node->Asn1AsInteger());
|
||||
disableProfileResult_ = static_cast<ResultCode>(pAsn1Node->Asn1AsInteger());
|
||||
NotifyReady(disableProfileMutex_, isDisableProfileReady_, disableProfileCv_);
|
||||
return true;
|
||||
}
|
||||
@ -1033,7 +1033,7 @@ bool EsimFile::ProcessObtainEuiccChallengeDone(const AppExecFwk::InnerEvent::Poi
|
||||
return false;
|
||||
}
|
||||
std::string resultStr = Asn1Utils::BytesToHexStr(profileResponseByte);
|
||||
responseChallengeResult_.resultCode_ = ResultState::RESULT_OK;
|
||||
responseChallengeResult_.resultCode_ = ResultCode::RESULT_OK;
|
||||
responseChallengeResult_.response_ = OHOS::Telephony::ToUtf16(resultStr);
|
||||
NotifyReady(euiccChallengeMutex_, isEuiccChallengeReady_, euiccChallengeCv_);
|
||||
return true;
|
||||
@ -1255,7 +1255,7 @@ bool EsimFile::ProcessCancelSessionDone(const AppExecFwk::InnerEvent::Pointer &e
|
||||
NotifyReady(cancelSessionMutex_, isCancelSessionReady_, cancelSessionCv_);
|
||||
return false;
|
||||
}
|
||||
cancelSessionResult_.resultCode_ = ResultState::RESULT_OK;
|
||||
cancelSessionResult_.resultCode_ = ResultCode::RESULT_OK;
|
||||
cancelSessionResult_.response_ = OHOS::Telephony::ToUtf16(responseResult);
|
||||
NotifyReady(cancelSessionMutex_, isCancelSessionReady_, cancelSessionCv_);
|
||||
return true;
|
||||
@ -1301,7 +1301,7 @@ bool EsimFile::ProcessGetProfileDone(const AppExecFwk::InnerEvent::Pointer &even
|
||||
return true;
|
||||
}
|
||||
|
||||
ResultState EsimFile::ResetMemory(ResetOption resetOption)
|
||||
ResultCode EsimFile::ResetMemory(ResetOption resetOption)
|
||||
{
|
||||
esimProfile_.option = resetOption;
|
||||
SyncOpenChannel();
|
||||
@ -1309,20 +1309,20 @@ ResultState EsimFile::ResetMemory(ResetOption resetOption)
|
||||
if (!ProcessResetMemory(slotId_, eventResetMemory)) {
|
||||
TELEPHONY_LOGE("ProcessResetMemory encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isResetMemoryReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(resetMemoryMutex_);
|
||||
if (!resetMemoryCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isResetMemoryReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return resetResult_;
|
||||
}
|
||||
|
||||
ResultState EsimFile::SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress)
|
||||
ResultCode EsimFile::SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress)
|
||||
{
|
||||
esimProfile_.defaultSmdpAddress = defaultSmdpAddress;
|
||||
SyncOpenChannel();
|
||||
@ -1330,14 +1330,14 @@ ResultState EsimFile::SetDefaultSmdpAddress(const std::u16string &defaultSmdpAdd
|
||||
if (!ProcessEstablishDefaultSmdpAddress(slotId_, eventSetSmdpAddress)) {
|
||||
TELEPHONY_LOGE("ProcessEstablishDefaultSmdpAddress encode failed!!");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isSetDefaultSmdpAddressReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(setDefaultSmdpAddressMutex_);
|
||||
if (!setDefaultSmdpAddressCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isSetDefaultSmdpAddressReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return setDpAddressResult_;
|
||||
@ -1379,12 +1379,12 @@ bool EsimFile::ProcessEstablishDefaultSmdpAddressDone(const AppExecFwk::InnerEve
|
||||
NotifyReady(setDefaultSmdpAddressMutex_, isSetDefaultSmdpAddressReady_, setDefaultSmdpAddressCv_);
|
||||
return false;
|
||||
}
|
||||
setDpAddressResult_ = static_cast<ResultState>(pAsn1Node->Asn1AsInteger());
|
||||
setDpAddressResult_ = static_cast<ResultCode>(pAsn1Node->Asn1AsInteger());
|
||||
NotifyReady(setDefaultSmdpAddressMutex_, isSetDefaultSmdpAddressReady_, setDefaultSmdpAddressCv_);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool EsimFile::IsEsimSupported()
|
||||
bool EsimFile::IsSupported()
|
||||
{
|
||||
char buf[ATR_LENGTH + 1] = {0};
|
||||
GetParameter(TEL_ESIM_SUPPORT, "", buf, ATR_LENGTH);
|
||||
@ -1473,7 +1473,7 @@ bool EsimFile::ProcessResetMemoryDone(const AppExecFwk::InnerEvent::Pointer &eve
|
||||
NotifyReady(resetMemoryMutex_, isResetMemoryReady_, resetMemoryCv_);
|
||||
return false;
|
||||
}
|
||||
resetResult_ = static_cast<ResultState>(asn1NodeData->Asn1AsInteger());
|
||||
resetResult_ = static_cast<ResultCode>(asn1NodeData->Asn1AsInteger());
|
||||
NotifyReady(resetMemoryMutex_, isResetMemoryReady_, resetMemoryCv_);
|
||||
return true;
|
||||
}
|
||||
@ -1533,7 +1533,7 @@ bool EsimFile::ProcessSendApduDataDone(const AppExecFwk::InnerEvent::Pointer &ev
|
||||
NotifyReady(sendApduDataMutex_, isSendApduDataReady_, sendApduDataCv_);
|
||||
return false;
|
||||
}
|
||||
transApduDataResponse_.resultCode_ = ResultState::RESULT_OK;
|
||||
transApduDataResponse_.resultCode_ = ResultCode::RESULT_OK;
|
||||
transApduDataResponse_.response_ = OHOS::Telephony::ToUtf16(result->resultData);
|
||||
transApduDataResponse_.sw1_ = result->sw1;
|
||||
transApduDataResponse_.sw2_ = result->sw2;
|
||||
@ -1781,7 +1781,7 @@ bool EsimFile::RealProcessPrepareDownloadDone(std::string &combineHexStr)
|
||||
}
|
||||
}
|
||||
}
|
||||
preDownloadResult_.resultCode_ = ResultState::RESULT_OK;
|
||||
preDownloadResult_.resultCode_ = ResultCode::RESULT_OK;
|
||||
std::string responseByteStr = Asn1Utils::BytesToString(responseByte);
|
||||
std::string destString = VCardUtils::EncodeBase64(responseByteStr);
|
||||
preDownloadResult_.response_ = OHOS::Telephony::ToUtf16(destString);
|
||||
@ -2214,7 +2214,7 @@ EuiccNotification EsimFile::ObtainRetrieveNotification(int32_t portIndex, int32_
|
||||
return notification_;
|
||||
}
|
||||
|
||||
ResultState EsimFile::RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber)
|
||||
ResultCode EsimFile::RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber)
|
||||
{
|
||||
esimProfile_.portIndex = portIndex;
|
||||
esimProfile_.seqNumber = seqNumber;
|
||||
@ -2223,14 +2223,14 @@ ResultState EsimFile::RemoveNotificationFromList(int32_t portIndex, int32_t seqN
|
||||
if (!ProcessRemoveNotification(slotId_, eventRemoveNotif)) {
|
||||
TELEPHONY_LOGE("ProcessRemoveNotification encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isRemoveNotificationReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(removeNotificationMutex_);
|
||||
if (!removeNotificationCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isRemoveNotificationReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return removeNotifResult_;
|
||||
@ -2450,12 +2450,12 @@ bool EsimFile::ProcessRemoveNotificationDone(const AppExecFwk::InnerEvent::Point
|
||||
NotifyReady(removeNotificationMutex_, isRemoveNotificationReady_, removeNotificationCv_);
|
||||
return false;
|
||||
}
|
||||
removeNotifResult_ = static_cast<ResultState>(node->Asn1AsInteger());
|
||||
removeNotifResult_ = static_cast<ResultCode>(node->Asn1AsInteger());
|
||||
NotifyReady(removeNotificationMutex_, isRemoveNotificationReady_, removeNotificationCv_);
|
||||
return true;
|
||||
}
|
||||
|
||||
ResultState EsimFile::DeleteProfile(const std::u16string &iccId)
|
||||
ResultCode EsimFile::DeleteProfile(const std::u16string &iccId)
|
||||
{
|
||||
esimProfile_.iccId = iccId;
|
||||
SyncOpenChannel();
|
||||
@ -2463,20 +2463,20 @@ ResultState EsimFile::DeleteProfile(const std::u16string &iccId)
|
||||
if (!ProcessDeleteProfile(slotId_, eventDeleteProfile)) {
|
||||
TELEPHONY_LOGE("ProcessDeleteProfile encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isDeleteProfileReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(deleteProfileMutex_);
|
||||
if (!deleteProfileCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isDeleteProfileReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return delProfile_;
|
||||
}
|
||||
|
||||
ResultState EsimFile::SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile)
|
||||
ResultCode EsimFile::SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile)
|
||||
{
|
||||
esimProfile_.portIndex = portIndex;
|
||||
esimProfile_.iccId = iccId;
|
||||
@ -2486,20 +2486,20 @@ ResultState EsimFile::SwitchToProfile(int32_t portIndex, const std::u16string &i
|
||||
if (!ProcessSwitchToProfile(slotId_, eventSwitchToProfile)) {
|
||||
TELEPHONY_LOGE("ProcessSwitchToProfile encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isSwitchToProfileReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(switchToProfileMutex_);
|
||||
if (!switchToProfileCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isSwitchToProfileReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return switchResult_;
|
||||
}
|
||||
|
||||
ResultState EsimFile::SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname)
|
||||
ResultCode EsimFile::SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname)
|
||||
{
|
||||
esimProfile_.iccId = iccId;
|
||||
esimProfile_.nickname = nickname;
|
||||
@ -2508,14 +2508,14 @@ ResultState EsimFile::SetProfileNickname(const std::u16string &iccId, const std:
|
||||
if (!ProcessSetNickname(slotId_, eventSetNickName)) {
|
||||
TELEPHONY_LOGE("ProcessSetNickname encode failed");
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
isSetNicknameReady_ = false;
|
||||
std::unique_lock<std::mutex> lock(setNicknameMutex_);
|
||||
if (!setNicknameCv_.wait_for(lock, std::chrono::seconds(WAIT_TIME_LONG_SECOND_FOR_ESIM),
|
||||
[this]() { return isSetNicknameReady_; })) {
|
||||
SyncCloseChannel();
|
||||
return ResultState();
|
||||
return ResultCode();
|
||||
}
|
||||
SyncCloseChannel();
|
||||
return setNicknameResult_;
|
||||
@ -2590,7 +2590,7 @@ bool EsimFile::ProcessDeleteProfileDone(const AppExecFwk::InnerEvent::Pointer &e
|
||||
NotifyReady(deleteProfileMutex_, isDeleteProfileReady_, deleteProfileCv_);
|
||||
return false;
|
||||
}
|
||||
delProfile_ = static_cast<ResultState>(Asn1NodeData->Asn1AsInteger());
|
||||
delProfile_ = static_cast<ResultCode>(Asn1NodeData->Asn1AsInteger());
|
||||
NotifyReady(deleteProfileMutex_, isDeleteProfileReady_, deleteProfileCv_);
|
||||
return true;
|
||||
}
|
||||
@ -2643,7 +2643,7 @@ bool EsimFile::ProcessSwitchToProfileDone(const AppExecFwk::InnerEvent::Pointer
|
||||
NotifyReady(switchToProfileMutex_, isSwitchToProfileReady_, switchToProfileCv_);
|
||||
return false;
|
||||
}
|
||||
switchResult_ = static_cast<ResultState>(asn1NodeData->Asn1AsInteger());
|
||||
switchResult_ = static_cast<ResultCode>(asn1NodeData->Asn1AsInteger());
|
||||
NotifyReady(switchToProfileMutex_, isSwitchToProfileReady_, switchToProfileCv_);
|
||||
return true;
|
||||
}
|
||||
@ -2662,7 +2662,7 @@ bool EsimFile::ProcessSetNicknameDone(const AppExecFwk::InnerEvent::Pointer &eve
|
||||
NotifyReady(setNicknameMutex_, isSetNicknameReady_, setNicknameCv_);
|
||||
return false;
|
||||
}
|
||||
setNicknameResult_ = static_cast<ResultState>(asn1NodeData->Asn1AsInteger());
|
||||
setNicknameResult_ = static_cast<ResultCode>(asn1NodeData->Asn1AsInteger());
|
||||
NotifyReady(setNicknameMutex_, isSetNicknameReady_, setNicknameCv_);
|
||||
return true;
|
||||
}
|
||||
@ -2900,7 +2900,7 @@ bool EsimFile::ProcessObtainEuiccInfo2Done(const AppExecFwk::InnerEvent::Pointer
|
||||
this->EuiccInfo2ParseEuiccCiPKIdListForSigning(euiccInfo2Result_, root);
|
||||
this->EuiccInfo2ParseEuiccCategory(euiccInfo2Result_, root);
|
||||
this->EuiccInfo2ParsePpVersion(euiccInfo2Result_, root);
|
||||
euiccInfo2Result_.resultCode_ = ResultState::RESULT_OK;
|
||||
euiccInfo2Result_.resultCode_ = ResultCode::RESULT_OK;
|
||||
euiccInfo2Result_.response_ = newRecvData_.resultData;
|
||||
NotifyReady(euiccInfo2Mutex_, isEuiccInfo2Ready_, euiccInfo2Cv_);
|
||||
return true;
|
||||
@ -3134,7 +3134,7 @@ bool EsimFile::ProcessAuthenticateServerDone(const AppExecFwk::InnerEvent::Point
|
||||
|
||||
void EsimFile::CovertAuthToApiStruct(ResponseEsimResult &dst, AuthServerResponse &src)
|
||||
{
|
||||
dst.resultCode_ = static_cast<ResultState>(src.errCode);
|
||||
dst.resultCode_ = static_cast<ResultCode>(src.errCode);
|
||||
std::string hexStr = Asn1Utils::BytesToHexStr(src.respStr);
|
||||
dst.response_ = OHOS::Telephony::ToUtf16(hexStr);
|
||||
}
|
||||
|
@ -1024,13 +1024,13 @@ EuiccInfo SimFileManager::GetEuiccInfo()
|
||||
return eSimFile_->GetEuiccInfo();
|
||||
}
|
||||
|
||||
ResultState SimFileManager::DisableProfile(int32_t portIndex, const std::u16string &iccId)
|
||||
ResultCode SimFileManager::DisableProfile(int32_t portIndex, const std::u16string &iccId)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState enumResult = eSimFile_->DisableProfile(portIndex, iccId);
|
||||
ResultCode enumResult = eSimFile_->DisableProfile(portIndex, iccId);
|
||||
return enumResult;
|
||||
}
|
||||
|
||||
@ -1094,33 +1094,33 @@ EuiccProfile SimFileManager::GetProfile(int32_t portIndex, const std::u16string
|
||||
return result;
|
||||
}
|
||||
|
||||
ResultState SimFileManager::ResetMemory(ResetOption resetOption)
|
||||
ResultCode SimFileManager::ResetMemory(ResetOption resetOption)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState result = eSimFile_->ResetMemory(resetOption);
|
||||
ResultCode result = eSimFile_->ResetMemory(resetOption);
|
||||
return result;
|
||||
}
|
||||
|
||||
ResultState SimFileManager::SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress)
|
||||
ResultCode SimFileManager::SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState result = eSimFile_->SetDefaultSmdpAddress(defaultSmdpAddress);
|
||||
ResultCode result = eSimFile_->SetDefaultSmdpAddress(defaultSmdpAddress);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SimFileManager::IsEsimSupported()
|
||||
bool SimFileManager::IsSupported()
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return false;
|
||||
}
|
||||
bool result = eSimFile_->IsEsimSupported();
|
||||
bool result = eSimFile_->IsSupported();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1183,42 +1183,42 @@ EuiccNotification SimFileManager::RetrieveNotification(int32_t portIndex, int32_
|
||||
return eSimFile_->ObtainRetrieveNotification(portIndex, seqNumber);
|
||||
}
|
||||
|
||||
ResultState SimFileManager::RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber)
|
||||
ResultCode SimFileManager::RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("RemoveNotificationFromList eSimFile_ is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
return eSimFile_->RemoveNotificationFromList(portIndex, seqNumber);
|
||||
}
|
||||
|
||||
ResultState SimFileManager::DeleteProfile(const std::u16string &iccId)
|
||||
ResultCode SimFileManager::DeleteProfile(const std::u16string &iccId)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState result = eSimFile_->DeleteProfile(iccId);
|
||||
ResultCode result = eSimFile_->DeleteProfile(iccId);
|
||||
return result;
|
||||
}
|
||||
|
||||
ResultState SimFileManager::SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile)
|
||||
ResultCode SimFileManager::SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState result = eSimFile_->SwitchToProfile(portIndex, iccId, forceDisableProfile);
|
||||
ResultCode result = eSimFile_->SwitchToProfile(portIndex, iccId, forceDisableProfile);
|
||||
return result;
|
||||
}
|
||||
|
||||
ResultState SimFileManager::SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname)
|
||||
ResultCode SimFileManager::SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname)
|
||||
{
|
||||
if (eSimFile_ == nullptr) {
|
||||
TELEPHONY_LOGE("esimFile is nullptr");
|
||||
return ResultState::RESULT_UNDEFINED_ERROR;
|
||||
return ResultCode::RESULT_SGP_22_OTHER;
|
||||
}
|
||||
ResultState result = eSimFile_->SetProfileNickname(iccId, nickname);
|
||||
ResultCode result = eSimFile_->SetProfileNickname(iccId, nickname);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ int32_t SimManager::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
|
||||
}
|
||||
|
||||
int32_t SimManager::DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simFileManager is null!");
|
||||
@ -1354,7 +1354,7 @@ int32_t SimManager::CancelSession(
|
||||
return TELEPHONY_ERR_LOCAL_PTR_NULL;
|
||||
}
|
||||
responseResult = simFileManager_[slotId]->CancelSession(transactionId, cancelReason);
|
||||
if (responseResult.resultCode_ != ResultState::RESULT_OK) {
|
||||
if (responseResult.resultCode_ != ResultCode::RESULT_OK) {
|
||||
return TELEPHONY_ERR_FAIL;
|
||||
}
|
||||
return TELEPHONY_ERR_SUCCESS;
|
||||
@ -1374,7 +1374,7 @@ int32_t SimManager::GetProfile(
|
||||
return TELEPHONY_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t SimManager::ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult)
|
||||
int32_t SimManager::ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("slotId is invalid or simFileManager_ is null!");
|
||||
@ -1385,7 +1385,7 @@ int32_t SimManager::ResetMemory(int32_t slotId, ResetOption resetOption, ResultS
|
||||
}
|
||||
|
||||
int32_t SimManager::SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("slotId is invalid or simFileManager_ is null!");
|
||||
@ -1395,13 +1395,13 @@ int32_t SimManager::SetDefaultSmdpAddress(
|
||||
return TELEPHONY_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
bool SimManager::IsEsimSupported(int32_t slotId)
|
||||
bool SimManager::IsSupported(int32_t slotId)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("slotId is invalid or simFileManager_ is null!");
|
||||
return false;
|
||||
}
|
||||
return simFileManager_[slotId]->IsEsimSupported();
|
||||
return simFileManager_[slotId]->IsSupported();
|
||||
}
|
||||
|
||||
int32_t SimManager::SendApduData(
|
||||
@ -1471,7 +1471,7 @@ int32_t SimManager::RetrieveNotification(
|
||||
}
|
||||
|
||||
int32_t SimManager::RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("RemoveNotificationFromList simFileManager is null!");
|
||||
@ -1481,7 +1481,7 @@ int32_t SimManager::RemoveNotificationFromList(
|
||||
return TELEPHONY_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int32_t SimManager::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult)
|
||||
int32_t SimManager::DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simFileManager is null!");
|
||||
@ -1492,7 +1492,7 @@ int32_t SimManager::DeleteProfile(int32_t slotId, const std::u16string &iccId, R
|
||||
}
|
||||
|
||||
int32_t SimManager::SwitchToProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult)
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simFileManager is null!");
|
||||
@ -1503,7 +1503,7 @@ int32_t SimManager::SwitchToProfile(
|
||||
}
|
||||
|
||||
int32_t SimManager::SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult)
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult)
|
||||
{
|
||||
if ((!IsValidSlotId(slotId, simFileManager_)) || (simFileManager_[slotId] == nullptr)) {
|
||||
TELEPHONY_LOGE("simFileManager is null!");
|
||||
|
@ -92,7 +92,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, DisableProfile_0100, Function | Medium
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState disableProfileResult;
|
||||
ResultCode disableProfileResult;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result =
|
||||
CoreServiceClient::GetInstance().DisableProfile(slotId, portIndex, iccId, refresh, disableProfileResult);
|
||||
@ -164,7 +164,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, GetProfile_0100, Function | MediumTest
|
||||
HWTEST_F(EsimCoreServiceClientBranchTest, ResetMemory_0100, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
ResultState ResetMemoryResult;
|
||||
ResultCode ResetMemoryResult;
|
||||
const ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().ResetMemory(slotId, resetOption, ResetMemoryResult);
|
||||
@ -175,18 +175,18 @@ HWTEST_F(EsimCoreServiceClientBranchTest, SetDefaultSmdpAddress_0100, Function |
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState SetAddressResult;
|
||||
ResultCode SetAddressResult;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().
|
||||
SetDefaultSmdpAddress(slotId, defaultSmdpAddress, SetAddressResult);
|
||||
EXPECT_EQ(result, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceClientBranchTest, IsEsimSupported_0100, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimCoreServiceClientBranchTest, IsSupported_0100, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().IsEsimSupported(slotId);
|
||||
int32_t result = CoreServiceClient::GetInstance().IsSupported(slotId);
|
||||
EXPECT_EQ(result, false);
|
||||
}
|
||||
|
||||
@ -266,7 +266,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, RemoveNotificationFromList_0100, Funct
|
||||
int32_t slotId = 0;
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().RemoveNotificationFromList(slotId, portIndex,
|
||||
@ -278,7 +278,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, DeleteProfile_0001, Function | MediumT
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState DeleteProfileResult;
|
||||
ResultCode DeleteProfileResult;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().DeleteProfile(slotId, iccId, DeleteProfileResult);
|
||||
EXPECT_EQ(result, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -290,7 +290,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, SwitchToProfile_0100, Function | Mediu
|
||||
int32_t portIndex = 1;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().SwitchToProfile(
|
||||
slotId, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
@ -302,7 +302,7 @@ HWTEST_F(EsimCoreServiceClientBranchTest, SetProfileNickname_0100, Function | Me
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState UpdateResult;
|
||||
ResultCode UpdateResult;
|
||||
EXPECT_CALL(*samgr, CheckSystemAbility(testing::_)).WillOnce(testing::Return(nullptr));
|
||||
int32_t result = CoreServiceClient::GetInstance().SetProfileNickname(slotId, iccId, nickname, UpdateResult);
|
||||
EXPECT_EQ(result, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
|
@ -78,7 +78,7 @@ HWTEST_F(EsimCoreServiceClientTest, DisableProfile_0001, Function | MediumTest |
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState disableProfileResult;
|
||||
ResultCode disableProfileResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().DisableProfile(
|
||||
slotId, portIndex, iccId, refresh, disableProfileResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
@ -143,7 +143,7 @@ HWTEST_F(EsimCoreServiceClientTest, GetProfile_0001, Function | MediumTest | Lev
|
||||
HWTEST_F(EsimCoreServiceClientTest, ResetMemory_0001, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
ResultState ResetMemoryResult;
|
||||
ResultCode ResetMemoryResult;
|
||||
const ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
int32_t result = CoreServiceClient::GetInstance().ResetMemory(slotId, resetOption, ResetMemoryResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
@ -153,16 +153,16 @@ HWTEST_F(EsimCoreServiceClientTest, SetDefaultSmdpAddress_0001, Function | Mediu
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState SetAddressResult;
|
||||
ResultCode SetAddressResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().SetDefaultSmdpAddress(
|
||||
slotId, defaultSmdpAddress, SetAddressResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceClientTest, IsEsimSupported_0001, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimCoreServiceClientTest, IsSupported_0001, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
bool result = CoreServiceClient::GetInstance().IsEsimSupported(slotId);
|
||||
bool result = CoreServiceClient::GetInstance().IsSupported(slotId);
|
||||
EXPECT_NE(result, true);
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ HWTEST_F(EsimCoreServiceClientTest, RemoveNotificationFromList_0001, Function |
|
||||
int32_t slotId = 0;
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().RemoveNotificationFromList(
|
||||
slotId, portIndex, seqNumber, enumResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
@ -245,7 +245,7 @@ HWTEST_F(EsimCoreServiceClientTest, DeleteProfile_0001, Function | MediumTest |
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState DeleteProfileResult;
|
||||
ResultCode DeleteProfileResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().DeleteProfile(slotId, iccId, DeleteProfileResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
}
|
||||
@ -256,7 +256,7 @@ HWTEST_F(EsimCoreServiceClientTest, SwitchToProfile_0001, Function | MediumTest
|
||||
int32_t portIndex = 1;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().SwitchToProfile(
|
||||
slotId, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
@ -267,7 +267,7 @@ HWTEST_F(EsimCoreServiceClientTest, SetProfileNickname_0001, Function | MediumTe
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState UpdateResult;
|
||||
ResultCode UpdateResult;
|
||||
int32_t result = CoreServiceClient::GetInstance().SetProfileNickname(slotId, iccId, nickname, UpdateResult);
|
||||
EXPECT_NE(result, TELEPHONY_SUCCESS);
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DisableProfile_001, Function | MediumTest | L
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState DisableProfileResult;
|
||||
ResultCode DisableProfileResult;
|
||||
int32_t ret = proxy.DisableProfile(SLOT_ID, portIndex, iccId, refresh, DisableProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -221,7 +221,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DisableProfile_002, Function | MediumTest | L
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState DisableProfileResult;
|
||||
ResultCode DisableProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.DisableProfile(SLOT_ID, portIndex, iccId, refresh, DisableProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -234,7 +234,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DisableProfile_003, Function | MediumTest | L
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState DisableProfileResult;
|
||||
ResultCode DisableProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.DisableProfile(SLOT_ID, portIndex, iccId, refresh, DisableProfileResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
@ -451,7 +451,7 @@ HWTEST_F(EsimCoreServiceProxyTest, ResetMemory_001, Function | MediumTest | Leve
|
||||
CoreServiceProxy proxy(remote);
|
||||
|
||||
ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
ResultState resetMemoryResult;
|
||||
ResultCode resetMemoryResult;
|
||||
int32_t ret = proxy.ResetMemory(SLOT_ID, resetOption, resetMemoryResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -461,7 +461,7 @@ HWTEST_F(EsimCoreServiceProxyTest, ResetMemory_002, Function | MediumTest | Leve
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
ResultState resetMemoryResult;
|
||||
ResultCode resetMemoryResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.ResetMemory(SLOT_ID, resetOption, resetMemoryResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -472,7 +472,7 @@ HWTEST_F(EsimCoreServiceProxyTest, ResetMemory_003, Function | MediumTest | Leve
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
ResultState resetMemoryResult;
|
||||
ResultCode resetMemoryResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.ResetMemory(SLOT_ID, resetOption, resetMemoryResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
@ -483,7 +483,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_001, Function | MediumT
|
||||
sptr<MockIRemoteObject> remote = nullptr;
|
||||
CoreServiceProxy proxy(remote);
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState setAddressResult;
|
||||
ResultCode setAddressResult;
|
||||
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -493,7 +493,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_002, Function | MediumT
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState setAddressResult;
|
||||
ResultCode setAddressResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -504,33 +504,33 @@ HWTEST_F(EsimCoreServiceProxyTest, SetDefaultSmdpAddress_003, Function | MediumT
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState setAddressResult;
|
||||
ResultCode setAddressResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.SetDefaultSmdpAddress(SLOT_ID, defaultSmdpAddress, setAddressResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsEsimSupported_001, Function | MediumTest | Level2)
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsSupported_001, Function | MediumTest | Level2)
|
||||
{
|
||||
sptr<MockIRemoteObject> remote = nullptr;
|
||||
CoreServiceProxy proxy(remote);
|
||||
EXPECT_FALSE(proxy.IsEsimSupported(SLOT_ID));
|
||||
EXPECT_FALSE(proxy.IsSupported(SLOT_ID));
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsEsimSupported_002, Function | MediumTest | Level2)
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsSupported_002, Function | MediumTest | Level2)
|
||||
{
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
EXPECT_FALSE(proxy.IsEsimSupported(SLOT_ID));
|
||||
EXPECT_FALSE(proxy.IsSupported(SLOT_ID));
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsEsimSupported_003, Function | MediumTest | Level2)
|
||||
HWTEST_F(EsimCoreServiceProxyTest, IsSupported_003, Function | MediumTest | Level2)
|
||||
{
|
||||
sptr<MockIRemoteObject> remote = new (std::nothrow) MockIRemoteObject();
|
||||
CoreServiceProxy proxy(remote);
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
EXPECT_FALSE(proxy.IsEsimSupported(SLOT_ID));
|
||||
EXPECT_FALSE(proxy.IsSupported(SLOT_ID));
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceProxyTest, SendApduData_001, Function | MediumTest | Level2)
|
||||
@ -751,7 +751,7 @@ HWTEST_F(EsimCoreServiceProxyTest, RemoveNotificationFromList_001, Function | Me
|
||||
CoreServiceProxy proxy(remote);
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
EXPECT_EQ(proxy.RemoveNotificationFromList(SLOT_ID, portIndex, seqNumber, enumResult),
|
||||
TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -762,7 +762,7 @@ HWTEST_F(EsimCoreServiceProxyTest, RemoveNotificationFromList_002, Function | Me
|
||||
CoreServiceProxy proxy(remote);
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
EXPECT_EQ(proxy.RemoveNotificationFromList(SLOT_ID, portIndex, seqNumber, enumResult),
|
||||
TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -774,7 +774,7 @@ HWTEST_F(EsimCoreServiceProxyTest, RemoveNotificationFromList_003, Function | Me
|
||||
CoreServiceProxy proxy(remote);
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
EXPECT_EQ(proxy.RemoveNotificationFromList(SLOT_ID, portIndex, seqNumber, enumResult), 0);
|
||||
}
|
||||
@ -785,7 +785,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DeleteProfile_001, Function | MediumTest | Le
|
||||
CoreServiceProxy proxy(remote);
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState deleteProfileResult;
|
||||
ResultCode deleteProfileResult;
|
||||
int32_t ret = proxy.DeleteProfile(SLOT_ID, iccId, deleteProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -796,7 +796,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DeleteProfile_002, Function | MediumTest | Le
|
||||
CoreServiceProxy proxy(remote);
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState deleteProfileResult;
|
||||
ResultCode deleteProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.DeleteProfile(SLOT_ID, iccId, deleteProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -808,7 +808,7 @@ HWTEST_F(EsimCoreServiceProxyTest, DeleteProfile_003, Function | MediumTest | Le
|
||||
CoreServiceProxy proxy(remote);
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState deleteProfileResult;
|
||||
ResultCode deleteProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.DeleteProfile(SLOT_ID, iccId, deleteProfileResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
@ -822,7 +822,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SwitchToProfile_001, Function | MediumTest |
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
int32_t ret = proxy.SwitchToProfile(SLOT_ID, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -835,7 +835,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SwitchToProfile_002, Function | MediumTest |
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.SwitchToProfile(SLOT_ID, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -849,7 +849,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SwitchToProfile_003, Function | MediumTest |
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.SwitchToProfile(SLOT_ID, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
@ -862,7 +862,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetProfileNickname_001, Function | MediumTest
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState setProfileNicknameResult;
|
||||
ResultCode setProfileNicknameResult;
|
||||
int32_t ret = proxy.SetProfileNickname(SLOT_ID, iccId, nickname, setProfileNicknameResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
@ -874,7 +874,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetProfileNickname_002, Function | MediumTest
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState setProfileNicknameResult;
|
||||
ResultCode setProfileNicknameResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(-500));
|
||||
int32_t ret = proxy.SetProfileNickname(SLOT_ID, iccId, nickname, setProfileNicknameResult);
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
@ -887,7 +887,7 @@ HWTEST_F(EsimCoreServiceProxyTest, SetProfileNickname_003, Function | MediumTest
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState setProfileNicknameResult;
|
||||
ResultCode setProfileNicknameResult;
|
||||
EXPECT_CALL(*remote, SendRequest(testing::_, testing::_, testing::_, testing::_)).WillOnce(testing::Return(0));
|
||||
int32_t ret = proxy.SetProfileNickname(SLOT_ID, iccId, nickname, setProfileNicknameResult);
|
||||
EXPECT_EQ(ret, 0);
|
||||
|
@ -92,7 +92,7 @@ HWTEST_F(EsimCoreServiceTest, DisableProfile_0001, Function | MediumTest | Level
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState disableProfileResult;
|
||||
ResultCode disableProfileResult;
|
||||
EXPECT_NE(mCoreService->DisableProfile(
|
||||
slotId, portIndex, iccId, refresh, disableProfileResult), TELEPHONY_ERR_SUCCESS);
|
||||
mCoreService->simManager_ = nullptr;
|
||||
@ -195,7 +195,7 @@ HWTEST_F(EsimCoreServiceTest, ResetMemory_0001, Function | MediumTest | Level1)
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
mCoreService->simManager_ = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t slotId = 0;
|
||||
ResultState ResetMemoryResult;
|
||||
ResultCode ResetMemoryResult;
|
||||
const ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
EXPECT_NE(mCoreService->ResetMemory(
|
||||
slotId, resetOption, ResetMemoryResult), TELEPHONY_ERR_SUCCESS);
|
||||
@ -211,7 +211,7 @@ HWTEST_F(EsimCoreServiceTest, SetDefaultSmdpAddress_0001, Function | MediumTest
|
||||
mCoreService->simManager_ = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t slotId = 0;
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState SetAddressResult;
|
||||
ResultCode SetAddressResult;
|
||||
EXPECT_NE(mCoreService->SetDefaultSmdpAddress(
|
||||
slotId, defaultSmdpAddress, SetAddressResult), TELEPHONY_ERR_SUCCESS);
|
||||
mCoreService->simManager_ = nullptr;
|
||||
@ -219,15 +219,15 @@ HWTEST_F(EsimCoreServiceTest, SetDefaultSmdpAddress_0001, Function | MediumTest
|
||||
slotId, defaultSmdpAddress, SetAddressResult), TELEPHONY_ERR_LOCAL_PTR_NULL);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceTest, IsEsimSupported_0001, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimCoreServiceTest, IsSupported_0001, Function | MediumTest | Level1)
|
||||
{
|
||||
std::shared_ptr<CoreService> mCoreService = std::make_shared<CoreService>();
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
mCoreService->simManager_ = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t slotId = 0;
|
||||
EXPECT_FALSE(mCoreService->IsEsimSupported(slotId));
|
||||
EXPECT_FALSE(mCoreService->IsSupported(slotId));
|
||||
mCoreService->simManager_ = nullptr;
|
||||
EXPECT_FALSE(mCoreService->IsEsimSupported(slotId));
|
||||
EXPECT_FALSE(mCoreService->IsSupported(slotId));
|
||||
}
|
||||
|
||||
HWTEST_F(EsimCoreServiceTest, SendApduData_0001, Function | MediumTest | Level1)
|
||||
@ -335,7 +335,7 @@ HWTEST_F(EsimCoreServiceTest, RemoveNotificationFromList_0001, Function | Medium
|
||||
int32_t slotId = 0;
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState removeNotifFromListResult;
|
||||
ResultCode removeNotifFromListResult;
|
||||
EXPECT_NE(mCoreService->RemoveNotificationFromList(
|
||||
slotId, portIndex, seqNumber, removeNotifFromListResult), TELEPHONY_ERR_SUCCESS);
|
||||
|
||||
@ -351,7 +351,7 @@ HWTEST_F(EsimCoreServiceTest, DeleteProfile_0001, Function | MediumTest | Level1
|
||||
mCoreService->simManager_ = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState deleteProfileResult;
|
||||
ResultCode deleteProfileResult;
|
||||
EXPECT_NE(mCoreService->DeleteProfile(slotId, iccId, deleteProfileResult), TELEPHONY_ERR_SUCCESS);
|
||||
|
||||
mCoreService->simManager_ = nullptr;
|
||||
@ -367,7 +367,7 @@ HWTEST_F(EsimCoreServiceTest, SwitchToProfile_0001, Function | MediumTest | Leve
|
||||
int32_t portIndex = 1;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState switchProfileResult;
|
||||
ResultCode switchProfileResult;
|
||||
EXPECT_NE(mCoreService->SwitchToProfile(
|
||||
slotId, portIndex, iccId, forceDisableProfile, switchProfileResult), TELEPHONY_ERR_SUCCESS);
|
||||
|
||||
@ -384,7 +384,7 @@ HWTEST_F(EsimCoreServiceTest, SetProfileNickname_0001, Function | MediumTest | L
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState UpdateResult;
|
||||
ResultCode UpdateResult;
|
||||
EXPECT_NE(mCoreService->SetProfileNickname(
|
||||
slotId, iccId, nickname, UpdateResult), TELEPHONY_ERR_SUCCESS);
|
||||
mCoreService->simManager_ = nullptr;
|
||||
|
@ -72,10 +72,10 @@ HWTEST_F(EsimFileManagerTest, GetEuiccProfileInfoList_001, Function | MediumTest
|
||||
std::weak_ptr<SimStateManager>(simStateManager) };
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
GetEuiccProfileInfoListResult eUiccRes = simFileManager.GetEuiccProfileInfoList();
|
||||
EXPECT_EQ(eUiccRes.result_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(eUiccRes.result_, ResultCode::RESULT_OK);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
eUiccRes = simFileManager.GetEuiccProfileInfoList();
|
||||
EXPECT_EQ(eUiccRes.result_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(eUiccRes.result_, ResultCode::RESULT_OK);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, GetEuiccInfo_001, Function | MediumTest | Level2)
|
||||
@ -109,11 +109,11 @@ HWTEST_F(EsimFileManagerTest, DisableProfile_001, Function | MediumTest | Level2
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = u"";
|
||||
ResultState res = simFileManager.DisableProfile(portIndex, iccId);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.DisableProfile(portIndex, iccId);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.DisableProfile(portIndex, iccId);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, GetSmdsAddress_001, Function | MediumTest | Level2)
|
||||
@ -167,10 +167,10 @@ HWTEST_F(EsimFileManagerTest, GetEuiccChallenge_001, Function | MediumTest | Lev
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
int32_t portIndex = 0;
|
||||
ResponseEsimResult res = simFileManager.GetEuiccChallenge(portIndex);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.GetEuiccChallenge(portIndex);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, RequestDefaultSmdpAddress_001, Function | MediumTest | Level2)
|
||||
@ -205,10 +205,10 @@ HWTEST_F(EsimFileManagerTest, CancelSession_001, Function | MediumTest | Level2)
|
||||
std::u16string transactionId = u"";
|
||||
CancelReason cancelReason = CancelReason::CANCEL_REASON_END_USER_REJECTION;
|
||||
ResponseEsimResult res = simFileManager.CancelSession(transactionId, cancelReason);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.CancelSession(transactionId, cancelReason);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, GetProfile_001, Function | MediumTest | Level2)
|
||||
@ -243,11 +243,11 @@ HWTEST_F(EsimFileManagerTest, ResetMemory_001, Function | MediumTest | Level2)
|
||||
std::weak_ptr<SimStateManager>(simStateManager) };
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
ResultState res = simFileManager.ResetMemory(resetOption);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.ResetMemory(resetOption);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.ResetMemory(resetOption);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, SetDefaultSmdpAddress_001, Function | MediumTest | Level2)
|
||||
@ -262,14 +262,14 @@ HWTEST_F(EsimFileManagerTest, SetDefaultSmdpAddress_001, Function | MediumTest |
|
||||
std::weak_ptr<SimStateManager>(simStateManager) };
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
std::u16string defaultSmdpAddress = u"";
|
||||
ResultState res = simFileManager.SetDefaultSmdpAddress(defaultSmdpAddress);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.SetDefaultSmdpAddress(defaultSmdpAddress);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.SetDefaultSmdpAddress(defaultSmdpAddress);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, IsEsimSupported_001, Function | MediumTest | Level2)
|
||||
HWTEST_F(EsimFileManagerTest, IsSupported_001, Function | MediumTest | Level2)
|
||||
{
|
||||
std::string expectedEid = "12345";
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
@ -280,10 +280,10 @@ HWTEST_F(EsimFileManagerTest, IsEsimSupported_001, Function | MediumTest | Level
|
||||
SimFileManager simFileManager { subcribeInfo, std::weak_ptr<ITelRilManager>(telRilManager),
|
||||
std::weak_ptr<SimStateManager>(simStateManager) };
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
bool res = simFileManager.IsEsimSupported();
|
||||
bool res = simFileManager.IsSupported();
|
||||
EXPECT_EQ(res, false);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.IsEsimSupported();
|
||||
res = simFileManager.IsSupported();
|
||||
EXPECT_EQ(res, false);
|
||||
}
|
||||
|
||||
@ -301,10 +301,10 @@ HWTEST_F(EsimFileManagerTest, SendApduData_001, Function | MediumTest | Level2)
|
||||
std::u16string aid = u"";
|
||||
EsimApduData apduData;
|
||||
ResponseEsimResult res = simFileManager.SendApduData(aid, apduData);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.SendApduData(aid, apduData);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, PrepareDownload_001, Function | MediumTest | Level2)
|
||||
@ -322,11 +322,11 @@ HWTEST_F(EsimFileManagerTest, PrepareDownload_001, Function | MediumTest | Level
|
||||
downLoadConfigInfo.portIndex_ = 0;
|
||||
downLoadConfigInfo.hashCc_ = u"";
|
||||
ResponseEsimResult res = simFileManager.PrepareDownload(downLoadConfigInfo);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.PrepareDownload(downLoadConfigInfo);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, LoadBoundProfilePackage_001, Function | MediumTest | Level2)
|
||||
@ -422,11 +422,11 @@ HWTEST_F(EsimFileManagerTest, RemoveNotificationFromList_001, Function | MediumT
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 0;
|
||||
ResultState res = simFileManager.RemoveNotificationFromList(portIndex, seqNumber);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.RemoveNotificationFromList(portIndex, seqNumber);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.RemoveNotificationFromList(portIndex, seqNumber);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, DeleteProfile_001, Function | MediumTest | Level2)
|
||||
@ -441,11 +441,11 @@ HWTEST_F(EsimFileManagerTest, DeleteProfile_001, Function | MediumTest | Level2)
|
||||
std::weak_ptr<SimStateManager>(simStateManager) };
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
std::u16string iccId = u"";
|
||||
ResultState res = simFileManager.DeleteProfile(iccId);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.DeleteProfile(iccId);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.DeleteProfile(iccId);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, SwitchToProfile_001, Function | MediumTest | Level2)
|
||||
@ -462,11 +462,11 @@ HWTEST_F(EsimFileManagerTest, SwitchToProfile_001, Function | MediumTest | Level
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = u"";
|
||||
bool forceDisableProfile = false;
|
||||
ResultState res = simFileManager.SwitchToProfile(portIndex, iccId, forceDisableProfile);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.SwitchToProfile(portIndex, iccId, forceDisableProfile);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.SwitchToProfile(portIndex, iccId, forceDisableProfile);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, SetProfileNickname_001, Function | MediumTest | Level2)
|
||||
@ -482,11 +482,11 @@ HWTEST_F(EsimFileManagerTest, SetProfileNickname_001, Function | MediumTest | Le
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
std::u16string iccId = u"";
|
||||
std::u16string nickname = u"";
|
||||
ResultState res = simFileManager.SetProfileNickname(iccId, nickname);
|
||||
EXPECT_NE(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
ResultCode res = simFileManager.SetProfileNickname(iccId, nickname);
|
||||
EXPECT_NE(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.SetProfileNickname(iccId, nickname);
|
||||
EXPECT_EQ(res, ResultState::RESULT_UNDEFINED_ERROR);
|
||||
EXPECT_EQ(res, ResultCode::RESULT_SGP_22_OTHER);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimFileManagerTest, GetEuiccInfo2_001, Function | MediumTest | Level2)
|
||||
@ -521,10 +521,10 @@ HWTEST_F(EsimFileManagerTest, AuthenticateServer_001, Function | MediumTest | Le
|
||||
simFileManager.eSimFile_ = std::make_shared<EsimFile>(simStateManager);
|
||||
AuthenticateConfigInfo authenticateConfigInfo;
|
||||
ResponseEsimResult res = simFileManager.AuthenticateServer(authenticateConfigInfo);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
simFileManager.eSimFile_ = nullptr;
|
||||
res = simFileManager.AuthenticateServer(authenticateConfigInfo);
|
||||
EXPECT_EQ(res.resultCode_, ResultState::RESULT_OK);
|
||||
EXPECT_EQ(res.resultCode_, ResultCode::RESULT_OK);
|
||||
}
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -133,7 +133,7 @@ HWTEST_F(EsimManagerTest, DisableProfile, Function | MediumTest | Level1)
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool refresh = true;
|
||||
ResultState DisableProfileResult;
|
||||
ResultCode DisableProfileResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->DisableProfile(slotId, portIndex, iccId, refresh, DisableProfileResult);
|
||||
@ -326,7 +326,7 @@ HWTEST_F(EsimManagerTest, GetProfile, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimManagerTest, ResetMemory, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
ResultState ResetMemoryResult;
|
||||
ResultCode ResetMemoryResult;
|
||||
const ResetOption resetOption = ResetOption::DELETE_OPERATIONAL_PROFILES;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
@ -353,7 +353,7 @@ HWTEST_F(EsimManagerTest, SetDefaultSmdpAddress, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string defaultSmdpAddress = Str8ToStr16("test.com");
|
||||
ResultState SetAddressResult;
|
||||
ResultCode SetAddressResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->SetDefaultSmdpAddress(slotId, defaultSmdpAddress, SetAddressResult);
|
||||
@ -375,12 +375,12 @@ HWTEST_F(EsimManagerTest, SetDefaultSmdpAddress, Function | MediumTest | Level1)
|
||||
EXPECT_EQ(ret, TELEPHONY_ERR_SUCCESS);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimManagerTest, IsEsimSupported, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimManagerTest, IsSupported, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
EXPECT_FALSE(simManager->IsEsimSupported(slotId));
|
||||
EXPECT_FALSE(simManager->IsSupported(slotId));
|
||||
}
|
||||
|
||||
HWTEST_F(EsimManagerTest, SendApduData, Function | MediumTest | Level1)
|
||||
@ -555,7 +555,7 @@ HWTEST_F(EsimManagerTest, RemoveNotificationFromList, Function | MediumTest | Le
|
||||
int32_t slotId = 0;
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState enumResult;
|
||||
ResultCode enumResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->RemoveNotificationFromList(slotId, portIndex, seqNumber, enumResult);
|
||||
@ -583,7 +583,7 @@ HWTEST_F(EsimManagerTest, DeleteProfile, Function | MediumTest | Level1)
|
||||
{
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
ResultState DeleteProfileResult;
|
||||
ResultCode DeleteProfileResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->DeleteProfile(slotId, iccId, DeleteProfileResult);
|
||||
@ -613,7 +613,7 @@ HWTEST_F(EsimManagerTest, SwitchToProfile, Function | MediumTest | Level1)
|
||||
int32_t portIndex = 1;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
bool forceDisableProfile = true;
|
||||
ResultState SwitchProfileResult;
|
||||
ResultCode SwitchProfileResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->SwitchToProfile(slotId, portIndex, iccId, forceDisableProfile, SwitchProfileResult);
|
||||
@ -642,7 +642,7 @@ HWTEST_F(EsimManagerTest, SetProfileNickname, Function | MediumTest | Level1)
|
||||
int32_t slotId = 0;
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState UpdateResult;
|
||||
ResultCode UpdateResult;
|
||||
std::shared_ptr<TelRilManager> telRilManager = std::make_shared<TelRilManager>();
|
||||
std::shared_ptr<Telephony::SimManager> simManager = std::make_shared<SimManager>(telRilManager);
|
||||
int32_t ret = simManager->SetProfileNickname(slotId, iccId, nickname, UpdateResult);
|
||||
|
@ -240,11 +240,11 @@ HWTEST_F(EsimServiceClientBranchTest, CancelSession_0001, Function | MediumTest
|
||||
EXPECT_EQ(result, TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL);
|
||||
}
|
||||
|
||||
HWTEST_F(EsimServiceClientBranchTest, IsEsimSupported_0001, Function | MediumTest | Level1)
|
||||
HWTEST_F(EsimServiceClientBranchTest, IsSupported_0001, Function | MediumTest | Level1)
|
||||
{
|
||||
EXPECT_CALL(*samgr, LoadSystemAbility(testing::_,
|
||||
testing::A<const sptr<ISystemAbilityLoadCallback>&>())).WillOnce(testing::Return(-1));
|
||||
bool result = EsimServiceClient::GetInstance().IsEsimSupported(SLOT_ID);
|
||||
bool result = EsimServiceClient::GetInstance().IsSupported(SLOT_ID);
|
||||
EXPECT_EQ(result, false);
|
||||
}
|
||||
|
||||
|
@ -490,7 +490,7 @@ HWTEST_F(EsimTest, DisableProfile_001, Function | MediumTest | Level2)
|
||||
std::shared_ptr<Telephony::EsimFile> esimFile = std::make_shared<EsimFile>(simStateManager);
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId = Str8ToStr16("5A0A89670000000000452301");
|
||||
ResultState disableProfileResult = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode disableProfileResult = ResultCode::RESULT_SGP_22_OTHER;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_NE(disableProfileResult, esimFile->DisableProfile(portIndex, iccId));
|
||||
int32_t slotId = 0;
|
||||
@ -938,7 +938,7 @@ HWTEST_F(EsimTest, ResetMemory_001, Function | MediumTest | Level2)
|
||||
std::shared_ptr<Telephony::SimStateManager> simStateManager = std::make_shared<SimStateManager>(telRilManager);
|
||||
std::shared_ptr<Telephony::EsimFile> esimFile = std::make_shared<EsimFile>(simStateManager);
|
||||
ResetOption resetOption = ResetOption::DELETE_FIELD_LOADED_TEST_PROFILES;
|
||||
ResultState resetResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode resetResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_NE(resetResult_, esimFile->ResetMemory(resetOption));
|
||||
int32_t slotId = 0;
|
||||
@ -1431,7 +1431,7 @@ HWTEST_F(EsimTest, RemoveNotificationFromList_001, Function | MediumTest | Level
|
||||
std::shared_ptr<Telephony::EsimFile> esimFile = std::make_shared<EsimFile>(simStateManager);
|
||||
int32_t portIndex = 0;
|
||||
int32_t seqNumber = 5;
|
||||
ResultState removeNotifResult = ResultState::RESULT_OK;
|
||||
ResultCode removeNotifResult = ResultCode::RESULT_OK;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_EQ(removeNotifResult, esimFile->RemoveNotificationFromList(portIndex, seqNumber));
|
||||
int32_t slotId = 0;
|
||||
@ -1556,7 +1556,7 @@ HWTEST_F(EsimTest, DeleteProfile_001, Function | MediumTest | Level2)
|
||||
std::shared_ptr<Telephony::EsimFile> esimFile = std::make_shared<EsimFile>(simStateManager);
|
||||
|
||||
std::u16string iccId;
|
||||
ResultState disableProfileResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode disableProfileResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_NE(disableProfileResult_, esimFile->DeleteProfile(iccId));
|
||||
|
||||
@ -1577,7 +1577,7 @@ HWTEST_F(EsimTest, SwitchToProfile_001, Function | MediumTest | Level2)
|
||||
int32_t portIndex = 0;
|
||||
std::u16string iccId;
|
||||
bool forceDisableProfile = false;
|
||||
ResultState switchResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode switchResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_NE(switchResult_, esimFile->SwitchToProfile(portIndex, iccId, forceDisableProfile));
|
||||
|
||||
@ -1597,7 +1597,7 @@ HWTEST_F(EsimTest, SetProfileNickname_001, Function | MediumTest | Level2)
|
||||
|
||||
std::u16string iccId = Str8ToStr16("98760000000000543210");
|
||||
std::u16string nickname = Str8ToStr16("nick");
|
||||
ResultState updateNicknameResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultCode updateNicknameResult_ = ResultCode::RESULT_SGP_22_OTHER;
|
||||
esimFile->currentChannelId_ = 0;
|
||||
EXPECT_NE(updateNicknameResult_, esimFile->SetProfileNickname(iccId, nickname));
|
||||
|
||||
|
@ -548,30 +548,30 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultState &enumResult) override
|
||||
int32_t DeleteProfile(int32_t slotId, const std::u16string &iccId, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SwitchToProfile(int32_t slotId, int32_t portIndex,
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultState &enumResult) override
|
||||
const std::u16string &iccId, bool forceDisableProfile, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SetProfileNickname(
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultState &enumResult) override
|
||||
int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultState &enumResult) override
|
||||
int32_t ResetMemory(int32_t slotId, ResetOption resetOption, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t SetDefaultSmdpAddress(
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultState &enumResult) override
|
||||
int32_t slotId, const std::u16string &defaultSmdpAddress, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -587,7 +587,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool IsEsimSupported(int32_t slotId) override
|
||||
bool IsSupported(int32_t slotId) override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -599,7 +599,7 @@ public:
|
||||
}
|
||||
|
||||
int32_t DisableProfile(
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultState &enumResult) override
|
||||
int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -663,7 +663,7 @@ public:
|
||||
}
|
||||
|
||||
int32_t RemoveNotificationFromList(
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultState &enumResult) override
|
||||
int32_t slotId, int32_t portIndex, int32_t seqNumber, ResultCode &enumResult) override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user