mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-11-23 08:00:07 +00:00
修改检视意见
Signed-off-by: yangyang <yangyang651@h-partners.com>
This commit is contained in:
parent
9ae7cd0716
commit
407fb97464
@ -15,6 +15,9 @@
|
||||
|
||||
#include "core_service_proxy.h"
|
||||
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
#include "network_search_types.h"
|
||||
#include "parameter.h"
|
||||
#include "sim_state_type.h"
|
||||
@ -22,9 +25,7 @@
|
||||
#include "telephony_errors.h"
|
||||
#include "telephony_log_wrapper.h"
|
||||
#include "telephony_types.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
constexpr int32_t MAX_SIZE = 1000;
|
||||
@ -3201,15 +3202,17 @@ int32_t CoreServiceProxy::GetEid(int32_t slotId, std::u16string &eId)
|
||||
TELEPHONY_LOGE("WriteInterfaceToken is false");
|
||||
return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
|
||||
}
|
||||
data.WriteInt32(slotId);
|
||||
if (!data.WriteInt32(slotId)) {
|
||||
return TELEPHONY_ERR_WRITE_DATA_FAIL;
|
||||
}
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
TELEPHONY_LOGE("Remote is null");
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t st = remote->SendRequest(static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EID), data, reply, option);
|
||||
if (st != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEid failed, error code is %{public}d", st);
|
||||
int32_t sendRequestRet = remote->SendRequest(static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EID), data, reply, option);
|
||||
if (sendRequestRet != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEid failed, error code is %{public}d", sendRequestRet);
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
@ -3233,9 +3236,13 @@ void CoreServiceProxy::ReadEuiccProfileFromReply(MessageParcel &reply, EuiccProf
|
||||
euiccProfile.carrierId.gid2 = reply.ReadString16();
|
||||
euiccProfile.policyRules = static_cast<PolicyRules>(reply.ReadInt32());
|
||||
|
||||
int32_t accessRulesSize = reply.ReadInt32();
|
||||
uint32_t accessRulesSize = reply.ReadUint32();
|
||||
if (accessRulesSize >= MAX_SIZE) {
|
||||
TELEPHONY_LOGE("over max size");
|
||||
return;
|
||||
}
|
||||
euiccProfile.accessRules.resize(accessRulesSize);
|
||||
for (int32_t j = 0; j < accessRulesSize; ++j) {
|
||||
for (uint32_t j = 0; j < accessRulesSize; ++j) {
|
||||
AccessRule &rule = euiccProfile.accessRules[j];
|
||||
rule.certificateHashHexStr = reply.ReadString16();
|
||||
rule.packageName = reply.ReadString16();
|
||||
@ -3252,23 +3259,29 @@ int32_t CoreServiceProxy::GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfil
|
||||
TELEPHONY_LOGE("WriteInterfaceToken is false");
|
||||
return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
|
||||
}
|
||||
data.WriteInt32(slotId);
|
||||
if (!data.WriteInt32(slotId)) {
|
||||
return TELEPHONY_ERR_WRITE_DATA_FAIL;
|
||||
}
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
TELEPHONY_LOGE("Remote is null");
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t st = remote->SendRequest(static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EUICC_PROFILE_INFO_LIST),
|
||||
data, reply, option);
|
||||
if (st != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEuiccProfileInfoList failed, error code is %{public}d", st);
|
||||
int32_t sendRequestRet = remote->SendRequest(
|
||||
static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EUICC_PROFILE_INFO_LIST), data, reply, option);
|
||||
if (sendRequestRet != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEuiccProfileInfoList failed, error code is %{public}d", sendRequestRet);
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
int32_t profileCount = reply.ReadInt32();
|
||||
uint32_t profileCount = reply.ReadUint32();
|
||||
if (profileCount >= MAX_SIZE) {
|
||||
TELEPHONY_LOGE("over max size");
|
||||
return TELEPHONY_ERR_READ_DATA_FAIL;
|
||||
}
|
||||
euiccProfileInfoList.profiles.resize(profileCount);
|
||||
for (int32_t i = 0; i < profileCount; ++i) {
|
||||
for (uint32_t i = 0; i < profileCount; ++i) {
|
||||
EuiccProfile &euiccProfile = euiccProfileInfoList.profiles[i];
|
||||
ReadEuiccProfileFromReply(reply, euiccProfile);
|
||||
}
|
||||
@ -3287,15 +3300,18 @@ int32_t CoreServiceProxy::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
|
||||
TELEPHONY_LOGE("WriteInterfaceToken is false");
|
||||
return TELEPHONY_ERR_WRITE_DESCRIPTOR_TOKEN_FAIL;
|
||||
}
|
||||
data.WriteInt32(slotId);
|
||||
if (data.WriteInt32(slotId)) {
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
auto remote = Remote();
|
||||
if (remote == nullptr) {
|
||||
TELEPHONY_LOGE("Remote is null");
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t st = remote->SendRequest(static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EUICC_INFO), data, reply, option);
|
||||
if (st != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEuiccInfo failed, error code is %{public}d", st);
|
||||
int32_t sendRequestRet = remote->SendRequest(
|
||||
static_cast<uint32_t>(CoreServiceInterfaceCode::GET_EUICC_INFO), data, reply, option);
|
||||
if (sendRequestRet != ERR_NONE) {
|
||||
TELEPHONY_LOGE("GetEuiccInfo failed, error code is %{public}d", sendRequestRet);
|
||||
return TELEPHONY_ERR_IPC_CONNECT_STUB_FAIL;
|
||||
}
|
||||
int32_t result = reply.ReadInt32();
|
||||
|
@ -18,6 +18,9 @@
|
||||
|
||||
#include "cell_information.h"
|
||||
#include "dialling_numbers_info.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
#include "i_network_search_callback.h"
|
||||
#include "ims_reg_info_callback.h"
|
||||
#include "network_search_result.h"
|
||||
@ -26,9 +29,6 @@
|
||||
#include "operator_config_types.h"
|
||||
#include "signal_information.h"
|
||||
#include "sim_state_type.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
|
@ -17,13 +17,13 @@
|
||||
#define OHOS_I_SIM_MANAGER_H
|
||||
|
||||
#include "dialling_numbers_info.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
#include "event_handler.h"
|
||||
#include "operator_config_types.h"
|
||||
#include "sim_account_callback.h"
|
||||
#include "sim_state_type.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_state_type.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
|
@ -40,7 +40,6 @@ CoreServiceStub::CoreServiceStub()
|
||||
AddHandlerVoiceMailToMap();
|
||||
AddHandlerPdpProfileToMap();
|
||||
AddHandlerOpkeyVersionToMap();
|
||||
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
AddHandlerEsimToMap();
|
||||
#endif
|
||||
@ -1978,29 +1977,42 @@ int32_t CoreServiceStub::OnGetEuiccProfileInfoList(MessageParcel &data, MessageP
|
||||
GetEuiccProfileInfoListResult euiccProfileInfoList;
|
||||
int32_t result = GetEuiccProfileInfoList(slotId, euiccProfileInfoList);
|
||||
bool ret = reply.WriteInt32(result);
|
||||
if (!ret) {
|
||||
TELEPHONY_LOGE("write reply failed.");
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
if (result == TELEPHONY_ERR_SUCCESS) {
|
||||
reply.WriteInt32(euiccProfileInfoList.profiles.size());
|
||||
for (const auto& profile : euiccProfileInfoList.profiles) {
|
||||
reply.WriteString16(profile.iccId);
|
||||
reply.WriteString16(profile.nickName);
|
||||
reply.WriteString16(profile.serviceProviderName);
|
||||
reply.WriteString16(profile.profileName);
|
||||
reply.WriteInt32(static_cast<int32_t>(profile.state));
|
||||
reply.WriteInt32(static_cast<int32_t>(profile.profileClass));
|
||||
reply.WriteString16(profile.carrierId.mcc);
|
||||
reply.WriteString16(profile.carrierId.mnc);
|
||||
reply.WriteString16(profile.carrierId.gid1);
|
||||
reply.WriteString16(profile.carrierId.gid2);
|
||||
reply.WriteInt32(static_cast<int32_t>(profile.policyRules));
|
||||
reply.WriteInt32(profile.accessRules.size());
|
||||
if (!reply.WriteString16(profile.iccId) ||
|
||||
!reply.WriteString16(profile.nickName) ||
|
||||
!reply.WriteString16(profile.serviceProviderName) ||
|
||||
!reply.WriteString16(profile.profileName) ||
|
||||
!reply.WriteInt32(static_cast<int32_t>(profile.state)) ||
|
||||
!reply.WriteInt32(static_cast<int32_t>(profile.profileClass)) ||
|
||||
!reply.WriteString16(profile.carrierId.mcc) ||
|
||||
!reply.WriteString16(profile.carrierId.mnc) ||
|
||||
!reply.WriteString16(profile.carrierId.gid1) ||
|
||||
!reply.WriteString16(profile.carrierId.gid2) ||
|
||||
!reply.WriteInt32(static_cast<int32_t>(profile.policyRules)) ||
|
||||
!reply.WriteUint32(static_cast<uint32_t>(profile.accessRules.size()))) {
|
||||
TELEPHONY_LOGE("write reply failed.");
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
for (const auto& rule : profile.accessRules) {
|
||||
reply.WriteString16(rule.certificateHashHexStr);
|
||||
reply.WriteString16(rule.packageName);
|
||||
reply.WriteInt32(rule.accessType);
|
||||
if (!reply.WriteString16(rule.certificateHashHexStr) ||
|
||||
!reply.WriteString16(rule.packageName) ||
|
||||
!reply.WriteInt32(rule.accessType)) {
|
||||
TELEPHONY_LOGE("write reply failed.");
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
}
|
||||
}
|
||||
reply.WriteBool(euiccProfileInfoList.isRemovable);
|
||||
reply.WriteInt32(static_cast<int32_t>(euiccProfileInfoList.result));
|
||||
if (!reply.WriteBool(euiccProfileInfoList.isRemovable) ||
|
||||
!reply.WriteInt32(static_cast<int32_t>(euiccProfileInfoList.result))) {
|
||||
TELEPHONY_LOGE("write reply failed.");
|
||||
return TELEPHONY_ERR_WRITE_REPLY_FAIL;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -46,16 +46,13 @@ public:
|
||||
void OnAllFilesFetched();
|
||||
void StartLoad();
|
||||
~EsimFile() = default;
|
||||
// eSim Function
|
||||
std::string ObtainEid();
|
||||
GetEuiccProfileInfoListResult GetEuiccProfileInfoList();
|
||||
EuiccInfo GetEuiccInfo();
|
||||
|
||||
private:
|
||||
using FileProcessFunc = std::function<bool(const AppExecFwk::InnerEvent::Pointer &event)>;
|
||||
std::map<int, FileProcessFunc> memberFuncMap_;
|
||||
void InitMemberFunc();
|
||||
int32_t currentChannelId;
|
||||
void SyncCloseChannel();
|
||||
bool IsLogicChannelOpen();
|
||||
void ProcessEsimOpenChannel();
|
||||
@ -78,10 +75,12 @@ private:
|
||||
bool RequestAllProfilesParseProfileInfo(std::shared_ptr<Asn1Node> &root);
|
||||
|
||||
protected:
|
||||
constexpr std::string isdr_aid = "A0000005591010FFFFFFFF8900000100";
|
||||
std::map<int, FileProcessFunc> memberFuncMap_;
|
||||
int32_t currentChannelId_ = -1;
|
||||
int slotId_ = 0;
|
||||
EsimProfile esimProfile_;
|
||||
std::string eid_ = "";
|
||||
EuiccInfo2 euiccInfo2_; // 待修改,与responseInfo2Result_合并
|
||||
std::string defaultDpAddress_ = "";
|
||||
ResultState delProfile_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
ResultState setDpAddressResult_ = ResultState::RESULT_UNDEFINED_ERROR;
|
||||
@ -121,11 +120,11 @@ private:
|
||||
|
||||
std::mutex allProfileInfoMutex_;
|
||||
std::condition_variable allProfileInfoCv_;
|
||||
bool areAllProfileInfoReady_ = false;
|
||||
bool isAllProfileInfoReady_ = false;
|
||||
|
||||
std::mutex euiccInfo1Mutex_;
|
||||
std::condition_variable euiccInfo1Cv_;
|
||||
bool areEuiccInfo1Ready_ = false;
|
||||
bool isEuiccInfo1Ready_ = false;
|
||||
};
|
||||
} // namespace Telephony
|
||||
} // namespace OHOS
|
||||
|
@ -102,7 +102,7 @@ enum SimMessage {
|
||||
MSG_ESIM_OBTAIN_DEFAULT_SMDP_ADDRESS_DONE,
|
||||
MSG_ESIM_ESTABLISH_DEFAULT_SMDP_ADDRESS_DONE,
|
||||
MSG_ESIM_DELETE_PROFILE,
|
||||
MSG_ESIM_IS_ESIM_SUPPORT,
|
||||
MSG_ESIM_IS_SUPPORT_ESIM,
|
||||
MSG_ESIM_SWITCH_PROFILE,
|
||||
MSG_ESIM_DISABLE_PROFILE,
|
||||
MSG_ESIM_RESET_MEMORY,
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include "common_event_subscriber.h"
|
||||
#include "event_handler.h"
|
||||
#include "event_runner.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_file.h"
|
||||
#endif
|
||||
#include "tel_ril_modem_parcel.h"
|
||||
#include "i_tel_ril_manager.h"
|
||||
#include "isim_file.h"
|
||||
@ -33,9 +36,6 @@
|
||||
#include "csim_file_controller.h"
|
||||
#include "telephony_log_wrapper.h"
|
||||
#include "usim_file_controller.h"
|
||||
#ifdef CORE_SERVICE_SUPPORT_ESIM
|
||||
#include "esim_file.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
|
@ -32,29 +32,15 @@
|
||||
#include "telephony_tag_def.h"
|
||||
#include "vcard_utils.h"
|
||||
|
||||
|
||||
|
||||
using namespace OHOS::AppExecFwk;
|
||||
using namespace OHOS::EventFwk;
|
||||
|
||||
#define NUMBER_ZERO (0)
|
||||
#define NUMBER_ONE (1)
|
||||
#define NUMBER_TWO (2)
|
||||
#define NUMBER_THREE (3)
|
||||
#define NUMBER_FOUR (4)
|
||||
#define NUMBER_FIVE (5)
|
||||
#define NUMBER_ELEVEN (11)
|
||||
|
||||
#define SW1_MORE_RESPONSE 0x61
|
||||
#define INS_GET_MORE_RESPONSE 0xC0
|
||||
#define SW1_VALUE_90 0x90
|
||||
#define SW2_VALUE_00 0x00
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
constexpr int32_t NUMBER_THREE = 3;
|
||||
EsimFile::EsimFile(std::shared_ptr<SimStateManager> simStateManager) : IccFile("EsimFile", simStateManager)
|
||||
{
|
||||
currentChannelId = 0;
|
||||
currentChannelId_ = 0;
|
||||
InitMemberFunc();
|
||||
}
|
||||
|
||||
@ -62,7 +48,7 @@ void EsimFile::StartLoad() {}
|
||||
|
||||
void EsimFile::SyncOpenChannel()
|
||||
{
|
||||
int tryCnt = 0;
|
||||
uint32_t tryCnt = 0;
|
||||
while (!IsLogicChannelOpen()) {
|
||||
ProcessEsimOpenChannel();
|
||||
std::unique_lock<std::mutex> lck(openChannelMutex_);
|
||||
@ -80,7 +66,7 @@ void EsimFile::SyncOpenChannel()
|
||||
|
||||
void EsimFile::SyncOpenChannel(const std::u16string &aid)
|
||||
{
|
||||
int tryCnt = 0;
|
||||
uint32_t tryCnt = 0;
|
||||
while (!IsLogicChannelOpen()) {
|
||||
ProcessEsimOpenChannel(aid);
|
||||
std::unique_lock<std::mutex> lck(openChannelMutex_);
|
||||
@ -98,7 +84,7 @@ void EsimFile::SyncOpenChannel(const std::u16string &aid)
|
||||
|
||||
void EsimFile::SyncCloseChannel()
|
||||
{
|
||||
int tryCnt = 0;
|
||||
uint32_t tryCnt = 0;
|
||||
while (IsLogicChannelOpen()) {
|
||||
ProcessEsimCloseChannel();
|
||||
std::unique_lock<std::mutex> lck(closeChannelMutex_);
|
||||
@ -108,7 +94,7 @@ void EsimFile::SyncCloseChannel()
|
||||
}
|
||||
tryCnt++;
|
||||
if (tryCnt >= NUMBER_THREE) {
|
||||
currentChannelId = 0;
|
||||
currentChannelId_ = 0;
|
||||
TELEPHONY_LOGE("failed to close the channel");
|
||||
break;
|
||||
}
|
||||
@ -173,25 +159,25 @@ EuiccInfo EsimFile::GetEuiccInfo()
|
||||
return eUiccInfo_;
|
||||
}
|
||||
|
||||
void EsimFile::CopyApdCmdToReqInfo(ApduSimIORequestInfo *pReqInfo, ApduCommand *apdCmd)
|
||||
void EsimFile::CopyApdCmdToReqInfo(ApduSimIORequestInfo *requestInfo, ApduCommand *apduCommand)
|
||||
{
|
||||
if (apdCmd == nullptr || pReqInfo == nullptr) {
|
||||
if (apduCommand == nullptr || requestInfo == nullptr) {
|
||||
TELEPHONY_LOGE("CopyApdCmdToReqInfo failed");
|
||||
return;
|
||||
}
|
||||
static int32_t cnt = 0;
|
||||
pReqInfo->serial = cnt;
|
||||
static uint32_t cnt = 0;
|
||||
requestInfo->serial = cnt;
|
||||
cnt++;
|
||||
pReqInfo->channelId = apdCmd->channel;
|
||||
pReqInfo->type = apdCmd->data.cla;
|
||||
pReqInfo->instruction = apdCmd->data.ins;
|
||||
pReqInfo->p1 = apdCmd->data.p1;
|
||||
pReqInfo->p2 = apdCmd->data.p2;
|
||||
pReqInfo->p3 = apdCmd->data.p3;
|
||||
pReqInfo->data = apdCmd->data.cmdHex;
|
||||
requestInfo->channelId = apduCommand->channel;
|
||||
requestInfo->type = apduCommand->data.cla;
|
||||
requestInfo->instruction = apduCommand->data.ins;
|
||||
requestInfo->p1 = apduCommand->data.p1;
|
||||
requestInfo->p2 = apduCommand->data.p2;
|
||||
requestInfo->p3 = apduCommand->data.p3;
|
||||
requestInfo->data = apduCommand->data.cmdHex;
|
||||
}
|
||||
|
||||
void EsimFile::CommBuildOneApduReqInfo(ApduSimIORequestInfo& reqInfo, std::shared_ptr<Asn1Builder> &builder)
|
||||
void EsimFile::CommBuildOneApduReqInfo(ApduSimIORequestInfo& requestInfo, std::shared_ptr<Asn1Builder> &builder)
|
||||
{
|
||||
if (builder == nullptr) {
|
||||
TELEPHONY_LOGE("builder is nullptr");
|
||||
@ -199,12 +185,12 @@ void EsimFile::CommBuildOneApduReqInfo(ApduSimIORequestInfo& reqInfo, std::share
|
||||
}
|
||||
std::string hexStr;
|
||||
int hexStrLen = builder->Asn1BuilderToHexStr(hexStr);
|
||||
RequestApduBuild codec(currentChannelId);
|
||||
RequestApduBuild codec(currentChannelId_);
|
||||
codec.BuildStoreData(hexStr);
|
||||
std::list<std::unique_ptr<ApduCommand>> lst = codec.getCommands();
|
||||
std::unique_ptr<ApduCommand> apdCmd = std::move(lst.front());
|
||||
CopyApdCmdToReqInfo(&reqInfo, apdCmd.get());
|
||||
reqInfo.p2 = 0 ;
|
||||
std::unique_ptr<ApduCommand> apduCommand = std::move(lst.front());
|
||||
CopyApdCmdToReqInfo(&requestInfo, apduCommand.get());
|
||||
requestInfo.p2 = 0;
|
||||
}
|
||||
|
||||
bool EsimFile::ProcessObtainEid(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent)
|
||||
@ -216,14 +202,14 @@ bool EsimFile::ProcessObtainEid(int32_t slotId, const AppExecFwk::InnerEvent::Po
|
||||
return false;
|
||||
}
|
||||
std::string eidTags;
|
||||
eidTags += (unsigned char)TAG_ESIM_EID;
|
||||
eidTags += static_cast<unsigned char>(TAG_ESIM_EID);
|
||||
builder->Asn1AddChildAsBytes(TAG_ESIM_TAG_LIST, eidTags, eidTags.length());
|
||||
ApduSimIORequestInfo reqInfo;
|
||||
CommBuildOneApduReqInfo(reqInfo, builder);
|
||||
ApduSimIORequestInfo requestInfo;
|
||||
CommBuildOneApduReqInfo(requestInfo, builder);
|
||||
if (telRilManager_ == nullptr) {
|
||||
return false;
|
||||
}
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, reqInfo, responseEvent);
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, requestInfo, responseEvent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -233,12 +219,12 @@ bool EsimFile::ProcessObtainEuiccInfo1(int32_t slotId, const AppExecFwk::InnerEv
|
||||
{
|
||||
if (IsLogicChannelOpen()) {
|
||||
std::shared_ptr<Asn1Builder> builder = std::make_shared<Asn1Builder>(TAG_ESIM_GET_EUICC_INFO_1);
|
||||
ApduSimIORequestInfo reqInfo;
|
||||
CommBuildOneApduReqInfo(reqInfo, builder);
|
||||
ApduSimIORequestInfo requestInfo;
|
||||
CommBuildOneApduReqInfo(requestInfo, builder);
|
||||
if (telRilManager_ == nullptr) {
|
||||
return false;
|
||||
}
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, reqInfo, responseEvent);
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, requestInfo, responseEvent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -270,12 +256,12 @@ bool EsimFile::ProcessRequestAllProfiles(int32_t slotId, const AppExecFwk::Inner
|
||||
euiccProfileTags += tag;
|
||||
}
|
||||
builder->Asn1AddChildAsBytes(TAG_ESIM_TAG_LIST, euiccProfileTags, euiccProfileTags.length());
|
||||
ApduSimIORequestInfo reqInfo;
|
||||
CommBuildOneApduReqInfo(reqInfo, builder);
|
||||
ApduSimIORequestInfo requestInfo;
|
||||
CommBuildOneApduReqInfo(requestInfo, builder);
|
||||
if (telRilManager_ == nullptr) {
|
||||
return false;
|
||||
}
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, reqInfo, responseEvent);
|
||||
telRilManager_->SimTransmitApduLogicalChannel(slotId, requestInfo, responseEvent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -283,7 +269,7 @@ bool EsimFile::ProcessRequestAllProfiles(int32_t slotId, const AppExecFwk::Inner
|
||||
|
||||
bool EsimFile::IsLogicChannelOpen()
|
||||
{
|
||||
if (currentChannelId > 0) {
|
||||
if (currentChannelId_ > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -291,13 +277,12 @@ bool EsimFile::IsLogicChannelOpen()
|
||||
|
||||
void EsimFile::ProcessEsimOpenChannel()
|
||||
{
|
||||
std::string esimID = "A0000005591010FFFFFFFF8900000100";
|
||||
int32_t p2 = -1;
|
||||
AppExecFwk::InnerEvent::Pointer response = BuildCallerInfo(MSG_ESIM_OPEN_CHANNEL_DONE);
|
||||
if (telRilManager_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
telRilManager_->SimOpenLogicalChannel(0, esimID, p2, response);
|
||||
telRilManager_->SimOpenLogicalChannel(0, isdr_aid, p2, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -325,7 +310,7 @@ bool EsimFile::ProcessEsimOpenChannelDone(const AppExecFwk::InnerEvent::Pointer
|
||||
return false;
|
||||
}
|
||||
if (resultPtr->channelId > 0) {
|
||||
currentChannelId = resultPtr->channelId;
|
||||
currentChannelId_ = resultPtr->channelId;
|
||||
openChannelCv_.notify_one();
|
||||
} else {
|
||||
return false;
|
||||
@ -339,7 +324,7 @@ void EsimFile::ProcessEsimCloseChannel()
|
||||
if (telRilManager_ == nullptr) {
|
||||
return;
|
||||
}
|
||||
telRilManager_->SimCloseLogicalChannel(0, currentChannelId, response);
|
||||
telRilManager_->SimCloseLogicalChannel(0, currentChannelId_, response);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -347,7 +332,7 @@ bool EsimFile::ProcessEsimCloseChannelDone(const AppExecFwk::InnerEvent::Pointer
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(closeChannelMutex_);
|
||||
currentChannelId = 0;
|
||||
currentChannelId_ = 0;
|
||||
TELEPHONY_LOGI("Logical channel closed successfully. Notifying waiting thread.");
|
||||
}
|
||||
closeChannelCv_.notify_one();
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
#include "core_service_errors.h"
|
||||
#include "radio_event.h"
|
||||
#include "str_convert.h"
|
||||
#include "telephony_errors.h"
|
||||
#include "telephony_ext_wrapper.h"
|
||||
#include "telephony_permission.h"
|
||||
#include "str_convert.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Huawei Device Co., Ltd.
|
||||
* Copyright (C) 2024 Huawei Device Co., Ltd.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
@ -16,12 +16,13 @@
|
||||
#ifndef ESIM_SERVICE_PROFILE_H
|
||||
#define ESIM_SERVICE_PROFILE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "esim_state_type.h"
|
||||
#include "asn1_node.h"
|
||||
#include "asn1_builder.h"
|
||||
#include "asn1_decoder.h"
|
||||
#include "asn1_node.h"
|
||||
#include "asn1_utils.h"
|
||||
#include "esim_state_type.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
namespace OHOS {
|
||||
namespace Telephony {
|
||||
|
Loading…
Reference in New Issue
Block a user