• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ESIM_FILE_H
17 #define OHOS_ESIM_FILE_H
18 
19 #include "apdu_command.h"
20 #include "asn1_builder.h"
21 #include "asn1_decoder.h"
22 #include "asn1_node.h"
23 #include "asn1_utils.h"
24 #include "asn1_constants.h"
25 #include "download_profile_config_info_parcel.h"
26 #include "download_profile_result_parcel.h"
27 #include "downloadable_profile_parcel.h"
28 #include "esim_state_type.h"
29 #include "euicc_info_parcel.h"
30 #include "esim_service.h"
31 #include "event_handler.h"
32 #include "get_downloadable_profiles_result_parcel.h"
33 #include "i_tel_ril_manager.h"
34 #include "profile_info_list_parcel.h"
35 #include "profile_metadata_result_parcel.h"
36 #include "request_apdu_build.h"
37 #include "reset_response.h"
38 #include "response_esim_result.h"
39 #include "sim_data_type.h"
40 #include "tel_ril_sim_parcel.h"
41 
42 namespace OHOS {
43 namespace Telephony {
44 constexpr static const int32_t NUMBER_ZERO = 0;
45 constexpr static const int32_t NUMBER_ONE = 1;
46 constexpr static const int32_t NUMBER_TWO = 2;
47 constexpr static const int32_t NUMBER_THREE = 3;
48 constexpr static const int32_t NUMBER_FOUR = 4;
49 constexpr static const int32_t NUMBER_FIVE = 5;
50 constexpr static const int32_t NUMBER_ELEVEN = 11;
51 constexpr static const int32_t PARAMETER_TWO = -1;
52 constexpr static const int32_t PROFILE_DEFAULT_NUMBER = 256;
53 constexpr static const int32_t WAIT_TIME_LONG_SECOND_FOR_ESIM = 20;
54 constexpr static const int32_t WAIT_TIME_SHORT_SECOND_FOR_ESIM = 4;
55 constexpr static const int32_t SW1_MORE_RESPONSE = 0x61;
56 constexpr static const int32_t INS_GET_MORE_RESPONSE = 0xC0;
57 constexpr static const int32_t SW1_VALUE_90 = 0x90;
58 constexpr static const int32_t SW2_VALUE_00 = 0x00;
59 static std::string ISDR_AID = "A0000005591010FFFFFFFF8900000100";
60 constexpr static const int32_t ATR_LENGTH = 47;
61 constexpr static const uint32_t OFFSET_FOUR_BIT = 4;
62 constexpr static const uint32_t VERSION_NUMBER = 11;
63 constexpr static const uint32_t RESPONS_DATA_FINISH = 0;
64 constexpr static const uint32_t RESPONS_DATA_NOT_FINISH = 1;
65 constexpr static const uint32_t RESPONS_DATA_ERROR = 2;
66 constexpr static const uint32_t GET_BPP_LOAD_ERROR_LENGTH = 2;
67 constexpr static const uint32_t CONTRACT_INFO_CONTENT_IDX = 18;
68 
69 class EsimFile : public AppExecFwk::EventHandler {
70 public:
71     explicit EsimFile(std::shared_ptr<ITelRilManager> telRilManager, int32_t slotId = 0,
72         std::shared_ptr<AppExecFwk::EventRunner> eventRunner =
73         AppExecFwk::EventRunner::Create("esimFileHandler", AppExecFwk::ThreadMode::FFRT));
74     ~EsimFile() = default;
75     std::string ObtainEid();
76     GetEuiccProfileInfoListInnerResult GetEuiccProfileInfoList();
77     EuiccInfo GetEuiccInfo();
78     int32_t DisableProfile(int32_t portIndex, const std::u16string &iccId);
79     std::string ObtainSmdsAddress(int32_t portIndex);
80     EuiccRulesAuthTable ObtainRulesAuthTable(int32_t portIndex);
81     ResponseEsimInnerResult ObtainEuiccChallenge(int32_t portIndex);
82     bool ProcessObtainEuiccChallenge(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
83     bool ProcessObtainEuiccChallengeDone(const AppExecFwk::InnerEvent::Pointer &event);
84     bool ProcessDisableProfile(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
85     bool ProcessDisableProfileDone(const AppExecFwk::InnerEvent::Pointer &event);
86     bool ProcessObtainSmdsAddress(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
87     bool ProcessObtainSmdsAddressDone(const AppExecFwk::InnerEvent::Pointer &event);
88     bool ProcessRequestRulesAuthTable(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
89     bool ProcessRequestRulesAuthTableDone(const AppExecFwk::InnerEvent::Pointer &event);
90     bool RequestRulesAuthTableParseTagCtxComp0(std::shared_ptr<Asn1Node> &root);
91     std::string ObtainDefaultSmdpAddress();
92     ResponseEsimInnerResult CancelSession(const std::u16string &transactionId, CancelReason cancelReason);
93     EuiccProfile ObtainProfile(int32_t portIndex, const std::u16string &iccId);
94     int32_t ResetMemory(ResetOption resetOption);
95     int32_t SetDefaultSmdpAddress(const std::u16string &defaultSmdpAddress);
96     bool IsSupported();
97     ResponseEsimInnerResult SendApduData(const std::u16string &aid, const EsimApduData &apduData);
98     ResponseEsimInnerResult ObtainPrepareDownload(const DownLoadConfigInfo &downLoadConfigInfo);
99     ResponseEsimBppResult ObtainLoadBoundProfilePackage(int32_t portIndex, const std::u16string boundProfilePackage);
100     EuiccNotificationList ListNotifications(int32_t portIndex, EsimEvent events);
101     EuiccNotificationList RetrieveNotificationList(int32_t portIndex, EsimEvent events);
102     EuiccNotification ObtainRetrieveNotification(int32_t portIndex, int32_t seqNumber);
103     int32_t RemoveNotificationFromList(int32_t portIndex, int32_t seqNumber);
104     int32_t DeleteProfile(const std::u16string &iccId);
105     int32_t SwitchToProfile(int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile);
106     int32_t SetProfileNickname(const std::u16string &iccId, const std::u16string &nickname);
107     EuiccInfo2 ObtainEuiccInfo2(int32_t portIndex);
108     ResponseEsimInnerResult AuthenticateServer(const AuthenticateConfigInfo &authenticateConfigInfo);
109     std::string GetContractInfo(const GetContractInfoRequest &getContractInfoRequest);
110 private:
111     using FileProcessFunc = std::function<bool(const AppExecFwk::InnerEvent::Pointer &event)>;
112     void InitMemberFunc();
113     void InitChanneMemberFunc();
114     void SyncCloseChannel();
115     bool IsLogicChannelOpen();
116     void ProcessEsimOpenChannel(const std::u16string &aid);
117     bool ProcessEsimOpenChannelDone(const AppExecFwk::InnerEvent::Pointer &event);
118     void ProcessEsimCloseChannel();
119     bool ProcessEsimCloseChannelDone(const AppExecFwk::InnerEvent::Pointer &event);
120     ResultInnerCode ObtainChannelSuccessExclusive();
121     void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event);
122     ResultInnerCode ObtainChannelSuccessAlllowSameAidReuse(const std::u16string &aid);
123     void CopyApdCmdToReqInfo(ApduSimIORequestInfo &reqInfo, ApduCommand *apdCmd);
124     void CommBuildOneApduReqInfo(ApduSimIORequestInfo &reqInfo, std::shared_ptr<Asn1Builder> &builder);
125     bool ProcessObtainEid(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
126     bool ProcessObtainEidDone(const AppExecFwk::InnerEvent::Pointer &event);
127     bool ProcessObtainEuiccInfo1(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
128     bool ProcessObtainEuiccInfo1Done(const AppExecFwk::InnerEvent::Pointer &event);
129     bool ObtainEuiccInfo1ParseTagCtx2(std::shared_ptr<Asn1Node> &root);
130     bool ProcessRequestAllProfiles(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
131     bool ProcessRequestAllProfilesDone(const AppExecFwk::InnerEvent::Pointer &event);
132     bool SplitMccAndMnc(const std::string mccMnc, std::string &mcc, std::string &mnc);
133     void BuildBasicProfileInfo(EuiccProfileInfo *eProfileInfo, std::shared_ptr<Asn1Node> &profileNode);
134     void BuildAdvancedProfileInfo(EuiccProfileInfo *eProfileInfo, std::shared_ptr<Asn1Node> &profileNode);
135     void BuildOperatorId(EuiccProfileInfo *eProfileInfo, std::shared_ptr<Asn1Node> &operatorIdNode);
136     void ConvertProfileInfoToApiStruct(EuiccProfile &dst, EuiccProfileInfo &src);
137     std::shared_ptr<Asn1Node> ParseEvent(const AppExecFwk::InnerEvent::Pointer &event);
138     std::string MakeVersionString(std::vector<uint8_t> &versionRaw);
139     std::shared_ptr<Asn1Node> Asn1ParseResponse(const std::vector<uint8_t> &response, uint32_t respLength);
140     bool ProcessObtainDefaultSmdpAddress(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
141     bool ProcessObtainDefaultSmdpAddressDone(const AppExecFwk::InnerEvent::Pointer &event);
142     bool ProcessCancelSession(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
143     bool ProcessCancelSessionDone(const AppExecFwk::InnerEvent::Pointer &event);
144     bool ProcessGetProfile(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
145     std::vector<uint8_t> GetProfileTagList();
146     bool ProcessGetProfileDone(const AppExecFwk::InnerEvent::Pointer &event);
147     bool GetProfileDoneParseProfileInfo(std::shared_ptr<Asn1Node> &root);
148     bool ProcessResetMemory(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
149     bool ProcessResetMemoryDone(const AppExecFwk::InnerEvent::Pointer &event);
150     bool ProcessSendApduData(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
151     bool ProcessSendApduDataDone(const AppExecFwk::InnerEvent::Pointer &event);
152     bool ProcessEstablishDefaultSmdpAddress(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
153     bool ProcessEstablishDefaultSmdpAddressDone(const AppExecFwk::InnerEvent::Pointer &event);
154     void Asn1AddChildAsBase64(std::shared_ptr<Asn1Builder> &builder, std::string &base64Src);
155     bool ProcessPrepareDownload(int32_t slotId);
156     bool ProcessPrepareDownloadDone(const AppExecFwk::InnerEvent::Pointer &event);
157     bool DecodeBoundProfilePackage(const std::string &boundProfilePackageStr, std::shared_ptr<Asn1Node> &bppNode);
158     void BuildApduForInitSecureChannel(
159         RequestApduBuild& codec, std::shared_ptr<Asn1Node> &bppNode, std::shared_ptr<Asn1Node> &initSecureChannelReq);
160     void BuildApduForFirstSequenceOf87(RequestApduBuild &codec, std::shared_ptr<Asn1Node> &firstSequenceOf87);
161     void BuildApduForSequenceOf88(RequestApduBuild &codec, std::shared_ptr<Asn1Node> &sequenceOf88);
162     void BuildApduForSequenceOf86(RequestApduBuild &codec, std::shared_ptr<Asn1Node> &bppNode,
163         std::shared_ptr<Asn1Node> &sequenceOf86);
164     bool ProcessLoadBoundProfilePackage(int32_t slotId);
165     bool ProcessLoadBoundProfilePackageDone(const AppExecFwk::InnerEvent::Pointer &event);
166     std::shared_ptr<Asn1Node> LoadBoundProfilePackageParseProfileInstallResult(std::shared_ptr<Asn1Node> &root);
167     bool LoadBoundProfilePackageParseNotificationMetadata(std::shared_ptr<Asn1Node> &notificationMetadata);
168     bool RealProcessLoadBoundProfilePackageDone();
169     bool ProcessListNotifications(
170         int32_t slotId, EsimEvent events, const AppExecFwk::InnerEvent::Pointer &responseEvent);
171     bool ProcessListNotificationsDone(const AppExecFwk::InnerEvent::Pointer &event);
172     void CreateNotification(std::shared_ptr<Asn1Node> &node, EuiccNotification &euicc);
173     bool ProcessListNotificationsAsn1Response(std::shared_ptr<Asn1Node> &root);
174     void SplitSendLongData(RequestApduBuild &codec, int32_t esimMessageId,
175         std::mutex &mtx, bool &flag, std::condition_variable &cv);
176     uint32_t MergeRecvLongDataComplete(IccFileData &fileData, int32_t eventId);
177     void ConvertPreDownloadParaFromApiStru(PrepareDownloadResp& dst, EsimProfile& src);
178     uint32_t CombineResponseDataFinish(IccFileData &fileData);
179     void ProcessIfNeedMoreResponse(IccFileData &fileData, int32_t eventId);
180     bool ProcessRetrieveNotificationList(
181         int32_t slotId, EsimEvent events, const AppExecFwk::InnerEvent::Pointer &responseEvent);
182     bool ProcessRetrieveNotificationListDone(const AppExecFwk::InnerEvent::Pointer &event);
183     bool RetrieveNotificationParseCompTag(std::shared_ptr<Asn1Node> &root);
184     bool ProcessRetrieveNotification(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
185     bool ProcessRetrieveNotificationDone(const AppExecFwk::InnerEvent::Pointer &event);
186     bool RetrieveNotificatioParseTagCtxComp0(std::shared_ptr<Asn1Node> &root);
187     bool ProcessRemoveNotification(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
188     bool ProcessRemoveNotificationDone(const AppExecFwk::InnerEvent::Pointer &event);
189     bool ProcessDeleteProfile(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
190     bool ProcessDeleteProfileDone(const AppExecFwk::InnerEvent::Pointer &event);
191     bool ProcessSwitchToProfile(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
192     bool ProcessSwitchToProfileDone(const AppExecFwk::InnerEvent::Pointer &event);
193     bool ProcessSetNickname(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
194     bool ProcessSetNicknameDone(const AppExecFwk::InnerEvent::Pointer &event);
195     bool ProcessObtainEuiccInfo2(int32_t slotId, const AppExecFwk::InnerEvent::Pointer &responseEvent);
196     bool ProcessObtainEuiccInfo2Done(const AppExecFwk::InnerEvent::Pointer &event);
197     void EuiccInfo2ParseProfileVersion(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
198     void EuiccInfo2ParseSvn(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
199     void EuiccInfo2ParseEuiccFirmwareVer(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
200     void EuiccInfo2ParseExtCardResource(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
201     void EuiccInfo2ParseUiccCapability(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
202     void EuiccInfo2ParseTs102241Version(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
203     void EuiccInfo2ParseGlobalPlatformVersion(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
204     void EuiccInfo2ParseRspCapability(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
205     void EuiccInfo2ParseEuiccCiPKIdListForVerification(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
206     void EuiccInfo2ParseEuiccCiPKIdListForSigning(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
207     void EuiccInfo2ParseEuiccCategory(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
208     void EuiccInfo2ParsePpVersion(EuiccInfo2 &euiccInfo2, std::shared_ptr<Asn1Node> &root);
209     bool ProcessAuthenticateServer(int32_t slotId);
210     bool ProcessAuthenticateServerDone(const AppExecFwk::InnerEvent::Pointer &event);
211     bool RealProcessAuthenticateServerDone();
212     bool ProcessGetContractInfo(const AppExecFwk::InnerEvent::Pointer &responseEvent);
213     bool ProcessGetContractInfoDone(const AppExecFwk::InnerEvent::Pointer &event);
214     std::shared_ptr<Asn1Node> GetKeyValueSequenceNode(
215         uint32_t kTag, const std::string &key, uint32_t vTag, std::string &value);
216     std::shared_ptr<Asn1Node> GetMapMetaDataNode();
217         void AddDeviceCapability(std::shared_ptr<Asn1Builder> &devCapsBuilder);
218     void AddCtxParams1(std::shared_ptr<Asn1Builder> &ctxParams1Builder, Es9PlusInitAuthResp &pbytes);
219     void GetImeiBytes(std::vector<uint8_t> &imeiBytes, const std::string &imei);
220     void CovertAuthToApiStruct(ResponseEsimInnerResult &dst, AuthServerResponse &src);
221     void ConvertAuthInputParaFromApiStru(Es9PlusInitAuthResp &dst, EsimProfile &src);
222     bool GetRawDataFromEvent(const AppExecFwk::InnerEvent::Pointer &event, IccFileData &outRawData);
223     void ResetEuiccNotification();
224     void NotifyReady(std::mutex &mtx, bool &flag, std::condition_variable &cv);
225     bool RealProcessPrepareDownloadDone();
226     bool CommMergeRecvData(
227         std::mutex &mtx, bool &flag, std::condition_variable &cv, int32_t eventId, bool &isHandleFinish);
228     bool IsSameAid(const std::u16string &aid);
229     bool IsValidAidForAllowSameAidReuseChannel(const std::u16string &aid);
230     bool RealProcessRequestAllProfilesDone();
231     void ProcessEsimCloseSpareChannel();
232     bool ProcessEsimCloseSpareChannelDone(const AppExecFwk::InnerEvent::Pointer &event);
233     AppExecFwk::InnerEvent::Pointer BuildCallerInfo(int eventId);
234     struct CarrierIdentifier CarrierIdentifiers(const std::vector<uint8_t> &mccMncData, int mccMncLen,
235         const std::u16string &gid1, const std::u16string &gid2);
236     struct CarrierIdentifier BuildCarrierIdentifiers(const std::shared_ptr<Asn1Node> &root);
237 private:
238     std::map<int32_t, FileProcessFunc> memberFuncMap_;
239     std::atomic_int nextSerialId_ = 0;
240     std::atomic<int32_t> currentChannelId_ = -1;
241     int32_t slotId_ = 0;
242     EsimProfile esimProfile_;
243     std::string eid_ = "";
244     std::string defaultDpAddress_ = "";
245     int32_t delProfile_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
246     int32_t setDpAddressResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
247     int32_t switchResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
248     int32_t setNicknameResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
249     int32_t resetResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
250     int32_t disableProfileResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
251     int32_t removeNotifResult_ = static_cast<int32_t>(ResultInnerCode::RESULT_EUICC_CARD_DEFALUT_ERROR);
252     GetEuiccProfileInfoListInnerResult euiccProfileInfoList_;
253     EuiccInfo eUiccInfo_;
254     EuiccProfile eUiccProfile_;
255     std::string smdsAddress_ = "";
256     EuiccRulesAuthTable eUiccRulesAuthTable_;
257     ResponseEsimInnerResult responseChallengeResult_;
258     EuiccInfo2 euiccInfo2Result_;
259     ResponseEsimInnerResult responseAuthenticateResult_;
260     ResponseEsimInnerResult preDownloadResult_;
261     ResponseEsimBppResult loadBPPResult_;
262     ResponseEsimInnerResult cancelSessionResult_;
263     EuiccNotification notification_;
264     EuiccNotificationList eUiccNotificationList_;
265     EuiccNotificationList retrieveNotificationList_;
266     ResponseEsimInnerResult transApduDataResponse_;
267     GetContractInfoRequest getContractInfoRequest_;
268     std::string getContractInfoResult_ = "";
269     bool isSupported_ = false;
270     std::string recvCombineStr_ = "";
271     IccFileData newRecvData_;
272     std::shared_ptr<ITelRilManager> telRilManager_ = nullptr;
273 
274     std::u16string aidStr_ = u"";
275     std::mutex occupyChannelMutex_;
276 
277     std::mutex closeChannelMutex_;
278     std::condition_variable closeChannelCv_;
279 
280     std::mutex openChannelMutex_;
281     std::condition_variable openChannelCv_;
282 
283     std::mutex getEidMutex_;
284     std::condition_variable getEidCv_;
285     bool isEidReady_ = false;
286 
287     std::mutex allProfileInfoMutex_;
288     std::condition_variable allProfileInfoCv_;
289     bool isAllProfileInfoReady_ = false;
290 
291     std::mutex euiccInfo1Mutex_;
292     std::condition_variable euiccInfo1Cv_;
293     bool isEuiccInfo1Ready_ = false;
294 
295     std::mutex disableProfileMutex_;
296     std::condition_variable disableProfileCv_;
297     bool isDisableProfileReady_ = false;
298 
299     std::mutex smdsAddressMutex_;
300     std::condition_variable smdsAddressCv_;
301     bool isSmdsAddressReady_ = false;
302 
303     std::mutex rulesAuthTableMutex_;
304     std::condition_variable rulesAuthTableCv_;
305     bool isRulesAuthTableReady_ = false;
306 
307     std::mutex euiccChallengeMutex_;
308     std::condition_variable euiccChallengeCv_;
309     bool isEuiccChallengeReady_ = false;
310 
311     std::mutex obtainDefaultSmdpAddressMutex_;
312     std::condition_variable obtainDefaultSmdpAddressCv_;
313     bool isObtainDefaultSmdpAddressReady_ = false;
314 
315     std::mutex cancelSessionMutex_;
316     std::condition_variable cancelSessionCv_;
317     bool isCancelSessionReady_ = false;
318 
319     std::mutex obtainProfileMutex_;
320     std::condition_variable obtainProfileCv_;
321     bool isObtainProfileReady_ = false;
322 
323     std::mutex resetMemoryMutex_;
324     std::condition_variable resetMemoryCv_;
325     bool isResetMemoryReady_ = false;
326 
327     std::mutex setDefaultSmdpAddressMutex_;
328     std::condition_variable setDefaultSmdpAddressCv_;
329     bool isSetDefaultSmdpAddressReady_ = false;
330 
331     std::mutex sendApduDataMutex_;
332     std::condition_variable sendApduDataCv_;
333     bool isSendApduDataReady_ = false;
334 
335     std::mutex prepareDownloadMutex_;
336     std::condition_variable prepareDownloadCv_;
337     bool isPrepareDownloadReady_ = false;
338 
339     std::mutex loadBppMutex_;
340     std::condition_variable loadBppCv_;
341     bool isLoadBppReady_ = false;
342 
343     std::mutex listNotificationsMutex_;
344     std::condition_variable listNotificationsCv_;
345     bool isListNotificationsReady_ = false;
346 
347     std::mutex retrieveNotificationListMutex_;
348     std::condition_variable retrieveNotificationListCv_;
349     bool isRetrieveNotificationListReady_ = false;
350 
351     std::mutex retrieveNotificationMutex_;
352     std::condition_variable retrieveNotificationCv_;
353     bool isRetrieveNotificationReady_ = false;
354 
355     std::mutex removeNotificationMutex_;
356     std::condition_variable removeNotificationCv_;
357     bool isRemoveNotificationReady_ = false;
358 
359     std::mutex deleteProfileMutex_;
360     std::condition_variable deleteProfileCv_;
361     bool isDeleteProfileReady_ = false;
362 
363     std::mutex switchToProfileMutex_;
364     std::condition_variable switchToProfileCv_;
365     bool isSwitchToProfileReady_ = false;
366 
367     std::mutex setNicknameMutex_;
368     std::condition_variable setNicknameCv_;
369     bool isSetNicknameReady_ = false;
370 
371     std::mutex euiccInfo2Mutex_;
372     std::condition_variable euiccInfo2Cv_;
373     bool isEuiccInfo2Ready_ = false;
374 
375     std::mutex authenticateServerMutex_;
376     std::condition_variable authenticateServerCv_;
377     bool isAuthenticateServerReady_ = false;
378 
379     std::mutex getContractInfoMutex_;
380     std::condition_variable getContractInfoCv_;
381     bool isGetContractInfoReady_ = false;
382 };
383 } // namespace Telephony
384 } // namespace OHOS
385 #endif // OHOS_ESIM_FILE_H
386