openharmony 鸿蒙 js-apis-esim-sys

2025-06-12 浏览 (1)

@ohos.telephony.esim (eSIM Management) (System API)

The esim module provides APIs for eSIM management and eSIM services.

NOTE

The initial APIs of this module are supported since API version 18. Newly added APIs will be marked with a superscript to indicate their earliest API version. This topic describes only system APIs provided by the module. For details about its public APIs, see @ohos.telephony.esim (eSIM Management).

Modules to Import

import { eSIM } from '@kit.TelephonyKit';

eSIM.getEid18+

getEid(slotId: number): Promise<string>

Obtains the EID of the embedded universal integrated circuit card (eUICC) in the specified slot.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
stringEID of the eUICC in the specified slot.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { eSIM } from '@kit.TelephonyKit';

let eid: string = eSIM.getEid(0);
console.log(`the EID is:` + eid);

eSIM.getOsuStatus18+

getOsuStatus(slotId: number): Promise<OsuStatus>

Obtains the OS upgrade status for the eSIM in the specified slot. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<OsuStatus>Promise used to return the OS upgrade status.
1. Updating.
2. Update failed.
3. Update succeeded.
4. Already the latest version.
5. Update service unavailable.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.getOsuStatus(0).then(() => {
    console.log(`getOsuStatus invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`getOsuStatus, promise: err->${JSON.stringify(err)}`);
});

eSIM.startOsu18+

startOsu(slotId: number): Promise<OsuStatus>

Upgrades the OS if the OS version of the eSIM in the specified slot is not the latest. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<OsuStatus>Promise used to return the OS upgrade status.
1. Updating.
2. Update failed.
3. Update succeeded.
4. Already the latest version.
5. Update service unavailable.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.startOsu(0).then(() => {
    console.log(`startOsu invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`startOsu, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.getDownloadableProfileMetadata18+

getDownloadableProfileMetadata(slotId: number, portIndex: number, profile: DownloadableProfile, forceDisableProfile: boolean): Promise<GetDownloadableProfileMetadataResult>

Obtains the metadata of the downloadable profile. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
portIndexnumberYesPort index of the slot.
profileDownloadableProfileYesDownloadable profile.
forceDisableProfilebooleanYesWhether to forcibly diable the active SIM. If the value is true, the operation can be performed only after the active SIM card is disabled. If the value is false, the system displays a message asking the user to agree to the operation.

Returns

TypeDescription
Promise<GetDownloadableProfileMetadataResult>Promise used to return the metadata of the downloadable profile.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

let profile: eSIM.DownloadableProfile={
  activationCode:'1',
  confirmationCode:'1',
  carrierName:'test',
  accessRules:[{
    certificateHashHexStr:'test',
    packageName:'com.example.testcoreservice',
    accessType:0
  }]
};

eSIM.getDownloadableProfileMetadata(0, 0, profile, true).then((data: eSIM.GetDownloadableProfileMetadataResult) => {
    console.log(`getDownloadableProfileMetadata, GetDownloadableProfileMetadataResult: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getDownloadableProfileMetadata, GetDownloadableProfileMetadataResult: err->${JSON.stringify(err)}`);
});

eSIM.getDownloadableProfiles18+

getDownloadableProfiles(slotId: number, portIndex: number, forceDisableProfile: boolean): Promise<GetDownloadableProfilesResult>

Obtains the list of downloadable profiles. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
portIndexnumberYesPort index of the slot.
forceDisableProfilebooleanYesWhether to forcibly diable the active SIM. If the value is true, the operation can be performed only after the active SIM card is disabled. If the value is false, the system displays a message asking the user to agree to the operation.

Returns

TypeDescription
Promise<GetDownloadableProfilesResult>Promise used to return the list of downloadable profiles.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.getDownloadableProfiles(0, 0, true).then((data: eSIM.GetDownloadableProfilesResult) => {
    console.log(`getDownloadableProfiles, GetDownloadableProfilesResult: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getDownloadableProfiles, GetDownloadableProfilesResult: err->${JSON.stringify(err)}`);
});

eSIM.downloadProfile18+

downloadProfile(slotId: number, portIndex: number, profile: DownloadableProfile, configuration: DownloadConfiguration): Promise<DownloadProfileResult>

Downloads a profile. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
portIndexnumberYesPort index of the slot.
profileDownloadableProfileYesDownloadable profile.
configurationDownloadConfigurationYesDownload configuration.

Returns

TypeDescription
Promise<DownloadProfileResult>Promise used to return the profile download result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

let profile: eSIM.DownloadableProfile={
  activationCode:'1',
  confirmationCode:'1',
  carrierName:'test',
  accessRules:[{
    certificateHashHexStr:'test',
    packageName:'com.example.testcoreservice',
    accessType:0
  }]
};

let configuration: eSIM.DownloadConfiguration = {
  switchAfterDownload: true,
  forceDisableProfile: true,
  isAlowPpr: true,
};

eSIM.downloadProfile(0, 0, profile, configuration).then((data: eSIM.DownloadProfileResult) => {
    console.log(`downloadProfile, DownloadProfileResult: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`downloadProfile, DownloadProfileResult: err->${JSON.stringify(err)}`);
});

