• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-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/**
17 * @file
18 * @kit TelephonyKit
19 */
20
21import type { AsyncCallback } from './@ohos.base';
22
23/**
24 * This indicates that the eSIM card performs the profile management operation synchronously.
25 * Includes methods defined by GSMA Spec (SGP.22) and customized methods.
26 *
27 * @namespace eSIM
28 * @syscap SystemCapability.Telephony.CoreService.Esim
29 * @since 18
30 */
31declare namespace eSIM {
32  /**
33   * Whether embedded subscriptions are currently supported.
34   *
35   * @param { number } slotId - Indicates the card slot index number.
36   * @returns { boolean } Returns {@code true} if the eSIM capability is supported; returns {@code false} otherwise.
37   * @throws { BusinessError } 401 - Invalid parameter value.
38   * @throws { BusinessError } 3120001 - Service connection failed.
39   * @throws { BusinessError } 3120002 - System internal error.
40   * @syscap SystemCapability.Telephony.CoreService.Esim
41   * @since 18
42   */
43  function isSupported(slotId: number): boolean;
44
45  /**
46   * Starts a page through an ability, on which users can touch the button to download a profile.
47   *
48   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE_OPEN
49   * @param { DownloadableProfile } profile - Bound profile package data returned by the SM-DP+ server.
50   * @returns { Promise<boolean> } Returns {@code true} if the profile is added successfully;
51   * returns {@code false} otherwise.
52   * @throws { BusinessError } 201 - Permission denied.
53   * @throws { BusinessError } 401 - Invalid parameter value.
54   * @throws { BusinessError } 801 - Capability not supported.
55   * @throws { BusinessError } 3120001 - Service connection failed.
56   * @throws { BusinessError } 3120002 - System internal error.
57   * @syscap SystemCapability.Telephony.CoreService.Esim
58   * @since 18
59   */
60  function addProfile(profile: DownloadableProfile): Promise<boolean>;
61
62  /**
63   * Returns the EID identifying for the eUICC hardware.
64   *
65   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
66   * @param { number } slotId - Indicates the card slot index number.
67   * @returns { Promise<string> } Returns the EID. When eUICC is not ready, the return value may be null.
68   * @throws { BusinessError } 201 - Permission denied.
69   * @throws { BusinessError } 202 - Non-system applications use system APIs.
70   * @throws { BusinessError } 401 - Invalid parameter value.
71   * @throws { BusinessError } 801 - Capability not supported.
72   * @throws { BusinessError } 3120001 - Service connection failed.
73   * @throws { BusinessError } 3120002 - System internal error.
74   * @syscap SystemCapability.Telephony.CoreService.Esim
75   * @systemapi Hide this for inner system use.
76   * @since 18
77   */
78  function getEid(slotId: number): Promise<string>;
79
80  /**
81   * Returns the current status of eUICC OS upgrade.
82   *
83   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
84   * @param { number } slotId - Indicates the card slot index number.
85   * @returns { Promise<OsuStatus> } Return the status of eUICC OS upgrade.
86   * @throws { BusinessError } 201 - Permission denied.
87   * @throws { BusinessError } 202 - Non-system applications use system APIs.
88   * @throws { BusinessError } 401 - Invalid parameter value.
89   * @throws { BusinessError } 801 - Capability not supported.
90   * @throws { BusinessError } 3120001 - Service connection failed.
91   * @throws { BusinessError } 3120002 - System internal error.
92   * @syscap SystemCapability.Telephony.CoreService.Esim
93   * @systemapi Hide this for inner system use.
94   * @since 18
95   */
96  function getOsuStatus(slotId: number): Promise<OsuStatus>;
97
98  /**
99   * Execute OS upgrade if current OS upgrade is not the latest one.
100   *
101   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
102   * @param { number } slotId - Indicates the card slot index number.
103   * @returns { Promise<OsuStatus> } Return the status of OS upgrade when OS upgrade status changed.
104   * @throws { BusinessError } 201 - Permission denied.
105   * @throws { BusinessError } 202 - Non-system applications use system APIs.
106   * @throws { BusinessError } 401 - Invalid parameter value.
107   * @throws { BusinessError } 801 - Capability not supported.
108   * @throws { BusinessError } 3120001 - Service connection failed.
109   * @throws { BusinessError } 3120002 - System internal error.
110   * @syscap SystemCapability.Telephony.CoreService.Esim
111   * @systemapi Hide this for inner system use.
112   * @since 18
113   */
114  function startOsu(slotId: number): Promise<OsuStatus>;
115
116  /**
117   * Fills in and gets the metadata for a downloadable profile.
118   *
119   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
120   * @param { number } slotId - Indicates the card slot index number.
121   * @param { number } portIndex - Index of the port for the slot.
122   * @param { DownloadableProfile } profile - The Bound Profile Package data returned by SM-DP+ server.
123   * @param { boolean } forceDisableProfile - If true, the active profile must be disabled in order to perform the
124   * operation. Otherwise, the resultCode should return {@link RESULT_MUST_DISABLE_PROFILE} to allow
125   * the user to agree to this operation first.
126   * @returns { Promise<GetDownloadableProfileMetadataResult> } Return the metadata for profile.
127   * @throws { BusinessError } 201 - Permission denied.
128   * @throws { BusinessError } 202 - Non-system applications use system APIs.
129   * @throws { BusinessError } 401 - Invalid parameter value.
130   * @throws { BusinessError } 801 - Capability not supported.
131   * @throws { BusinessError } 3120001 - Service connection failed.
132   * @throws { BusinessError } 3120002 - System internal error.
133   * @syscap SystemCapability.Telephony.CoreService.Esim
134   * @systemapi Hide this for inner system use.
135   * @since 18
136   */
137  function getDownloadableProfileMetadata(slotId: number, portIndex: number,
138    profile: DownloadableProfile, forceDisableProfile: boolean): Promise<GetDownloadableProfileMetadataResult>;
139
140  /**
141   * Gets downloadable profile List which are available for download on this device.
142   *
143   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
144   * @param { number } slotId - Indicates the card slot index number.
145   * @param { number } portIndex - Index of the port for the slot.
146   * @param { boolean } forceDisableProfile - If true, the active profile must be disabled in order to perform the
147   * operation. Otherwise, the resultCode should return {@link RESULT_MUST_DISABLE_PROFILE} to allow
148   * the user to agree to this operation first.
149   * @returns { Promise<GetDownloadableProfilesResult> } Return metadata for downloadableProfile which are
150   * available for download on this device.
151   * @throws { BusinessError } 201 - Permission denied.
152   * @throws { BusinessError } 202 - Non-system applications use system APIs.
153   * @throws { BusinessError } 401 - Invalid parameter value.
154   * @throws { BusinessError } 801 - Capability not supported.
155   * @throws { BusinessError } 3120001 - Service connection failed.
156   * @throws { BusinessError } 3120002 - System internal error.
157   * @syscap SystemCapability.Telephony.CoreService.Esim
158   * @systemapi Hide this for inner system use.
159   * @since 18
160   */
161  function getDownloadableProfiles(slotId: number, portIndex: number,
162    forceDisableProfile: boolean): Promise<GetDownloadableProfilesResult>;
163
164  /**
165   * Attempt to download the given downloadable Profile.
166   *
167   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
168   * @param { number } slotId - Indicates the card slot index number.
169   * @param { number } portIndex - Index of the port for the slot.
170   * @param { DownloadableProfile } profile - The Bound Profile Package data returned by SM-DP+ server.
171   * @param { DownloadConfiguration } configuration - Configuration information during downloading.
172   * @returns { Promise<DownloadProfileResult> } Return the given downloadableProfile.
173   * @throws { BusinessError } 201 - Permission denied.
174   * @throws { BusinessError } 202 - Non-system applications use system APIs.
175   * @throws { BusinessError } 401 - Invalid parameter value.
176   * @throws { BusinessError } 801 - Capability not supported.
177   * @throws { BusinessError } 3120001 - Service connection failed.
178   * @throws { BusinessError } 3120002 - System internal error.
179   * @syscap SystemCapability.Telephony.CoreService.Esim
180   * @systemapi Hide this for inner system use.
181   * @since 18
182   */
183  function downloadProfile(slotId: number, portIndex: number, profile: DownloadableProfile,
184    configuration: DownloadConfiguration): Promise<DownloadProfileResult>;
185
186  /**
187   * Returns a list of all eUICC profile information.
188   *
189   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
190   * @param { number } slotId - Indicates the card slot index number.
191   * @returns { Promise<GetEuiccProfileInfoListResult> } Return a list of eUICC profile information.
192   * @throws { BusinessError } 201 - Permission denied.
193   * @throws { BusinessError } 202 - Non-system applications use system APIs.
194   * @throws { BusinessError } 401 - Invalid parameter value.
195   * @throws { BusinessError } 801 - Capability not supported.
196   * @throws { BusinessError } 3120001 - Service connection failed.
197   * @throws { BusinessError } 3120002 - System internal error.
198   * @syscap SystemCapability.Telephony.CoreService.Esim
199   * @systemapi Hide this for inner system use.
200   * @since 18
201   */
202  function getEuiccProfileInfoList(slotId: number): Promise<GetEuiccProfileInfoListResult>;
203
204  /**
205   * Returns the eUICC Information.
206   *
207   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
208   * @param { number } slotId - Indicates the card slot index number.
209   * @returns { Promise<EuiccInfo> } Returns the eUICC information to obtain. When eUICC is not ready,
210   * the return value may be null.
211   * @throws { BusinessError } 201 - Permission denied.
212   * @throws { BusinessError } 202 - Non-system applications use system APIs.
213   * @throws { BusinessError } 401 - Invalid parameter value.
214   * @throws { BusinessError } 801 - Capability not supported.
215   * @throws { BusinessError } 3120001 - Service connection failed.
216   * @throws { BusinessError } 3120002 - System internal error.
217   * @syscap SystemCapability.Telephony.CoreService.Esim
218   * @systemapi Hide this for inner system use.
219   * @since 18
220   */
221  function getEuiccInfo(slotId: number): Promise<EuiccInfo>;
222
223  /**
224   * Deletes the given profile from eUICC.
225   *
226   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
227   * @param { number } slotId - Indicates the card slot index number.
228   * @param { string } iccid - The iccid of the profile.
229   * @returns { Promise<ResultCode> } Returns the response to deletes the given profile.
230   * @throws { BusinessError } 201 - Permission denied.
231   * @throws { BusinessError } 202 - Non-system applications use system APIs.
232   * @throws { BusinessError } 401 - Invalid parameter value.
233   * @throws { BusinessError } 801 - Capability not supported.
234   * @throws { BusinessError } 3120001 - Service connection failed.
235   * @throws { BusinessError } 3120002 - System internal error.
236   * @syscap SystemCapability.Telephony.CoreService.Esim
237   * @systemapi Hide this for inner system use.
238   * @since 18
239   */
240  function deleteProfile(slotId: number, iccid: string): Promise<ResultCode>;
241
242  /**
243   * Switch to (enable) the given profile on the eUICC.
244   *
245   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
246   * @param { number } slotId - Indicates the card slot index number.
247   * @param { number } portIndex - Index of the port for the slot.
248   * @param { string } iccid - The iccid of the profile to switch to.
249   * @param { boolean } forceDisableProfile - If true, the active profile must be disabled in order to perform the
250   * operation. Otherwise, the resultCode should return {@link RESULT_MUST_DISABLE_PROFILE} to allow
251   * the user to agree to this operation first.
252   * @returns { Promise<ResultCode> } Returns the response to switch profile.
253   * @throws { BusinessError } 201 - Permission denied.
254   * @throws { BusinessError } 202 - Non-system applications use system APIs.
255   * @throws { BusinessError } 401 - Invalid parameter value.
256   * @throws { BusinessError } 801 - Capability not supported.
257   * @throws { BusinessError } 3120001 - Service connection failed.
258   * @throws { BusinessError } 3120002 - System internal error.
259   * @syscap SystemCapability.Telephony.CoreService.Esim
260   * @systemapi Hide this for inner system use.
261   * @since 18
262   */
263  function switchToProfile(slotId: number, portIndex: number, iccid: string,
264    forceDisableProfile: boolean): Promise<ResultCode>;
265
266  /**
267   * Adds or updates the given profile nickname.
268   *
269   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
270   * @param { number } slotId - Indicates the card slot index number.
271   * @param { string } iccid - The iccid of the profile.
272   * @param { string } nickname - The nickname of the profile.
273   * @returns { Promise<ResultCode> } Returns the result of the set nickname operation.
274   * @throws { BusinessError } 201 - Permission denied.
275   * @throws { BusinessError } 202 - Non-system applications use system APIs.
276   * @throws { BusinessError } 401 - Invalid parameter value.
277   * @throws { BusinessError } 801 - Capability not supported.
278   * @throws { BusinessError } 3120001 - Service connection failed.
279   * @throws { BusinessError } 3120002 - System internal error.
280   * @syscap SystemCapability.Telephony.CoreService.Esim
281   * @systemapi Hide this for inner system use.
282   * @since 18
283   */
284  function setProfileNickname(slotId: number, iccid: string, nickname: string): Promise<ResultCode>;
285
286  /**
287   * Erase all specific profiles and reset the eUICC.
288   *
289   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
290   * @param { number } slotId - Indicates the card slot index number.
291   * @param { ResetOption } options - Options for resetting eUICC memory.
292   * @returns { Promise<ResultCode> } Returns the result of the reset operation.
293   * @throws { BusinessError } 201 - Permission denied.
294   * @throws { BusinessError } 202 - Non-system applications use system APIs.
295   * @throws { BusinessError } 401 - Invalid parameter value.
296   * @throws { BusinessError } 801 - Capability not supported.
297   * @throws { BusinessError } 3120001 - Service connection failed.
298   * @throws { BusinessError } 3120002 - System internal error.
299   * @syscap SystemCapability.Telephony.CoreService.Esim
300   * @systemapi Hide this for inner system use.
301   * @since 18
302   */
303  function resetMemory(slotId: number, options?:ResetOption): Promise<ResultCode>;
304
305  /**
306   * Ensure that profiles will be retained on the next factory reset.
307   *
308   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
309   * @param { number } slotId - Indicates the card slot index number.
310   * @returns { Promise<ResultCode> } Returns the result code.
311   * @throws { BusinessError } 201 - Permission denied.
312   * @throws { BusinessError } 202 - Non-system applications use system APIs.
313   * @throws { BusinessError } 401 - Invalid parameter value.
314   * @throws { BusinessError } 801 - Capability not supported.
315   * @throws { BusinessError } 3120001 - Service connection failed.
316   * @throws { BusinessError } 3120002 - System internal error.
317   * @syscap SystemCapability.Telephony.CoreService.Esim
318   * @systemapi Hide this for inner system use.
319   * @since 18
320   */
321  function reserveProfilesForFactoryRestore(slotId: number): Promise<ResultCode>;
322
323  /**
324   * Set or update the default SM-DP+ address stored in an eUICC.
325   *
326   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
327   * @param { number } slotId - Indicates the card slot index number.
328   * @param { string } address -  The default SM-DP+ address to set.
329   * @returns { Promise<ResultCode> } Returns the result code.
330   * @throws { BusinessError } 201 - Permission denied.
331   * @throws { BusinessError } 202 - Non-system applications use system APIs.
332   * @throws { BusinessError } 401 - Invalid parameter value.
333   * @throws { BusinessError } 801 - Capability not supported.
334   * @throws { BusinessError } 3120001 - Service connection failed.
335   * @throws { BusinessError } 3120002 - System internal error.
336   * @syscap SystemCapability.Telephony.CoreService.Esim
337   * @systemapi Hide this for inner system use.
338   * @since 18
339   */
340  function setDefaultSmdpAddress(slotId: number, address: string): Promise<ResultCode>;
341
342  /**
343   * Gets the default SM-DP+ address stored in an eUICC.
344   *
345   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
346   * @param { number } slotId - Indicates the card slot index number.
347   * @returns { Promise<string> } Returns the default SM-DP+ address.
348   * @throws { BusinessError } 201 - Permission denied.
349   * @throws { BusinessError } 202 - Non-system applications use system APIs.
350   * @throws { BusinessError } 401 - Invalid parameter value.
351   * @throws { BusinessError } 801 - Capability not supported.
352   * @throws { BusinessError } 3120001 - Service connection failed.
353   * @throws { BusinessError } 3120002 - System internal error.
354   * @syscap SystemCapability.Telephony.CoreService.Esim
355   * @systemapi Hide this for inner system use.
356   * @since 18
357   */
358  function getDefaultSmdpAddress(slotId: number): Promise<string>;
359
360  /**
361   * Cancel session can be used in the
362   * 1.after the response to "ES9+.AuthenticateClient"
363   * 2.after the response to "ES9+.GetBoundProfilePackage"
364   *
365   * @permission ohos.permission.SET_TELEPHONY_ESIM_STATE
366   * @param { number } slotId - Indicates the card slot index number.
367   * @param { string } transactionId - The transaction ID returned by SM-DP+ server.
368   * @param { CancelReason } cancelReason - The cancel reason.
369   * @returns { Promise<ResultCode> } Returns the result code.
370   * @throws { BusinessError } 201 - Permission denied.
371   * @throws { BusinessError } 202 - Non-system applications use system APIs.
372   * @throws { BusinessError } 401 - Invalid parameter value.
373   * @throws { BusinessError } 801 - Capability not supported.
374   * @throws { BusinessError } 3120001 - Service connection failed.
375   * @throws { BusinessError } 3120002 - System internal error.
376   * @syscap SystemCapability.Telephony.CoreService.Esim
377   * @systemapi Hide this for inner system use.
378   * @since 18
379   */
380  function cancelSession(slotId: number, transactionId: string, cancelReason: CancelReason): Promise<ResultCode>;
381
382  /**
383   * Get contract info
384   *
385   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
386   * @param { number } slotId - Indicates the card slot index number.
387   * @param { ContractRequestData } requestData - request infomation required to get contract infomation.
388   * @returns { Promise<string> } Returns the contract info.
389   * @throws { BusinessError } 201 - Permission denied.
390   * @throws { BusinessError } 202 - Non-system applications use system APIs.
391   * @throws { BusinessError } 801 - Capability not supported.
392   * @throws { BusinessError } 3120001 - Service connection failed.
393   * @throws { BusinessError } 3120002 - System internal error.
394   * @syscap SystemCapability.Telephony.CoreService.Esim
395   * @systemapi Hide this for inner system use.
396   * @since 20
397   * @arkts 1.1&1.2
398   */
399  function getContractInfo(slotId: number, requestData: ContractRequestData) : Promise<string>;
400
401  /**
402   * Get supported pkids
403   *
404   * @permission ohos.permission.GET_TELEPHONY_ESIM_STATE
405   * @param { number } slotId - Indicates the card slot index number.
406   * @returns { Promise<string> } Returns the supported pkids.
407   * @throws { BusinessError } 201 - Permission denied.
408   * @throws { BusinessError } 202 - Non-system applications use system APIs.
409   * @throws { BusinessError } 801 - Capability not supported.
410   * @throws { BusinessError } 3120001 - Service connection failed.
411   * @throws { BusinessError } 3120002 - System internal error.
412   * @syscap SystemCapability.Telephony.CoreService.Esim
413   * @systemapi Hide this for inner system use.
414   * @since 20
415   * @arkts 1.1&1.2
416   */
417  function getSupportedPkids(slotId: number) : Promise<string>;
418
419  /**
420   * Contract request data
421   *
422   * @interface ContractRequestData
423   * @syscap SystemCapability.Telephony.CoreService.Esim
424   * @systemapi Hide this for inner system use.
425   * @since 20
426   * @arkts 1.1&1.2
427   */
428  export interface ContractRequestData {
429    /**
430     * Public key required to get contract info
431     *
432     * @type { string }
433     * @syscap SystemCapability.Telephony.CoreService.Esim
434     * @systemapi Hide this for inner system use.
435     * @since 20
436     * @arkts 1.1&1.2
437     */
438    publicKey: string;
439
440    /**
441     * Nonce required to get contract info
442     *
443     * @type { string }
444     * @syscap SystemCapability.Telephony.CoreService.Esim
445     * @systemapi Hide this for inner system use.
446     * @since 20
447     * @arkts 1.1&1.2
448     */
449    nonce: string;
450
451    /**
452     * Euicc Ci PKID to be used, required to get contract info
453     *
454     * @type { string }
455     * @syscap SystemCapability.Telephony.CoreService.Esim
456     * @systemapi Hide this for inner system use.
457     * @since 20
458     * @arkts 1.1&1.2
459     */
460    pkid: string;
461  }
462
463  /**
464   * Establishes a single UICC access rule pursuant to the GlobalPlatform Secure Element Access Control specification.
465   *
466   * @interface AccessRule
467   * @syscap SystemCapability.Telephony.CoreService.Esim
468   * @systemapi Hide this for inner system use.
469   * @since 18
470   */
471  /**
472   * Establishes a single UICC access rule pursuant to the GlobalPlatform Secure Element Access Control specification.
473   *
474   * @interface AccessRule
475   * @syscap SystemCapability.Telephony.CoreService.Esim
476   * @since 20
477   * @arkts 1.1&1.2
478   */
479  export interface AccessRule {
480    /**
481     * Certificate hash hexadecimal string.
482     *
483     * @type { string }
484     * @syscap SystemCapability.Telephony.CoreService.Esim
485     * @systemapi Hide this for inner system use.
486     * @since 18
487     */
488    /**
489     * Certificate hash hexadecimal string.
490     *
491     * @type { string }
492     * @syscap SystemCapability.Telephony.CoreService.Esim
493     * @since 20
494     * @arkts 1.1&1.2
495     */
496    certificateHashHexStr: string;
497
498    /**
499     * The name of package.
500     *
501     * @type { string }
502     * @syscap SystemCapability.Telephony.CoreService.Esim
503     * @systemapi Hide this for inner system use.
504     * @since 18
505     */
506    /**
507     * The name of package.
508     *
509     * @type { string }
510     * @syscap SystemCapability.Telephony.CoreService.Esim
511     * @since 20
512     * @arkts 1.1&1.2
513     */
514    packageName: string;
515
516    /**
517     * The type of access.
518     *
519     * @type { number }
520     * @syscap SystemCapability.Telephony.CoreService.Esim
521     * @systemapi Hide this for inner system use.
522     * @since 18
523     */
524    /**
525     * The type of access.
526     *
527     * @type { number }
528     * @syscap SystemCapability.Telephony.CoreService.Esim
529     * @since 20
530     * @arkts 1.1&1.2
531     */
532    accessType: number;
533  }
534
535  /**
536   * Information about a profile which is downloadable to an eUICC using.
537   *
538   * @interface DownloadableProfile
539   * @syscap SystemCapability.Telephony.CoreService.Esim
540   * @since 18
541   */
542  export interface DownloadableProfile {
543    /**
544     * Activation code.
545     *
546     * @type { string }
547     * @syscap SystemCapability.Telephony.CoreService.Esim
548     * @since 18
549     */
550    activationCode: string;
551
552    /**
553     * Confirmation code.
554     *
555     * @type { ?string }
556     * @syscap SystemCapability.Telephony.CoreService.Esim
557     * @since 18
558     */
559    confirmationCode?: string;
560
561    /**
562     * Carrier name.
563     *
564     * @type { ?string }
565     * @syscap SystemCapability.Telephony.CoreService.Esim
566     * @since 18
567     */
568    carrierName?: string;
569
570    /**
571     * Gets the accessRules.
572     *
573     * @type { ?Array<AccessRule> }
574     * @syscap SystemCapability.Telephony.CoreService.Esim
575     * @since 18
576     */
577    accessRules?: Array<AccessRule>;
578  }
579
580  /**
581   * Result the metadata for a downloadableProfile.
582   *
583   * @interface GetDownloadableProfileMetadataResult
584   * @syscap SystemCapability.Telephony.CoreService.Esim
585   * @systemapi Hide this for inner system use.
586   * @since 18
587   */
588  export interface GetDownloadableProfileMetadataResult {
589    /**
590     * Information about a profile which is downloadable to an eUICC using.
591     *
592     * @type { DownloadableProfile }
593     * @syscap SystemCapability.Telephony.CoreService.Esim
594     * @systemapi Hide this for inner system use.
595     * @since 18
596     */
597    downloadableProfile: DownloadableProfile;
598
599    /**
600     * The type of profile policy rule.
601     *
602     * @type { number }
603     * @syscap SystemCapability.Telephony.CoreService.Esim
604     * @systemapi Hide this for inner system use.
605     * @since 18
606     */
607    pprType: number;
608
609    /**
610     * The flag of profile policy rule.
611     *
612     * @type { boolean }
613     * @syscap SystemCapability.Telephony.CoreService.Esim
614     * @systemapi Hide this for inner system use.
615     * @since 18
616     */
617    pprFlag: boolean;
618
619    /**
620     * The iccid of the profile.
621     *
622     * @type { string }
623     * @syscap SystemCapability.Telephony.CoreService.Esim
624     * @systemapi Hide this for inner system use.
625     * @since 18
626     */
627    iccid: string;
628
629    /**
630     * The service provider name for the profile.
631     *
632     * @type { string }
633     * @syscap SystemCapability.Telephony.CoreService.Esim
634     * @systemapi Hide this for inner system use.
635     * @since 18
636     */
637    serviceProviderName: string;
638
639    /**
640     * The profile name.
641     *
642     * @type { string }
643     * @syscap SystemCapability.Telephony.CoreService.Esim
644     * @systemapi Hide this for inner system use.
645     * @since 18
646     */
647    profileName: string;
648
649    /**
650     * Profile class for the profile.
651     *
652     * @type { ProfileClass }
653     * @syscap SystemCapability.Telephony.CoreService.Esim
654     * @systemapi Hide this for inner system use.
655     * @since 18
656     */
657    profileClass: ProfileClass;
658
659    /**
660     * Gets the solvable errors.
661     *
662     * @type { SolvableErrors }
663     * @syscap SystemCapability.Telephony.CoreService.Esim
664     * @systemapi Hide this for inner system use.
665     * @since 18
666     */
667    solvableErrors: SolvableErrors;
668
669    /**
670     * Gets the result of the operation.
671     *
672     * @type { ResultCode }
673     * @syscap SystemCapability.Telephony.CoreService.Esim
674     * @systemapi Hide this for inner system use.
675     * @since 18
676     */
677    responseResult: ResultCode;
678  }
679
680  /**
681   * Result of downloadable Profile list.
682   *
683   * @interface GetDownloadableProfilesResult
684   * @syscap SystemCapability.Telephony.CoreService.Esim
685   * @systemapi Hide this for inner system use.
686   * @since 18
687   */
688  export interface GetDownloadableProfilesResult {
689    /**
690     * Gets the result of the operation.
691     *
692     * @type { ResultCode }
693     * @syscap SystemCapability.Telephony.CoreService.Esim
694     * @systemapi Hide this for inner system use.
695     * @since 18
696     */
697    responseResult: ResultCode;
698
699    /**
700     * Gets the downloadable Profiles with filled-in metadata.
701     *
702     * @type { Array<DownloadableProfile> }
703     * @syscap SystemCapability.Telephony.CoreService.Esim
704     * @systemapi Hide this for inner system use.
705     * @since 18
706     */
707    downloadableProfiles: Array<DownloadableProfile>;
708  }
709
710  /**
711   * Result of the given downloadable Profile.
712   *
713   * @interface DownloadProfileResult
714   * @syscap SystemCapability.Telephony.CoreService.Esim
715   * @systemapi Hide this for inner system use.
716   * @since 18
717   */
718  export interface DownloadProfileResult {
719    /**
720     * Gets the result of the operation.
721     *
722     * @type { ResultCode }
723     * @syscap SystemCapability.Telephony.CoreService.Esim
724     * @systemapi Hide this for inner system use.
725     * @since 18
726     */
727    responseResult: ResultCode;
728
729    /**
730     * Gets the solvable errors.
731     *
732     * @type { SolvableErrors }
733     * @syscap SystemCapability.Telephony.CoreService.Esim
734     * @systemapi Hide this for inner system use.
735     * @since 18
736     */
737    solvableErrors: SolvableErrors;
738
739    /**
740     * Gets the card Id. This value comes from EuiccService and is used when resolving solvable errors.
741     *
742     * @type { number }
743     * @syscap SystemCapability.Telephony.CoreService.Esim
744     * @systemapi Hide this for inner system use.
745     * @since 18
746     */
747    cardId: number;
748  }
749
750  /**
751   * Result of all eUICC profile information.
752   *
753   * @interface GetEuiccProfileInfoListResult
754   * @syscap SystemCapability.Telephony.CoreService.Esim
755   * @systemapi Hide this for inner system use.
756   * @since 18
757   */
758  export interface GetEuiccProfileInfoListResult {
759    /**
760     * Gets the result of the operation.
761     *
762     * @type { ResultCode }
763     * @syscap SystemCapability.Telephony.CoreService.Esim
764     * @systemapi Hide this for inner system use.
765     * @since 18
766     */
767    responseResult: ResultCode;
768
769    /**
770     * Gets the profile list (only upon success).
771     *
772     * @type { Array<EuiccProfile> }
773     * @syscap SystemCapability.Telephony.CoreService.Esim
774     * @systemapi Hide this for inner system use.
775     * @since 18
776     */
777    profiles: Array<EuiccProfile>;
778
779    /**
780     * Gets whether the eUICC can be removed.
781     *
782     * @type { boolean }
783     * @syscap SystemCapability.Telephony.CoreService.Esim
784     * @systemapi Hide this for inner system use.
785     * @since 18
786     */
787    isRemovable: boolean;
788  }
789
790  /**
791   * Information about the eUICC chip/device.
792   *
793   * @interface OperatorId
794   * @syscap SystemCapability.Telephony.CoreService.Esim
795   * @systemapi Hide this for inner system use.
796   * @since 18
797   */
798  export interface OperatorId {
799    /**
800     * Mobile country code.
801     *
802     * @type { string }
803     * @syscap SystemCapability.Telephony.CoreService.Esim
804     * @systemapi Hide this for inner system use.
805     * @since 18
806     */
807    mcc: string;
808
809    /**
810     * Mobile network code.
811     *
812     * @type { string }
813     * @syscap SystemCapability.Telephony.CoreService.Esim
814     * @systemapi Hide this for inner system use.
815     * @since 18
816     */
817    mnc: string;
818
819    /**
820     * Group id level 1.
821     *
822     * @type { string }
823     * @syscap SystemCapability.Telephony.CoreService.Esim
824     * @systemapi Hide this for inner system use.
825     * @since 18
826     */
827    gid1: string;
828
829    /**
830     * Group id level 2.
831     *
832     * @type { string }
833     * @syscap SystemCapability.Telephony.CoreService.Esim
834     * @systemapi Hide this for inner system use.
835     * @since 18
836     */
837    gid2: string;
838  }
839
840  /**
841   * Information about an embedded profile (subscription) on an eUICC.
842   *
843   * @interface EuiccProfile
844   * @syscap SystemCapability.Telephony.CoreService.Esim
845   * @systemapi Hide this for inner system use.
846   * @since 18
847   */
848  export interface EuiccProfile {
849    /**
850     * The iccid of the profile.
851     *
852     * @type { string }
853     * @syscap SystemCapability.Telephony.CoreService.Esim
854     * @systemapi Hide this for inner system use.
855     * @since 18
856     */
857    iccid: string;
858
859    /**
860     * An optional nickname for the profile.
861     *
862     * @type { string }
863     * @syscap SystemCapability.Telephony.CoreService.Esim
864     * @systemapi Hide this for inner system use.
865     * @since 18
866     */
867    nickName: string;
868
869    /**
870     * The service provider name for the profile.
871     *
872     * @type { string }
873     * @syscap SystemCapability.Telephony.CoreService.Esim
874     * @systemapi Hide this for inner system use.
875     * @since 18
876     */
877    serviceProviderName: string;
878
879    /**
880     * The profile name.
881     *
882     * @type { string }
883     * @syscap SystemCapability.Telephony.CoreService.Esim
884     * @systemapi Hide this for inner system use.
885     * @since 18
886     */
887    profileName: string;
888
889    /**
890     * The profile state.
891     *
892     * @type { ProfileState }
893     * @syscap SystemCapability.Telephony.CoreService.Esim
894     * @systemapi Hide this for inner system use.
895     * @since 18
896     */
897    state: ProfileState;
898
899    /**
900     * Profile class for the profile.
901     *
902     * @type { ProfileClass }
903     * @syscap SystemCapability.Telephony.CoreService.Esim
904     * @systemapi Hide this for inner system use.
905     * @since 18
906     */
907    profileClass: ProfileClass;
908
909    /**
910     * The operator Id of the profile.
911     *
912     * @type { OperatorId }
913     * @syscap SystemCapability.Telephony.CoreService.Esim
914     * @systemapi Hide this for inner system use.
915     * @since 18
916     */
917    operatorId: OperatorId;
918
919    /**
920     * The policy rules of the profile.
921     *
922     * @type { PolicyRules }
923     * @syscap SystemCapability.Telephony.CoreService.Esim
924     * @systemapi Hide this for inner system use.
925     * @since 18
926     */
927    policyRules: PolicyRules;
928
929    /**
930     * Optional access rules that specify which apps can manage this profile. Default platform management when not set.
931     *
932     * @type { Array<AccessRule> }
933     * @syscap SystemCapability.Telephony.CoreService.Esim
934     * @systemapi Hide this for inner system use.
935     * @since 18
936     */
937    accessRules: Array<AccessRule>;
938  }
939
940  /**
941   * Information related to eUICC chips/devices.
942   *
943   * @interface EuiccInfo
944   * @syscap SystemCapability.Telephony.CoreService.Esim
945   * @systemapi Hide this for inner system use.
946   * @since 18
947   */
948  export interface EuiccInfo {
949    /**
950     * Operating system version.
951     *
952     * @type { string }
953     * @syscap SystemCapability.Telephony.CoreService.Esim
954     * @systemapi Hide this for inner system use.
955     * @since 18
956     */
957    osVersion: string;
958  }
959
960  /**
961   * Options for resetting eUICC memory.
962   *
963   * @enum { number }
964   * @syscap SystemCapability.Telephony.CoreService.Esim
965   * @systemapi Hide this for inner system use.
966   * @since 18
967   */
968  export enum ResetOption {
969    /**
970     * Deletes all operational profiles on reset.
971     *
972     * @syscap SystemCapability.Telephony.CoreService.Esim
973     * @systemapi Hide this for inner system use.
974     * @since 18
975     */
976    DELETE_OPERATIONAL_PROFILES = 1,
977
978    /**
979     * Deletes all field-loaded testing profiles on reset.
980     *
981     * @syscap SystemCapability.Telephony.CoreService.Esim
982     * @systemapi Hide this for inner system use.
983     * @since 18
984     */
985    DELETE_FIELD_LOADED_TEST_PROFILES = 1 << 1,
986
987    /**
988     * Resets the default SM-DP+ address on reset.
989     *
990     * @syscap SystemCapability.Telephony.CoreService.Esim
991     * @systemapi Hide this for inner system use.
992     * @since 18
993     */
994    RESET_DEFAULT_SMDP_ADDRESS = 1 << 2
995  }
996
997  /**
998   * Euicc OS upgrade status.
999   *
1000   * @enum { number }
1001   * @syscap SystemCapability.Telephony.CoreService.Esim
1002   * @systemapi Hide this for inner system use.
1003   * @since 18
1004   */
1005  export enum OsuStatus {
1006    /**
1007     * The OS upgrade is in progress.
1008     *
1009     * @syscap SystemCapability.Telephony.CoreService.Esim
1010     * @systemapi Hide this for inner system use.
1011     * @since 18
1012     */
1013    EUICC_UPGRADE_IN_PROGRESS = 1,
1014
1015    /**
1016     * The OS upgrade failed.
1017     *
1018     * @syscap SystemCapability.Telephony.CoreService.Esim
1019     * @systemapi Hide this for inner system use.
1020     * @since 18
1021     */
1022    EUICC_UPGRADE_FAILED = 2,
1023
1024    /**
1025     * The OS upgrade successful.
1026     *
1027     * @syscap SystemCapability.Telephony.CoreService.Esim
1028     * @systemapi Hide this for inner system use.
1029     * @since 18
1030     */
1031    EUICC_UPGRADE_SUCCESSFUL = 3,
1032
1033    /**
1034     * The OS upgrade not needed since current eUICC OS is latest.
1035     *
1036     * @syscap SystemCapability.Telephony.CoreService.Esim
1037     * @systemapi Hide this for inner system use.
1038     * @since 18
1039     */
1040    EUICC_UPGRADE_ALREADY_LATEST = 4,
1041
1042    /**
1043     * The OS upgrade status is unavailable since eUICC service is unavailable.
1044     *
1045     * @syscap SystemCapability.Telephony.CoreService.Esim
1046     * @systemapi Hide this for inner system use.
1047     * @since 18
1048     */
1049    EUICC_UPGRADE_SERVICE_UNAVAILABLE = 5
1050  }
1051
1052  /**
1053   * Result state.
1054   *
1055   * @enum { number }
1056   * @syscap SystemCapability.Telephony.CoreService.Esim
1057   * @systemapi Hide this for inner system use.
1058   * @since 18
1059   */
1060  export enum ResultCode {
1061    /**
1062     * Indicates that the user must resolve a solvable error.
1063     *
1064     * @syscap SystemCapability.Telephony.CoreService.Esim
1065     * @systemapi Hide this for inner system use.
1066     * @since 18
1067     */
1068    RESULT_SOLVABLE_ERRORS = -2,
1069
1070    /**
1071     * Indicates that the active profile must be disabled to perform the operation.
1072     *
1073     * @syscap SystemCapability.Telephony.CoreService.Esim
1074     * @systemapi Hide this for inner system use.
1075     * @since 18
1076     */
1077    RESULT_MUST_DISABLE_PROFILE = -1,
1078
1079    /**
1080     * Operation succeeded.
1081     *
1082     * @syscap SystemCapability.Telephony.CoreService.Esim
1083     * @systemapi Hide this for inner system use.
1084     * @since 18
1085     */
1086    RESULT_OK = 0,
1087
1088    /**
1089     * Failed to obtain the EID.
1090     *
1091     * @syscap SystemCapability.Telephony.CoreService.Esim
1092     * @systemapi Hide this for inner system use.
1093     * @since 18
1094     */
1095    RESULT_GET_EID_FAILED = 201,
1096
1097    /**
1098     * The activation code is changed after the end user confirms the operation.
1099     *
1100     * @syscap SystemCapability.Telephony.CoreService.Esim
1101     * @systemapi Hide this for inner system use.
1102     * @since 18
1103     */
1104    RESULT_ACTIVATION_CODE_CHANGED = 203,
1105
1106    /**
1107     * The activation code is invalid.
1108     *
1109     * @syscap SystemCapability.Telephony.CoreService.Esim
1110     * @systemapi Hide this for inner system use.
1111     * @since 18
1112     */
1113    RESULT_ACTIVATION_CODE_INVALID = 204,
1114
1115    /**
1116     * The SM-DP+ server address is invalid.
1117     *
1118     * @syscap SystemCapability.Telephony.CoreService.Esim
1119     * @systemapi Hide this for inner system use.
1120     * @since 18
1121     */
1122    RESULT_SMDP_ADDRESS_INVALID = 205,
1123
1124    /**
1125     * Invalid eUICC information.
1126     *
1127     * @syscap SystemCapability.Telephony.CoreService.Esim
1128     * @systemapi Hide this for inner system use.
1129     * @since 18
1130     */
1131    RESULT_EUICC_INFO_INVALID = 206,
1132
1133    /**
1134     * TLS handshake fails.
1135     *
1136     * @syscap SystemCapability.Telephony.CoreService.Esim
1137     * @systemapi Hide this for inner system use.
1138     * @since 18
1139     */
1140    RESULT_TLS_HANDSHAKE_FAILED = 207,
1141
1142    /**
1143     * Certificate network connection error.
1144     *
1145     * @syscap SystemCapability.Telephony.CoreService.Esim
1146     * @systemapi Hide this for inner system use.
1147     * @since 18
1148     */
1149    RESULT_CERTIFICATE_IO_ERROR = 208,
1150
1151    /**
1152     * The certificate address is invalid or the response times out.
1153     *
1154     * @syscap SystemCapability.Telephony.CoreService.Esim
1155     * @systemapi Hide this for inner system use.
1156     * @since 18
1157     */
1158    RESULT_CERTIFICATE_RESPONSE_TIMEOUT = 209,
1159
1160    /**
1161     * Authentication fails.
1162     *
1163     * @syscap SystemCapability.Telephony.CoreService.Esim
1164     * @systemapi Hide this for inner system use.
1165     * @since 18
1166     */
1167    RESULT_AUTHENTICATION_FAILED = 210,
1168
1169    /**
1170     * HTTP response fails.
1171     *
1172     * @syscap SystemCapability.Telephony.CoreService.Esim
1173     * @systemapi Hide this for inner system use.
1174     * @since 18
1175     */
1176    RESULT_RESPONSE_HTTP_FAILED = 211,
1177
1178    /**
1179     * Incorrect confirmation code.
1180     *
1181     * @syscap SystemCapability.Telephony.CoreService.Esim
1182     * @systemapi Hide this for inner system use.
1183     * @since 18
1184     */
1185    RESULT_CONFIRMATION_CODE_INCORRECT = 212,
1186
1187    /**
1188     * The maximum number of confirmation code attempts is reached.
1189     *
1190     * @syscap SystemCapability.Telephony.CoreService.Esim
1191     * @systemapi Hide this for inner system use.
1192     * @since 18
1193     */
1194    RESULT_EXCEEDED_CONFIRMATION_CODE_TRY_LIMIT = 213,
1195
1196    /**
1197     * There is no profile on the server for download.
1198     *
1199     * @syscap SystemCapability.Telephony.CoreService.Esim
1200     * @systemapi Hide this for inner system use.
1201     * @since 18
1202     */
1203    RESULT_NO_PROFILE_ON_SERVER = 214,
1204
1205    /**
1206     * The transaction ID is invalid.
1207     *
1208     * @syscap SystemCapability.Telephony.CoreService.Esim
1209     * @systemapi Hide this for inner system use.
1210     * @since 18
1211     */
1212    RESULT_TRANSACTION_ID_INVALID = 215,
1213
1214    /**
1215     * The server address is invalid.
1216     *
1217     * @syscap SystemCapability.Telephony.CoreService.Esim
1218     * @systemapi Hide this for inner system use.
1219     * @since 18
1220     */
1221    RESULT_SERVER_ADDRESS_INVALID = 216,
1222
1223    /**
1224     * Failed to obtain the bound profile package.
1225     *
1226     * @syscap SystemCapability.Telephony.CoreService.Esim
1227     * @systemapi Hide this for inner system use.
1228     * @since 18
1229     */
1230    RESULT_GET_BOUND_PROFILE_PACKAGE_FAILED = 217,
1231
1232    /**
1233     * The download is canceled by the end user.
1234     *
1235     * @syscap SystemCapability.Telephony.CoreService.Esim
1236     * @systemapi Hide this for inner system use.
1237     * @since 18
1238     */
1239    RESULT_USER_CANCEL_DOWNLOAD = 218,
1240
1241    /**
1242     * The carrier server is unavailable.
1243     *
1244     * @syscap SystemCapability.Telephony.CoreService.Esim
1245     * @systemapi Hide this for inner system use.
1246     * @since 18
1247     */
1248    RESULT_SERVER_UNAVAILABLE = 220,
1249
1250    /**
1251     * The profile is attached to a non-delete profile policy rule.
1252     *
1253     * @syscap SystemCapability.Telephony.CoreService.Esim
1254     * @systemapi Hide this for inner system use.
1255     * @since 18
1256     */
1257    RESULT_PROFILE_NON_DELETE = 223,
1258
1259    /**
1260     * The authentication response server address does not match.
1261     *
1262     * @syscap SystemCapability.Telephony.CoreService.Esim
1263     * @systemapi Hide this for inner system use.
1264     * @since 18
1265     */
1266    RESULT_SMDP_ADDRESS_INCORRECT = 226,
1267
1268    /**
1269     * Failed to analyze the authentication server response.
1270     *
1271     * @syscap SystemCapability.Telephony.CoreService.Esim
1272     * @systemapi Hide this for inner system use.
1273     * @since 18
1274     */
1275    RESULT_ANALYZE_AUTHENTICATION_SERVER_RESPONSE_FAILED = 228,
1276
1277    /**
1278     * Failed to analyze the authentication client response.
1279     *
1280     * @syscap SystemCapability.Telephony.CoreService.Esim
1281     * @systemapi Hide this for inner system use.
1282     * @since 18
1283     */
1284    RESULT_ANALYZE_AUTHENTICATION_CLIENT_RESPONSE_FAILED = 229,
1285
1286    /**
1287     * Failed to analyze the authentication client response because the matching ID is rejected.
1288     *
1289     * @syscap SystemCapability.Telephony.CoreService.Esim
1290     * @systemapi Hide this for inner system use.
1291     * @since 18
1292     */
1293    RESULT_ANALYZE_AUTHENTICATION_CLIENT_MATCHING_ID_REFUSED = 231,
1294
1295    /**
1296     * Authentication stopped due to an error in the profile type.
1297     *
1298     * @syscap SystemCapability.Telephony.CoreService.Esim
1299     * @systemapi Hide this for inner system use.
1300     * @since 18
1301     */
1302    RESULT_PROFILE_TYPE_ERROR_AUTHENTICATION_STOPPED = 233,
1303
1304    /**
1305     * The carrier server refused errors of which the reason code is 3.8.
1306     *
1307     * @syscap SystemCapability.Telephony.CoreService.Esim
1308     * @systemapi Hide this for inner system use.
1309     * @since 18
1310     */
1311    RESULT_CARRIER_SERVER_REFUSED_ERRORS = 249,
1312
1313    /**
1314     * The certificate is invalid.
1315     *
1316     * @syscap SystemCapability.Telephony.CoreService.Esim
1317     * @systemapi Hide this for inner system use.
1318     * @since 18
1319     */
1320    RESULT_CERTIFICATE_INVALID = 251,
1321
1322    /**
1323     * Profile installation failed due to insufficient memory.
1324     *
1325     * @syscap SystemCapability.Telephony.CoreService.Esim
1326     * @systemapi Hide this for inner system use.
1327     * @since 18
1328     */
1329    RESULT_OUT_OF_MEMORY = 263,
1330
1331    /**
1332     * The profile policy rule prohibits this operation during download.
1333     *
1334     * @syscap SystemCapability.Telephony.CoreService.Esim
1335     * @systemapi Hide this for inner system use.
1336     * @since 18
1337     */
1338    RESULT_PPR_FORBIDDEN = 268,
1339
1340    /**
1341     * Nothing is to be deleted.
1342     *
1343     * @syscap SystemCapability.Telephony.CoreService.Esim
1344     * @systemapi Hide this for inner system use.
1345     * @since 18
1346     */
1347    RESULT_NOTHING_TO_DELETE = 270,
1348
1349    /**
1350     * The profile policy rule does not match.
1351     *
1352     * @syscap SystemCapability.Telephony.CoreService.Esim
1353     * @systemapi Hide this for inner system use.
1354     * @since 18
1355     */
1356    RESULT_PPR_NOT_MATCH = 276,
1357
1358    /**
1359     * A session is ongoing.
1360     *
1361     * @syscap SystemCapability.Telephony.CoreService.Esim
1362     * @systemapi Hide this for inner system use.
1363     * @since 18
1364     */
1365    RESULT_CAT_BUSY = 283,
1366
1367    /**
1368     * This eSIM profile is already in use or is invalid.
1369     *
1370     * @syscap SystemCapability.Telephony.CoreService.Esim
1371     * @systemapi Hide this for inner system use.
1372     * @since 18
1373     */
1374    RESULT_PROFILE_EID_INVALID = 284,
1375
1376    /**
1377     * Download times out.
1378     *
1379     * @syscap SystemCapability.Telephony.CoreService.Esim
1380     * @systemapi Hide this for inner system use.
1381     * @since 18
1382     */
1383    RESULT_DOWNLOAD_TIMEOUT = 287,
1384
1385    /**
1386     * Other errors defined in SGP.22.
1387     *
1388     * @syscap SystemCapability.Telephony.CoreService.Esim
1389     * @systemapi Hide this for inner system use.
1390     * @since 18
1391     */
1392    RESULT_SGP_22_OTHER = 400
1393  }
1394
1395  /**
1396   * The reason for canceling a profile download session.
1397   *
1398   * @enum { number }
1399   * @syscap SystemCapability.Telephony.CoreService.Esim
1400   * @systemapi Hide this for inner system use.
1401   * @since 18
1402   */
1403  export enum CancelReason {
1404    /**
1405     * The end user has rejected the download.
1406     *
1407     * @syscap SystemCapability.Telephony.CoreService.Esim
1408     * @systemapi Hide this for inner system use.
1409     * @since 18
1410     */
1411    CANCEL_REASON_END_USER_REJECTION = 0,
1412
1413    /**
1414     * The download has been postponed and you can try again later.
1415     *
1416     * @syscap SystemCapability.Telephony.CoreService.Esim
1417     * @systemapi Hide this for inner system use.
1418     * @since 18
1419     */
1420    CANCEL_REASON_POSTPONED = 1,
1421
1422    /**
1423     * The download has been timed out and you can try again later.
1424     *
1425     * @syscap SystemCapability.Telephony.CoreService.Esim
1426     * @systemapi Hide this for inner system use.
1427     * @since 18
1428     */
1429    CANCEL_REASON_TIMEOUT = 2,
1430
1431    /**
1432     * The profile to be downloaded cannot be installed because profile policy rules are not allowed.
1433     *
1434     * @syscap SystemCapability.Telephony.CoreService.Esim
1435     * @systemapi Hide this for inner system use.
1436     * @since 18
1437     */
1438    CANCEL_REASON_PPR_NOT_ALLOWED = 3
1439  }
1440
1441  /**
1442   * The profile state.
1443   *
1444   * @enum { number }
1445   * @syscap SystemCapability.Telephony.CoreService.Esim
1446   * @systemapi Hide this for inner system use.
1447   * @since 18
1448   */
1449  export enum ProfileState {
1450    /**
1451     * Profile state not specified.
1452     *
1453     * @syscap SystemCapability.Telephony.CoreService.Esim
1454     * @systemapi Hide this for inner system use.
1455     * @since 18
1456     */
1457    PROFILE_STATE_UNSPECIFIED = -1,
1458
1459    /**
1460     * Disabled profiles.
1461     *
1462     * @syscap SystemCapability.Telephony.CoreService.Esim
1463     * @systemapi Hide this for inner system use.
1464     * @since 18
1465     */
1466    PROFILE_STATE_DISABLED = 0,
1467
1468    /**
1469     * Enabled profile.
1470     *
1471     * @syscap SystemCapability.Telephony.CoreService.Esim
1472     * @systemapi Hide this for inner system use.
1473     * @since 18
1474     */
1475    PROFILE_STATE_ENABLED = 1
1476  }
1477
1478  /**
1479   * The Profile class.
1480   *
1481   * @enum { number }
1482   * @syscap SystemCapability.Telephony.CoreService.Esim
1483   * @systemapi Hide this for inner system use.
1484   * @since 18
1485   */
1486  export enum ProfileClass {
1487    /**
1488     * Profile class not specified.
1489     *
1490     * @syscap SystemCapability.Telephony.CoreService.Esim
1491     * @systemapi Hide this for inner system use.
1492     * @since 18
1493     */
1494    PROFILE_CLASS_UNSPECIFIED = -1,
1495
1496    /**
1497     * Testing profiles.
1498     *
1499     * @syscap SystemCapability.Telephony.CoreService.Esim
1500     * @systemapi Hide this for inner system use.
1501     * @since 18
1502     */
1503    PROFILE_CLASS_TEST = 0,
1504
1505    /**
1506     * Provisioning profiles that preloaded on the eUICC.
1507     *
1508     * @syscap SystemCapability.Telephony.CoreService.Esim
1509     * @systemapi Hide this for inner system use.
1510     * @since 18
1511     */
1512    PROFILE_CLASS_PROVISIONING = 1,
1513
1514    /**
1515     * Operational profiles that can be preloaded or downloaded.
1516     *
1517     * @syscap SystemCapability.Telephony.CoreService.Esim
1518     * @systemapi Hide this for inner system use.
1519     * @since 18
1520     */
1521    PROFILE_CLASS_OPERATIONAL = 2
1522  }
1523
1524  /**
1525   * The policy rules of the profile.
1526   *
1527   * @enum { number }
1528   * @syscap SystemCapability.Telephony.CoreService.Esim
1529   * @systemapi Hide this for inner system use.
1530   * @since 18
1531   */
1532  export enum PolicyRules {
1533    /**
1534     * Disabling of this Profile is not allowed.
1535     *
1536     * @syscap SystemCapability.Telephony.CoreService.Esim
1537     * @systemapi Hide this for inner system use.
1538     * @since 18
1539     */
1540    POLICY_RULE_DISABLE_NOT_ALLOWED = 1,
1541
1542    /**
1543     * Deletion of this Profile is not allowed.
1544     *
1545     * @syscap SystemCapability.Telephony.CoreService.Esim
1546     * @systemapi Hide this for inner system use.
1547     * @since 18
1548     */
1549    POLICY_RULE_DELETE_NOT_ALLOWED = 1 << 1,
1550
1551    /**
1552     * This profile should be deleted when disabled.
1553     *
1554     * @syscap SystemCapability.Telephony.CoreService.Esim
1555     * @systemapi Hide this for inner system use.
1556     * @since 18
1557     */
1558    POLICY_RULE_DISABLE_AND_DELETE = 1 << 2
1559  }
1560
1561  /**
1562   * The solvable errors.
1563   *
1564   * @enum { number }
1565   * @syscap SystemCapability.Telephony.CoreService.Esim
1566   * @systemapi Hide this for inner system use.
1567   * @since 18
1568   */
1569  export enum SolvableErrors {
1570    /**
1571     * Indicates that the user needs to input a confirmation code during the download.
1572     *
1573     * @syscap SystemCapability.Telephony.CoreService.Esim
1574     * @systemapi Hide this for inner system use.
1575     * @since 18
1576     */
1577    SOLVABLE_ERROR_NEED_CONFIRMATION_CODE = 1 << 0,
1578
1579    /**
1580     * Indicates that the download process requires user consent to allow profile policy rules.
1581     *
1582     * @syscap SystemCapability.Telephony.CoreService.Esim
1583     * @systemapi Hide this for inner system use.
1584     * @since 18
1585     */
1586    SOLVABLE_ERROR_NEED_POLICY_RULE = 1 << 1
1587  }
1588
1589  /**
1590   * Specifies the download configuration.
1591   *
1592   * @interface DownloadConfiguration
1593   * @syscap SystemCapability.Telephony.CoreService.Esim
1594   * @systemapi Hide this for inner system use.
1595   * @since 18
1596   */
1597  export interface DownloadConfiguration {
1598    /**
1599     * Specifies whether to enable the profile after successful download.
1600     *
1601     * @type { boolean }
1602     * @syscap SystemCapability.Telephony.CoreService.Esim
1603     * @systemapi Hide this for inner system use.
1604     * @since 18
1605     */
1606    switchAfterDownload: boolean;
1607
1608    /**
1609     * Specifies whether to forcibly disable the profile. If true, the active profile is disabled in order to perform
1610     * the operation. Otherwise, {@link RESULT_MUST_DISABLE_PROFILE} is returned in resultCode to ask for the user's
1611     * agreement to the operation.
1612     *
1613     * @type { boolean }
1614     * @syscap SystemCapability.Telephony.CoreService.Esim
1615     * @systemapi Hide this for inner system use.
1616     * @since 18
1617     */
1618    forceDisableProfile: boolean;
1619
1620    /**
1621     * Specifies whether the user allows the service provider to enforce this Profile Policy Rule (PPR)
1622     * after being informed of its restrictions.
1623     *
1624     * @type { boolean }
1625     * @syscap SystemCapability.Telephony.CoreService.Esim
1626     * @systemapi Hide this for inner system use.
1627     * @since 18
1628     */
1629    isPprAllowed: boolean;
1630  }
1631}
1632
1633export default eSIM;