• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-2025 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 #include "esim_manager.h"
17 #include "string_ex.h"
18 #include "telephony_errors.h"
19 
20 #ifdef CORE_SERVICE_SUPPORT_ESIM
21 #include "esim_service_client.h"
22 namespace OHOS {
23 namespace Telephony {
EsimManager(std::shared_ptr<ITelRilManager> telRilManager)24 EsimManager::EsimManager(std::shared_ptr<ITelRilManager> telRilManager) : telRilManager_(telRilManager)
25 {
26     TELEPHONY_LOGI("EsimManager::EsimManager()");
27 }
28 
~EsimManager()29 EsimManager::~EsimManager() {}
30 
OnInit(int32_t slotCount)31 bool EsimManager::OnInit(int32_t slotCount)
32 {
33     TELEPHONY_LOGI("EsimManager OnInit, slotCount = %{public}d", slotCount);
34     if (slotCount < ESIM_SLOT_ID_ZERO || slotCount > ESIM_MAX_SLOT_COUNT) {
35         TELEPHONY_LOGI("EsimManager, slotCount is out of range");
36         return false;
37     }
38     slotCount_ = slotCount;
39     esimFiles_.resize(slotCount_);
40     esimFilesLowPriority_.resize(slotCount_);
41     for (int32_t slotId = 0; slotId < slotCount_; slotId++) {
42         if (DelayedRefSingleton<EsimServiceClient>::GetInstance().IsSupported(slotId) == TELEPHONY_ERR_SUCCESS) {
43             TELEPHONY_LOGI("esimFiles_[%{public}d] to be init", slotId);
44             esimFiles_[slotId] = std::make_shared<EsimFile>(telRilManager_, slotId);
45             esimFilesLowPriority_[slotId] = std::make_shared<EsimFile>(telRilManager_, slotId);
46         }
47     }
48     return true;
49 }
50 
51 template<class N>
IsValidSlotId(int32_t slotId,std::vector<N> vec)52 bool EsimManager::IsValidSlotId(int32_t slotId, std::vector<N> vec)
53 {
54     if ((slotId < ESIM_SLOT_ID_ZERO) || (slotId >= static_cast<int32_t>(vec.size()))) {
55         TELEPHONY_LOGE("slotId is invalid by vec.size(), slotId = %{public}d", slotId);
56         return false;
57     }
58     return true;
59 }
60 
GetEid(int32_t slotId,std::u16string & eId)61 int32_t EsimManager::GetEid(int32_t slotId, std::u16string &eId)
62 {
63     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
64         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
65         return TELEPHONY_ERR_LOCAL_PTR_NULL;
66     }
67     eId = Str8ToStr16(esimFiles_[slotId]->ObtainEid());
68     return TELEPHONY_ERR_SUCCESS;
69 }
70 
GetEuiccProfileInfoList(int32_t slotId,GetEuiccProfileInfoListInnerResult & euiccProfileInfoList)71 int32_t EsimManager::GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListInnerResult &euiccProfileInfoList)
72 {
73     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
74         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
75         return TELEPHONY_ERR_LOCAL_PTR_NULL;
76     }
77     euiccProfileInfoList = esimFiles_[slotId]->GetEuiccProfileInfoList();
78     return TELEPHONY_ERR_SUCCESS;
79 }
80 
GetEuiccInfo(int32_t slotId,EuiccInfo & eUiccInfo)81 int32_t EsimManager::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
82 {
83     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
84         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
85         return TELEPHONY_ERR_LOCAL_PTR_NULL;
86     }
87     eUiccInfo = esimFiles_[slotId]->GetEuiccInfo();
88     return TELEPHONY_ERR_SUCCESS;
89 }
90 
DisableProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,bool refresh,int32_t & enumResult)91 int32_t EsimManager::DisableProfile(
92     int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, int32_t &enumResult)
93 {
94     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
95         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
96         return TELEPHONY_ERR_LOCAL_PTR_NULL;
97     }
98     enumResult = esimFiles_[slotId]->DisableProfile(portIndex, iccId);
99     return TELEPHONY_ERR_SUCCESS;
100 }
101 
GetSmdsAddress(int32_t slotId,int32_t portIndex,std::u16string & smdsAddress)102 int32_t EsimManager::GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress)
103 {
104     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
105         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
106         return TELEPHONY_ERR_LOCAL_PTR_NULL;
107     }
108     smdsAddress = Str8ToStr16(esimFiles_[slotId]->ObtainSmdsAddress(portIndex));
109     return TELEPHONY_ERR_SUCCESS;
110 }
111 
GetRulesAuthTable(int32_t slotId,int32_t portIndex,EuiccRulesAuthTable & eUiccRulesAuthTable)112 int32_t EsimManager::GetRulesAuthTable(
113     int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable)
114 {
115     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
116         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
117         return TELEPHONY_ERR_LOCAL_PTR_NULL;
118     }
119     eUiccRulesAuthTable = esimFiles_[slotId]->ObtainRulesAuthTable(portIndex);
120     return TELEPHONY_ERR_SUCCESS;
121 }
122 
GetEuiccChallenge(int32_t slotId,int32_t portIndex,ResponseEsimInnerResult & responseResult)123 int32_t EsimManager::GetEuiccChallenge(int32_t slotId, int32_t portIndex, ResponseEsimInnerResult &responseResult)
124 {
125     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
126         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
127         return TELEPHONY_ERR_LOCAL_PTR_NULL;
128     }
129     responseResult = esimFiles_[slotId]->ObtainEuiccChallenge(portIndex);
130     return TELEPHONY_ERR_SUCCESS;
131 }
132 
GetDefaultSmdpAddress(int32_t slotId,std::u16string & defaultSmdpAddress)133 int32_t EsimManager::GetDefaultSmdpAddress(int32_t slotId, std::u16string &defaultSmdpAddress)
134 {
135     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
136         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
137         return TELEPHONY_ERR_LOCAL_PTR_NULL;
138     }
139     defaultSmdpAddress = Str8ToStr16(esimFiles_[slotId]->ObtainDefaultSmdpAddress());
140     if (defaultSmdpAddress == Str8ToStr16("")) {
141         return TELEPHONY_ERR_FAIL;
142     }
143     return TELEPHONY_ERR_SUCCESS;
144 }
145 
CancelSession(int32_t slotId,const std::u16string & transactionId,CancelReason cancelReason,ResponseEsimInnerResult & responseResult)146 int32_t EsimManager::CancelSession(int32_t slotId, const std::u16string &transactionId,
147     CancelReason cancelReason, ResponseEsimInnerResult &responseResult)
148 {
149     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
150         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
151         return TELEPHONY_ERR_LOCAL_PTR_NULL;
152     }
153     responseResult = esimFiles_[slotId]->CancelSession(transactionId, cancelReason);
154     if (responseResult.resultCode_ != static_cast<int32_t>(EsimResultCode::RESULT_OK)) {
155         return TELEPHONY_ERR_FAIL;
156     }
157     return TELEPHONY_ERR_SUCCESS;
158 }
159 
GetProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,EuiccProfile & eUiccProfile)160 int32_t EsimManager::GetProfile(
161     int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile)
162 {
163     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
164         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
165         return TELEPHONY_ERR_LOCAL_PTR_NULL;
166     }
167     eUiccProfile = esimFiles_[slotId]->ObtainProfile(portIndex, iccId);
168     if (eUiccProfile.state_ != ProfileState::PROFILE_STATE_DISABLED) {
169         return TELEPHONY_ERR_FAIL;
170     }
171     return TELEPHONY_ERR_SUCCESS;
172 }
173 
ResetMemory(int32_t slotId,ResetOption resetOption,int32_t & enumResult)174 int32_t EsimManager::ResetMemory(int32_t slotId, ResetOption resetOption, int32_t &enumResult)
175 {
176     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
177         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
178         return TELEPHONY_ERR_LOCAL_PTR_NULL;
179     }
180     enumResult = esimFiles_[slotId]->ResetMemory(resetOption);
181     return TELEPHONY_ERR_SUCCESS;
182 }
183 
SetDefaultSmdpAddress(int32_t slotId,const std::u16string & defaultSmdpAddress,int32_t & enumResult)184 int32_t EsimManager::SetDefaultSmdpAddress(
185     int32_t slotId, const std::u16string &defaultSmdpAddress, int32_t &enumResult)
186 {
187     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
188         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
189         return TELEPHONY_ERR_LOCAL_PTR_NULL;
190     }
191     enumResult = esimFiles_[slotId]->SetDefaultSmdpAddress(defaultSmdpAddress);
192     return TELEPHONY_ERR_SUCCESS;
193 }
194 
IsSupported(int32_t slotId)195 bool EsimManager::IsSupported(int32_t slotId)
196 {
197     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
198         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
199         return false;
200     }
201     return esimFiles_[slotId]->IsSupported();
202 }
203 
SendApduData(int32_t slotId,const std::u16string & aid,const EsimApduData & apduData,ResponseEsimInnerResult & responseResult)204 int32_t EsimManager::SendApduData(
205     int32_t slotId, const std::u16string &aid, const EsimApduData &apduData, ResponseEsimInnerResult &responseResult)
206 {
207     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
208         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
209         return TELEPHONY_ERR_LOCAL_PTR_NULL;
210     }
211     responseResult = esimFiles_[slotId]->SendApduData(aid, apduData);
212     return TELEPHONY_ERR_SUCCESS;
213 }
214 
PrepareDownload(int32_t slotId,const DownLoadConfigInfo & downLoadConfigInfo,ResponseEsimInnerResult & responseResult)215 int32_t EsimManager::PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
216     ResponseEsimInnerResult &responseResult)
217 {
218     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
219         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
220         return TELEPHONY_ERR_LOCAL_PTR_NULL;
221     }
222     responseResult = esimFiles_[slotId]->ObtainPrepareDownload(downLoadConfigInfo);
223     return TELEPHONY_ERR_SUCCESS;
224 }
225 
LoadBoundProfilePackage(int32_t slotId,int32_t portIndex,const std::u16string & boundProfilePackage,ResponseEsimBppResult & responseResult)226 int32_t EsimManager::LoadBoundProfilePackage(int32_t slotId, int32_t portIndex,
227     const std::u16string &boundProfilePackage, ResponseEsimBppResult &responseResult)
228 {
229     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
230         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
231         return TELEPHONY_ERR_LOCAL_PTR_NULL;
232     }
233     responseResult = esimFiles_[slotId]->ObtainLoadBoundProfilePackage(portIndex, boundProfilePackage);
234     return TELEPHONY_ERR_SUCCESS;
235 }
236 
ListNotifications(int32_t slotId,int32_t portIndex,EsimEvent events,EuiccNotificationList & notificationList)237 int32_t EsimManager::ListNotifications(
238     int32_t slotId, int32_t portIndex, EsimEvent events, EuiccNotificationList &notificationList)
239 {
240     if ((!IsValidSlotId(slotId, esimFilesLowPriority_)) || (esimFilesLowPriority_[slotId] == nullptr)) {
241         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
242         return TELEPHONY_ERR_LOCAL_PTR_NULL;
243     }
244     notificationList = esimFilesLowPriority_[slotId]->ListNotifications(portIndex, events);
245     return TELEPHONY_ERR_SUCCESS;
246 }
247 
RetrieveNotificationList(int32_t slotId,int32_t portIndex,EsimEvent events,EuiccNotificationList & notificationList)248 int32_t EsimManager::RetrieveNotificationList(
249     int32_t slotId, int32_t portIndex, EsimEvent events, EuiccNotificationList &notificationList)
250 {
251     if ((!IsValidSlotId(slotId, esimFilesLowPriority_)) || (esimFilesLowPriority_[slotId] == nullptr)) {
252         TELEPHONY_LOGE("RetrieveNotificationList simFileManager is null!");
253         return TELEPHONY_ERR_LOCAL_PTR_NULL;
254     }
255     notificationList = esimFilesLowPriority_[slotId]->RetrieveNotificationList(portIndex, events);
256     return TELEPHONY_ERR_SUCCESS;
257 }
258 
RetrieveNotification(int32_t slotId,int32_t portIndex,int32_t seqNumber,EuiccNotification & notification)259 int32_t EsimManager::RetrieveNotification(
260     int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification &notification)
261 {
262     if ((!IsValidSlotId(slotId, esimFilesLowPriority_)) || (esimFilesLowPriority_[slotId] == nullptr)) {
263         TELEPHONY_LOGE("RetrieveNotification simFileManager is null!");
264         return TELEPHONY_ERR_LOCAL_PTR_NULL;
265     }
266     notification = esimFilesLowPriority_[slotId]->ObtainRetrieveNotification(portIndex, seqNumber);
267     return TELEPHONY_ERR_SUCCESS;
268 }
269 
RemoveNotificationFromList(int32_t slotId,int32_t portIndex,int32_t seqNumber,int32_t & enumResult)270 int32_t EsimManager::RemoveNotificationFromList(
271     int32_t slotId, int32_t portIndex, int32_t seqNumber, int32_t &enumResult)
272 {
273     if ((!IsValidSlotId(slotId, esimFilesLowPriority_)) || (esimFilesLowPriority_[slotId] == nullptr)) {
274         TELEPHONY_LOGE("RemoveNotificationFromList simFileManager is null!");
275         return TELEPHONY_ERR_LOCAL_PTR_NULL;
276     }
277     enumResult = esimFilesLowPriority_[slotId]->RemoveNotificationFromList(portIndex, seqNumber);
278     return TELEPHONY_ERR_SUCCESS;
279 }
280 
DeleteProfile(int32_t slotId,const std::u16string & iccId,int32_t & enumResult)281 int32_t EsimManager::DeleteProfile(int32_t slotId, const std::u16string &iccId, int32_t &enumResult)
282 {
283     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
284         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
285         return TELEPHONY_ERR_LOCAL_PTR_NULL;
286     }
287     enumResult = esimFiles_[slotId]->DeleteProfile(iccId);
288     return TELEPHONY_ERR_SUCCESS;
289 }
290 
SwitchToProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,bool forceDisableProfile,int32_t & enumResult)291 int32_t EsimManager::SwitchToProfile(
292     int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, int32_t &enumResult)
293 {
294     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
295         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
296         return TELEPHONY_ERR_LOCAL_PTR_NULL;
297     }
298     enumResult = esimFiles_[slotId]->SwitchToProfile(portIndex, iccId, forceDisableProfile);
299     return TELEPHONY_ERR_SUCCESS;
300 }
301 
SetProfileNickname(int32_t slotId,const std::u16string & iccId,const std::u16string & nickname,int32_t & enumResult)302 int32_t EsimManager::SetProfileNickname(
303     int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, int32_t &enumResult)
304 {
305     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
306         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
307         return TELEPHONY_ERR_LOCAL_PTR_NULL;
308     }
309     enumResult = esimFiles_[slotId]->SetProfileNickname(iccId, nickname);
310     return TELEPHONY_ERR_SUCCESS;
311 }
312 
GetEuiccInfo2(int32_t slotId,int32_t portIndex,EuiccInfo2 & euiccInfo2)313 int32_t EsimManager::GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2)
314 {
315     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
316         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
317         return TELEPHONY_ERR_LOCAL_PTR_NULL;
318     }
319     euiccInfo2 = esimFiles_[slotId]->ObtainEuiccInfo2(portIndex);
320     return TELEPHONY_ERR_SUCCESS;
321 }
322 
AuthenticateServer(int32_t slotId,const AuthenticateConfigInfo & authenticateConfigInfo,ResponseEsimInnerResult & responseResult)323 int32_t EsimManager::AuthenticateServer(
324     int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo, ResponseEsimInnerResult &responseResult)
325 {
326     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
327         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
328         return TELEPHONY_ERR_LOCAL_PTR_NULL;
329     }
330     responseResult = esimFiles_[slotId]->AuthenticateServer(authenticateConfigInfo);
331     return TELEPHONY_ERR_SUCCESS;
332 }
333 
GetContractInfo(int32_t slotId,const GetContractInfoRequest & getContractInfoRequest,std::string & response)334 int32_t EsimManager::GetContractInfo(
335     int32_t slotId, const GetContractInfoRequest &getContractInfoRequest, std::string& response)
336 {
337     if ((!IsValidSlotId(slotId, esimFiles_)) || (esimFiles_[slotId] == nullptr)) {
338         TELEPHONY_LOGE("slotId is invalid or esimFiles_ is null!");
339         return TELEPHONY_ERR_LOCAL_PTR_NULL;
340     }
341     response = esimFiles_[slotId]->GetContractInfo(getContractInfoRequest);
342     return TELEPHONY_ERR_SUCCESS;
343 }
344 
345 } // namespace Telephony
346 } // namespace OHOS
347 
348 #else
349 namespace OHOS {
350 namespace Telephony {
EsimManager(std::shared_ptr<ITelRilManager> telRilManager)351 EsimManager::EsimManager(std::shared_ptr<ITelRilManager> telRilManager) : telRilManager_(telRilManager)
352 {
353     TELEPHONY_LOGI("EsimManager, unsupport esim, not init");
354 }
355 
~EsimManager()356 EsimManager::~EsimManager() {}
357 
OnInit(int32_t slotCount)358 bool EsimManager::OnInit(int32_t slotCount)
359 {
360     return false;
361 }
362 
363 template<class N>
IsValidSlotId(int32_t slotId,std::vector<N> vec)364 bool EsimManager::IsValidSlotId(int32_t slotId, std::vector<N> vec)
365 {
366     return false;
367 }
368 
GetEid(int32_t slotId,std::u16string & eId)369 int32_t EsimManager::GetEid(int32_t slotId, std::u16string &eId)
370 {
371     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
372 }
373 
GetEuiccProfileInfoList(int32_t slotId,GetEuiccProfileInfoListInnerResult & euiccProfileInfoList)374 int32_t EsimManager::GetEuiccProfileInfoList(int32_t slotId, GetEuiccProfileInfoListInnerResult &euiccProfileInfoList)
375 {
376     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
377 }
378 
GetEuiccInfo(int32_t slotId,EuiccInfo & eUiccInfo)379 int32_t EsimManager::GetEuiccInfo(int32_t slotId, EuiccInfo &eUiccInfo)
380 {
381     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
382 }
383 
DisableProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,bool refresh,int32_t & enumResult)384 int32_t EsimManager::DisableProfile(
385     int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool refresh, int32_t &enumResult)
386 {
387     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
388 }
389 
GetSmdsAddress(int32_t slotId,int32_t portIndex,std::u16string & smdsAddress)390 int32_t EsimManager::GetSmdsAddress(int32_t slotId, int32_t portIndex, std::u16string &smdsAddress)
391 {
392     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
393 }
394 
GetRulesAuthTable(int32_t slotId,int32_t portIndex,EuiccRulesAuthTable & eUiccRulesAuthTable)395 int32_t EsimManager::GetRulesAuthTable(
396     int32_t slotId, int32_t portIndex, EuiccRulesAuthTable &eUiccRulesAuthTable)
397 {
398     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
399 }
400 
GetEuiccChallenge(int32_t slotId,int32_t portIndex,ResponseEsimInnerResult & responseResult)401 int32_t EsimManager::GetEuiccChallenge(int32_t slotId, int32_t portIndex, ResponseEsimInnerResult &responseResult)
402 {
403     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
404 }
405 
GetDefaultSmdpAddress(int32_t slotId,std::u16string & defaultSmdpAddress)406 int32_t EsimManager::GetDefaultSmdpAddress(int32_t slotId, std::u16string &defaultSmdpAddress)
407 {
408     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
409 }
410 
CancelSession(int32_t slotId,const std::u16string & transactionId,CancelReason cancelReason,ResponseEsimInnerResult & responseResult)411 int32_t EsimManager::CancelSession(int32_t slotId, const std::u16string &transactionId,
412     CancelReason cancelReason, ResponseEsimInnerResult &responseResult)
413 {
414     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
415 }
416 
GetProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,EuiccProfile & eUiccProfile)417 int32_t EsimManager::GetProfile(
418     int32_t slotId, int32_t portIndex, const std::u16string &iccId, EuiccProfile &eUiccProfile)
419 {
420     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
421 }
422 
ResetMemory(int32_t slotId,ResetOption resetOption,int32_t & enumResult)423 int32_t EsimManager::ResetMemory(int32_t slotId, ResetOption resetOption, int32_t &enumResult)
424 {
425     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
426 }
427 
SetDefaultSmdpAddress(int32_t slotId,const std::u16string & defaultSmdpAddress,int32_t & enumResult)428 int32_t EsimManager::SetDefaultSmdpAddress(
429     int32_t slotId, const std::u16string &defaultSmdpAddress, int32_t &enumResult)
430 {
431     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
432 }
433 
IsSupported(int32_t slotId)434 bool EsimManager::IsSupported(int32_t slotId)
435 {
436     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
437 }
438 
SendApduData(int32_t slotId,const std::u16string & aid,const EsimApduData & apduData,ResponseEsimInnerResult & responseResult)439 int32_t EsimManager::SendApduData(
440     int32_t slotId, const std::u16string &aid, const EsimApduData &apduData, ResponseEsimInnerResult &responseResult)
441 {
442     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
443 }
444 
PrepareDownload(int32_t slotId,const DownLoadConfigInfo & downLoadConfigInfo,ResponseEsimInnerResult & responseResult)445 int32_t EsimManager::PrepareDownload(int32_t slotId, const DownLoadConfigInfo &downLoadConfigInfo,
446     ResponseEsimInnerResult &responseResult)
447 {
448     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
449 }
450 
LoadBoundProfilePackage(int32_t slotId,int32_t portIndex,const std::u16string & boundProfilePackage,ResponseEsimBppResult & responseResult)451 int32_t EsimManager::LoadBoundProfilePackage(int32_t slotId, int32_t portIndex,
452     const std::u16string &boundProfilePackage, ResponseEsimBppResult &responseResult)
453 {
454     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
455 }
456 
ListNotifications(int32_t slotId,int32_t portIndex,EsimEvent events,EuiccNotificationList & notificationList)457 int32_t EsimManager::ListNotifications(
458     int32_t slotId, int32_t portIndex, EsimEvent events, EuiccNotificationList &notificationList)
459 {
460     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
461 }
462 
RetrieveNotificationList(int32_t slotId,int32_t portIndex,EsimEvent events,EuiccNotificationList & notificationList)463 int32_t EsimManager::RetrieveNotificationList(
464     int32_t slotId, int32_t portIndex, EsimEvent events, EuiccNotificationList &notificationList)
465 {
466     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
467 }
468 
RetrieveNotification(int32_t slotId,int32_t portIndex,int32_t seqNumber,EuiccNotification & notification)469 int32_t EsimManager::RetrieveNotification(
470     int32_t slotId, int32_t portIndex, int32_t seqNumber, EuiccNotification &notification)
471 {
472     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
473 }
474 
RemoveNotificationFromList(int32_t slotId,int32_t portIndex,int32_t seqNumber,int32_t & enumResult)475 int32_t EsimManager::RemoveNotificationFromList(
476     int32_t slotId, int32_t portIndex, int32_t seqNumber, int32_t &enumResult)
477 {
478     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
479 }
480 
DeleteProfile(int32_t slotId,const std::u16string & iccId,int32_t & enumResult)481 int32_t EsimManager::DeleteProfile(int32_t slotId, const std::u16string &iccId, int32_t &enumResult)
482 {
483     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
484 }
485 
SwitchToProfile(int32_t slotId,int32_t portIndex,const std::u16string & iccId,bool forceDisableProfile,int32_t & enumResult)486 int32_t EsimManager::SwitchToProfile(
487     int32_t slotId, int32_t portIndex, const std::u16string &iccId, bool forceDisableProfile, int32_t &enumResult)
488 {
489     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
490 }
491 
SetProfileNickname(int32_t slotId,const std::u16string & iccId,const std::u16string & nickname,int32_t & enumResult)492 int32_t EsimManager::SetProfileNickname(
493     int32_t slotId, const std::u16string &iccId, const std::u16string &nickname, int32_t &enumResult)
494 {
495     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
496 }
497 
GetEuiccInfo2(int32_t slotId,int32_t portIndex,EuiccInfo2 & euiccInfo2)498 int32_t EsimManager::GetEuiccInfo2(int32_t slotId, int32_t portIndex, EuiccInfo2 &euiccInfo2)
499 {
500     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
501 }
502 
AuthenticateServer(int32_t slotId,const AuthenticateConfigInfo & authenticateConfigInfo,ResponseEsimInnerResult & responseResult)503 int32_t EsimManager::AuthenticateServer(
504     int32_t slotId, const AuthenticateConfigInfo &authenticateConfigInfo, ResponseEsimInnerResult &responseResult)
505 {
506     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
507 }
508 
GetContractInfo(int32_t slotId,const GetContractInfoRequest & getContractInfoRequest,std::string & response)509 int32_t EsimManager::GetContractInfo(
510     int32_t slotId, const GetContractInfoRequest &getContractInfoRequest, std::string& response)
511 {
512     return TELEPHONY_ERR_CORE_SERVICE_NOT_SUPPORTED_ESIM;
513 }
514 
515 } // namespace Telephony
516 } // namespace OHOS
517 #endif