eSIM.getEuiccProfileInfoList18+

getEuiccProfileInfoList(slotId: number): Promise<GetEuiccProfileInfoListResult>

Obtains the profile information list. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<GetEuiccProfileInfoListResult>Promise used to return the profile information list.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.getEuiccProfileInfoList(0).then((data: eSIM.GetEuiccProfileInfoListResult) => {
    console.log(`getEuiccProfileInfoList, GetEuiccProfileInfoListResult: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getEuiccProfileInfoList, GetEuiccProfileInfoListResult: err->${JSON.stringify(err)}`);
});

eSIM.getEuiccInfo18+

getEuiccInfo(slotId: number): Promise<EuiccInfo>

Obtains eUICC information. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<EuiccInfo>Promise used to return the eUICC information.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.getEuiccInfo(0).then((data: eSIM.EuiccInfo) => {
    console.log(`getEuiccInfo, EuiccInfo: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getEuiccInfo, EuiccInfo: err->${JSON.stringify(err)}`);
});

eSIM.deleteProfile18+

deleteProfile(slotId: number, iccid: string): Promise<ResultCode>

Deletes a profile. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
iccidstringYesProfile ID.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.deleteProfile(0, testId).then(() => {
    console.log(`deleteProfile invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`deleteProfile, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.switchToProfile18+

switchToProfile(slotId: number, portIndex: number, iccid: string, forceDisableProfile: boolean): Promise<ResultCode>

Switches to the specified profile. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
portIndexnumberYesPort index of the slot.
iccidstringYesProfile ID.
forceDisableProfilebooleanYesWhether to forcibly diable the active SIM. If the value is true, the operation can be performed only after the active SIM card is disabled. If the value is false, the system displays a message asking the user to agree to the operation.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.switchToProfile(0, 0, testId, true).then(() => {
    console.log(`switchToProfile invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`switchToProfile, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.setProfileNickname18+

setProfileNickname(slotId: number, iccid: string, nickname: string): Promise<ResultCode>

Sets a nickname for the specified profile. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
iccidstringYesProfile ID.
nicknamestringYesProfile nickname.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.setProfileNickname(0, testId, testName).then(() => {
    console.log(`setProfileNickname invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`setProfileNickname, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.resetMemory18+

resetMemory(slotId: number, options?: ResetOption): Promise<ResultCode>

Clears all specific profiles and resets the eUICC. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
optionsResetOptionNoReset options.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.resetMemory(0).then(() => {
    console.log(`resetMemory invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`resetMemory, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.reserveProfilesForFactoryRestore18+

reserveProfilesForFactoryRestore(slotId: number): Promise<ResultCode>

Restores factory settings and retains profiles. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.reserveProfilesForFactoryRestore(0).then(() => {
    console.log(`reserveProfilesForFactoryRestore invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`reserveProfilesForFactoryRestore, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.setDefaultSmdpAddress18+

setDefaultSmdpAddress(slotId: number, address: string): Promise<ResultCode>

Sets or updates the default SM-DP+ address stored in the eUICC. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
addressstringYesDefault SM-DP+ address.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.setDefaultSmdpAddress(0, testAddress).then(() => {
    console.log(`setDefaultSmdpAddress invoking succeeded.`);
}).catch((err: BusinessError) => {
    console.error(`setDefaultSmdpAddress, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.getDefaultSmdpAddress18+

getDefaultSmdpAddress(slotId: number): Promise<string>

Obtains the default SM-DP+ address stored in the eUICC. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.GET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2

Returns

TypeDescription
Promise<string>Promise used to return the SM-DP+ address.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.getDefaultSmdpAddress(0).then((data: string) => {
    console.log(`getDefaultSmdpAddress, result: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`getDefaultSmdpAddress, ErrorState: err->${JSON.stringify(err)}`);
});

eSIM.cancelSession18+

cancelSession(slotId: number, transactionId: string, cancelReason: CancelReason): Promise<ResultCode>

Cancels a session. This API uses a promise to return the result.

System API: This is a system API.

Required permission: ohos.permission.SET_TELEPHONY_ESIM_STATE

System capability: SystemCapability.Telephony.CoreService.Esim

Parameters

NameTypeMandatoryDescription
slotIdnumberYesCard slot ID.
- 0: card slot 1.
- 1: card slot 2
transactionIdstringYesService ID.
cancelReasonCancelReasonYesReason for canceling the session.

Returns

TypeDescription
Promise<ResultCode>Promise used to return the operation result.

Error codes

For details about the error codes, see Universal Error Codes.

IDError Message
201Permission denied.
202Non-system applications use system APIs.
401Parameter error. Possible causes:
1. Mandatory parameters are left unspecified.
2. Incorrect parameter types.
3. Invalid parameter value.
801Capability not supported.
3120001Service connection failed.
3120002System internal error.

Example

import { BusinessError } from '@kit.BasicServicesKit';
import { eSIM } from '@kit.TelephonyKit';

eSIM.cancelSession(0, testId, CancelReason::CANCEL_REASON_END_USER_REJECTION).then((data: string) => {
    console.log(`cancelSession, result: data->${JSON.stringify(data)}`);
}).catch((err: BusinessError) => {
    console.error(`cancelSession execution failed: err->${JSON.stringify(err)}`);
});

AccessRule18+

Defines access rules.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
certificateHashHexStrstringYesHex string of the certificate hash.
packageNamestringYesPackage name.
accessTypenumberYesRule type.

DownloadableProfile18+

Defines a downloadable profile.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
activationCodestringYesActivation code. For a profile that does not require an activation code, the value may be left empty.
confirmationCodestringNoConfirmation code.
carrierNamestringNoCarrier name.
accessRulesArray<AccessRule>NoAccess rule array.

GetDownloadableProfileMetadataResult18+

Obtains the metadata of the downloadable profile.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
downloadableProfileDownloadableProfileYesDownloadable profile.
pprTypenumberYesProfile policy rule type.
pprFlagbooleanYesProfile policy rule flag.
iccidstringYesProfile ICCID.
serviceProviderNamestringYesService provider name.
profileNamestringYesProfile name.
profileClassProfileClassYesProfile class.
solvableErrorsSolvableErrorsYesSolvable errors.
responseResultResultCodeYesOperation result code.

GetDownloadableProfilesResult18+

Obtains the list of default downloadable profiles.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
responseResultResultCodeYesPromise used to return the operation result.
downloadableProfilesArray<DownloadableProfile>YesDownloadable file array.

DownloadProfileResult18+

Defines the profile download result.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
responseResultResultCodeYesOperation result code.
solvableErrorsSolvableErrorsYesSolvable errors.
cardIdnumberYesCard ID.

GetEuiccProfileInfoListResult18+

Obtains the profile information list.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
responseResultResultCodeYesPromise used to return the operation result.
profilesArray<EuiccProfile>YesProfile array.
isRemovablebooleanYesChecks whether the eUICC is removable.

OperatorId18+

Obtains information about the eUICC chip or device.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
mccstringYesMobile country code (MCC).
mncstringYesNetwork code.
gid1stringYesGroup ID level 1.
gid2stringYesGroup ID level 2.

EuiccProfile18+

Profile information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
iccidstringYesProfile ICCID.
nickNamestringYesProfile nickname.
serviceProviderNamestringYesService provider name.
profileNamestringYesProfile name.
stateProfileStateYesProfile status.
profileClassProfileClassYesProfile class.
operatorIdOperatorIdYesOperation ID of the profile.
policyRulesPolicyRulesYesProfile policy rules.
accessRulesArray<AccessRule>YesProfile access rules.

EuiccInfo18+

Defines the eUICC information.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
osVersionstringYesOS version.

ResetOption18+

Defines the reset options.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
DELETE_OPERATIONAL_PROFILES1Deletion of all operational profiles.
DELETE_FIELD_LOADED_TEST_PROFILES1 << 1Deletion of the downloaded test profiles.
RESET_DEFAULT_SMDP_ADDRESS1 << 2Resetting of the default SM-DP+ address.

OsuStatus18+

Defines the OS upgrade status.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
EUICC_UPGRADE_IN_PROGRESS1Upgrading.
EUICC_UPGRADE_FAILED2Upgrade failed.
EUICC_UPGRADE_SUCCESSFUL3Update succeeded.
EUICC_UPGRADE_ALREADY_LATEST4Already the latest version.
EUICC_UPGRADE_SERVICE_UNAVAILABLE5Update service unavailable.

ResultCode18+

Enumerates the result codes.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
RESULT_SOLVABLE_ERRORS-2Solving of the solvable errors required.
RESULT_MUST_DISABLE_PROFILE-1Disabling of the active profile required.
RESULT_OK0Operation success.
RESULT_GET_EID_FAILED201Failed to obtain the EID.
RESULT_ACTIVATION_CODE_CHANGED203Activation code changed upon user confirmation.
RESULT_ACTIVATION_CODE_INVALID204Invalid activation code.
RESULT_SMDP_ADDRESS_INVALID205Invalid SM-DP+ server address.
RESULT_EUICC_INFO_INVALID206Invalid eUICC information.
RESULT_TLS_HANDSHAKE_FAILED207TLS handshake failed.
RESULT_CERTIFICATE_IO_ERROR208Certificate network connection error.
RESULT_CERTIFICATE_RESPONSE_TIMEOUT209Invalid certificate address or response timeout.
RESULT_AUTHENTICATION_FAILED210Authentication failed.
RESULT_RESPONSE_HTTP_FAILED211HTTP response failed.
RESULT_CONFIRMATION_CODE_INCORRECT212Incorrect confirmation code.
RESULT_EXCEEDED_CONFIRMATION_CODE_TRY_LIMIT213Maximum confirmation code retries reached.
RESULT_NO_PROFILE_ON_SERVER214No downloadable profile available on the server.
RESULT_TRANSACTION_ID_INVALID215Invalid transaction ID.
RESULT_SERVER_ADDRESS_INVALID216Invalid server address.
RESULT_GET_BOUND_PROFILE_PACKAGE_FAILED217Failed to obtain the BPP.
RESULT_USER_CANCEL_DOWNLOAD218Download cancelled by the user.
RESULT_SERVER_UNAVAILABLE220Carrier server unavailable.
RESULT_PROFILE_NON_DELETE223File deletion not allowed by the PPR rule.
RESULT_SMDP_ADDRESS_INCORRECT226Incorrect SMDP server address.
RESULT_ANALYZE_AUTHENTICATION_SERVER_RESPONSE_FAILED228Failed to parse the server authentication response.
RESULT_ANALYZE_AUTHENTICATION_CLIENT_RESPONSE_FAILED229Failed to parse the client authentication response.
RESULT_ANALYZE_AUTHENTICATION_CLIENT_MATCHING_ID_REFUSED231Failed to parse the client authentication response because the matching ID was rejected.
RESULT_PROFILE_TYPE_ERROR_AUTHENTICATION_STOPPED233Authentication stopped due to incorrect profile type.
RESULT_CARRIER_SERVER_REFUSED_ERRORS249Rejection cause code of the carrier server, which is 3.8.
RESULT_CERTIFICATE_INVALID251Invalid certificate.
RESULT_OUT_OF_MEMORY263Failed to install the profile due to insufficient memory.
RESULT_PPR_FORBIDDEN268Operation not allowed by the PPR rule.
RESULT_NOTHING_TO_DELETE270No configuration file for deletion.
RESULT_PPR_NOT_MATCH276PPR rule mismatch.
RESULT_CAT_BUSY283Session in progress.
RESULT_PROFILE_EID_INVALID284eSIM profile in use or invalid.
RESULT_DOWNLOAD_TIMEOUT287Download timeout.
RESULT_SGP_22_OTHER400Other errors defined in SGP.22.

CancelReason18+

Reason for canceling the session.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
CANCEL_REASON_END_USER_REJECTION0The user has rejected the download.
CANCEL_REASON_POSTPONED1The download has been delayed. You can restart it later.
CANCEL_REASON_TIMEOUT2The download has timed out. You can restart it later.
CANCEL_REASON_PPR_NOT_ALLOWED3The installation cannot be performed because the authorization table or other installed profile on the eUICC does not allow its policy rules.

ProfileState18+

Enumerates the profile states.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
PROFILE_STATE_UNSPECIFIED-1Profile status unspecified.
PROFILE_STATE_DISABLED0Profile disabled.
PROFILE_STATE_ENABLED1Profile enabled.

ProfileClass18+

Enumerates the profile classes.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
PROFILE_CLASS_UNSPECIFIED-1Profile class unspecified.
PROFILE_CLASS_TEST0Test profile.
PROFILE_CLASS_PROVISIONING1Profile preloaded to the eUICC.
PROFILE_CLASS_OPERATIONAL2Profile that can be preloaded or downloaded.

PolicyRules18+

Enumerates the profile policy rules.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
POLICY_RULE_DISABLE_NOT_ALLOWED1A profile cannot be disabled after being enabled.
POLICY_RULE_DELETE_NOT_ALLOWED1 << 1The profile cannot be deleted.
POLICY_RULE_DISABLE_AND_DELETE1 << 2A profile must be deleted immediately after being enabled.

SolvableErrors18+

Enumerates the solvable errors.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameValueDescription
SOLVABLE_ERROR_NEED_CONFIRMATION_CODE1 << 0The user needs to enter the confirmation code during the download.
SOLVABLE_ERROR_NEED_POLICY_RULE1 << 1The download process requires user consent to allow the profile policy rules.

DownloadConfiguration18+

Defines the download configuration.

System API: This is a system API.

System capability: SystemCapability.Telephony.CoreService.Esim

NameTypeMandatoryDescription
switchAfterDownloadbooleanYesWhether to enable the profile after being downloaded.
forceDisableProfilebooleanYesWhether to forcibly disable a profile.
isPprAllowedbooleanYesWhether to allow the service provider to enforce the profile policy rule after the user is informed of its restrictions.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Telephony Kit

harmony 鸿蒙Telephony_NetworkState

harmony 鸿蒙Telephony Error Codes

harmony 鸿蒙js-apis-call-sys

harmony 鸿蒙@ohos.telephony.call (Call)

harmony 鸿蒙@ohos.telephony.esim (eSIM Management)

harmony 鸿蒙@ohos.telephony.observer (Observer) (System API)

harmony 鸿蒙@ohos.telephony.observer (Observer)

harmony 鸿蒙@ohos.telephony.radio (Radio) (System API)

harmony 鸿蒙@ohos.telephony.radio (Network Search)

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/cHk3nM