1e41f4b71Sopenharmony_ci# @ohos.telephony.sim (SIM Management) (System API) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **sim** module provides basic SIM card management functions. You can obtain the name, number, ISO country code, home PLMN ID, service provider name, SIM card status, type, installation status, activation status, and lock status of the SIM card in the specified slot. Besides, you can set the name, number, and lock status of the SIM card, activate or deactivate the SIM card, and change the PIN or unlock the PIN or PUK of the SIM card. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci>**NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci> This topic describes only system APIs provided by the module. For details about its public APIs, see [@ohos.telephony.sim (SIM Management)](js-apis-sim.md). 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci## Modules to Import 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci```ts 13e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 14e41f4b71Sopenharmony_ci``` 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci## sim.isOperatorSimCard<sup>11+</sup> 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ciisOperatorSimCard\(slotId: number, operator: OperatorSimCard\): boolean 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ciChecks whether the SIM card in the specified slot is provided by a specified carrier. 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci**System API**: This is a system API. 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci**Parameters** 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 29e41f4b71Sopenharmony_ci| ------ | --------------------------------------- | ---- | --------------------------------- | 30e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 31e41f4b71Sopenharmony_ci| operator | [OperatorSimCard](#operatorsimcard11) | Yes | Carrier name. (Currently, only SIM cards of China Telecom are supported.)| 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci**Return value** 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci| Type | Description | 36e41f4b71Sopenharmony_ci| --------------------- | ---------------------------------- | 37e41f4b71Sopenharmony_ci| boolean | Boolean value indicating whether the SIM card in the specified slot is provided by a specified carrier. The value **true** means yes and the value **false** means no.| 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ci**Error codes** 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci| ID| Error Message | 44e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 45e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 46e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 47e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 48e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 49e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 50e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 51e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci**Example** 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci```ts 56e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 57e41f4b71Sopenharmony_ci 58e41f4b71Sopenharmony_cilet slotId : number = 0; 59e41f4b71Sopenharmony_cilet operator : sim.OperatorSimCard = sim.OperatorSimCard.CHINA_TELECOM_CARD; 60e41f4b71Sopenharmony_citry { 61e41f4b71Sopenharmony_ci let isOperatorSimCard: boolean = sim.isOperatorSimCard(slotId, operator); 62e41f4b71Sopenharmony_ci console.log(`is operator sim card: ` + isOperatorSimCard); 63e41f4b71Sopenharmony_ci} catch (err) { 64e41f4b71Sopenharmony_ci console.error("isOperatorSimCard err: " + JSON.stringify(err)); 65e41f4b71Sopenharmony_ci} 66e41f4b71Sopenharmony_ci``` 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci## sim.setDefaultVoiceSlotId<sup>7+</sup> 69e41f4b71Sopenharmony_ci 70e41f4b71Sopenharmony_cisetDefaultVoiceSlotId\(slotId: number, callback: AsyncCallback\<void\>\): void 71e41f4b71Sopenharmony_ci 72e41f4b71Sopenharmony_ciSets the default slot ID of the SIM card that provides voice services. This API uses an asynchronous callback to return the result. 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci**System API**: This is a system API. 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci**Parameters** 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 83e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | ------------------------------------------------------------ | 84e41f4b71Sopenharmony_ci| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.| 85e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci**Error codes** 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci| ID| Error Message | 92e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 93e41f4b71Sopenharmony_ci| 201 | Permission denied. | 94e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 95e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 96e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 97e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 98e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 99e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 100e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 101e41f4b71Sopenharmony_ci| 8301001 | SIM card is not activated. | 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci**Example** 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci```ts 106e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 107e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 108e41f4b71Sopenharmony_ci 109e41f4b71Sopenharmony_cisim.setDefaultVoiceSlotId(0, (err: BusinessError) => { 110e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 111e41f4b71Sopenharmony_ci}); 112e41f4b71Sopenharmony_ci``` 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ci 115e41f4b71Sopenharmony_ci## sim.setDefaultVoiceSlotId<sup>7+</sup> 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_cisetDefaultVoiceSlotId\(slotId: number\): Promise\<void\> 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ciSets the default slot ID of the SIM card that provides voice services. This API uses a promise to return the result. 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci**System API**: This is a system API. 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**Parameters** 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 130e41f4b71Sopenharmony_ci| ------ | ------ | ---- | ------------------------------------------------------------ | 131e41f4b71Sopenharmony_ci| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2<br>- **-1**: Clears the default configuration.| 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci**Return value** 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci| Type | Description | 136e41f4b71Sopenharmony_ci| --------------- | ------------------------------- | 137e41f4b71Sopenharmony_ci| Promise\<void\> | Promise used to return the result.| 138e41f4b71Sopenharmony_ci 139e41f4b71Sopenharmony_ci**Error codes** 140e41f4b71Sopenharmony_ci 141e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 142e41f4b71Sopenharmony_ci 143e41f4b71Sopenharmony_ci| ID| Error Message | 144e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 145e41f4b71Sopenharmony_ci| 201 | Permission denied. | 146e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 147e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 148e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 149e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 150e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 151e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 152e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 153e41f4b71Sopenharmony_ci| 8301001 | SIM card is not activated. | 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci**Example** 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci```ts 158e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 159e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_cisim.setDefaultVoiceSlotId(0).then(() => { 162e41f4b71Sopenharmony_ci console.log(`setDefaultVoiceSlotId success.`); 163e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 164e41f4b71Sopenharmony_ci console.error(`setDefaultVoiceSlotId failed, promise: err->${JSON.stringify(err)}`); 165e41f4b71Sopenharmony_ci}); 166e41f4b71Sopenharmony_ci``` 167e41f4b71Sopenharmony_ci 168e41f4b71Sopenharmony_ci## sim.setShowName<sup>8+</sup> 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_cisetShowName\(slotId: number, name: string, callback: AsyncCallback\<void\>\): void 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ciSets a display name for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ci**System API**: This is a system API. 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 177e41f4b71Sopenharmony_ci 178e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci**Parameters** 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 183e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | -------------------------------------- | 184e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 185e41f4b71Sopenharmony_ci| name | string | Yes | SIM card name. | 186e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci**Error codes** 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ci| ID| Error Message | 193e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 194e41f4b71Sopenharmony_ci| 201 | Permission denied. | 195e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 196e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 197e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 198e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 199e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 200e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 201e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ci**Example** 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ci```ts 206e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 207e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 208e41f4b71Sopenharmony_ci 209e41f4b71Sopenharmony_cilet name: string = "ShowName"; 210e41f4b71Sopenharmony_cisim.setShowName(0, name, (err: BusinessError) => { 211e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 212e41f4b71Sopenharmony_ci}); 213e41f4b71Sopenharmony_ci``` 214e41f4b71Sopenharmony_ci 215e41f4b71Sopenharmony_ci## sim.setShowName<sup>8+</sup> 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_cisetShowName\(slotId: number, name: string\): Promise\<void\> 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ciSets a display name for the SIM card in the specified slot. This API uses a promise to return the result. 220e41f4b71Sopenharmony_ci 221e41f4b71Sopenharmony_ci**System API**: This is a system API. 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 224e41f4b71Sopenharmony_ci 225e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 226e41f4b71Sopenharmony_ci 227e41f4b71Sopenharmony_ci**Parameters** 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 230e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 231e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 232e41f4b71Sopenharmony_ci| name | string | Yes | SIM card name. | 233e41f4b71Sopenharmony_ci 234e41f4b71Sopenharmony_ci**Return value** 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci| Type | Description | 237e41f4b71Sopenharmony_ci| --------------- | ------------------------------- | 238e41f4b71Sopenharmony_ci| Promise\<void\> | Promise used to return the result.| 239e41f4b71Sopenharmony_ci 240e41f4b71Sopenharmony_ci**Error codes** 241e41f4b71Sopenharmony_ci 242e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 243e41f4b71Sopenharmony_ci 244e41f4b71Sopenharmony_ci| ID| Error Message | 245e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 246e41f4b71Sopenharmony_ci| 201 | Permission denied. | 247e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 248e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 249e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 250e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 251e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 252e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 253e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ci**Example** 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci```ts 258e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 259e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_cilet name: string = "ShowName"; 262e41f4b71Sopenharmony_cisim.setShowName(0, name).then(() => { 263e41f4b71Sopenharmony_ci console.log(`setShowName success.`); 264e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 265e41f4b71Sopenharmony_ci console.error(`setShowName failed, promise: err->${JSON.stringify(err)}`); 266e41f4b71Sopenharmony_ci}); 267e41f4b71Sopenharmony_ci``` 268e41f4b71Sopenharmony_ci 269e41f4b71Sopenharmony_ci## sim.getShowName<sup>8+</sup> 270e41f4b71Sopenharmony_ci 271e41f4b71Sopenharmony_cigetShowName\(slotId: number, callback: AsyncCallback\<string\>\): void 272e41f4b71Sopenharmony_ci 273e41f4b71Sopenharmony_ciObtains the name of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 274e41f4b71Sopenharmony_ci 275e41f4b71Sopenharmony_ci**System API**: This is a system API. 276e41f4b71Sopenharmony_ci 277e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 278e41f4b71Sopenharmony_ci 279e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 280e41f4b71Sopenharmony_ci 281e41f4b71Sopenharmony_ci**Parameters** 282e41f4b71Sopenharmony_ci 283e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 284e41f4b71Sopenharmony_ci| -------- | --------------------------- | ---- | -------------------------------------- | 285e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 286e41f4b71Sopenharmony_ci| callback | AsyncCallback<string> | Yes | Callback used to return the result. | 287e41f4b71Sopenharmony_ci 288e41f4b71Sopenharmony_ci**Error codes** 289e41f4b71Sopenharmony_ci 290e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 291e41f4b71Sopenharmony_ci 292e41f4b71Sopenharmony_ci| ID| Error Message | 293e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 294e41f4b71Sopenharmony_ci| 201 | Permission denied. | 295e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 296e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 297e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 298e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 299e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 300e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 301e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 302e41f4b71Sopenharmony_ci 303e41f4b71Sopenharmony_ci**Example** 304e41f4b71Sopenharmony_ci 305e41f4b71Sopenharmony_ci```ts 306e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 307e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 308e41f4b71Sopenharmony_ci 309e41f4b71Sopenharmony_cisim.getShowName(0, (err: BusinessError, data: string) => { 310e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 311e41f4b71Sopenharmony_ci}); 312e41f4b71Sopenharmony_ci``` 313e41f4b71Sopenharmony_ci 314e41f4b71Sopenharmony_ci 315e41f4b71Sopenharmony_ci## sim.getShowName<sup>8+</sup> 316e41f4b71Sopenharmony_ci 317e41f4b71Sopenharmony_cigetShowName\(slotId: number\): Promise\<string\> 318e41f4b71Sopenharmony_ci 319e41f4b71Sopenharmony_ciObtains the name of the SIM card in the specified slot. This API uses a promise to return the result. 320e41f4b71Sopenharmony_ci 321e41f4b71Sopenharmony_ci**System API**: This is a system API. 322e41f4b71Sopenharmony_ci 323e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 324e41f4b71Sopenharmony_ci 325e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 326e41f4b71Sopenharmony_ci 327e41f4b71Sopenharmony_ci**Parameters** 328e41f4b71Sopenharmony_ci 329e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 330e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 331e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 332e41f4b71Sopenharmony_ci 333e41f4b71Sopenharmony_ci**Return value** 334e41f4b71Sopenharmony_ci 335e41f4b71Sopenharmony_ci| Type | Description | 336e41f4b71Sopenharmony_ci| --------------------- | -------------------------------------- | 337e41f4b71Sopenharmony_ci| Promise<string> | Promise used to return the result.| 338e41f4b71Sopenharmony_ci 339e41f4b71Sopenharmony_ci**Error codes** 340e41f4b71Sopenharmony_ci 341e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 342e41f4b71Sopenharmony_ci 343e41f4b71Sopenharmony_ci| ID| Error Message | 344e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 345e41f4b71Sopenharmony_ci| 201 | Permission denied. | 346e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 347e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 348e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 349e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 350e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 351e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 352e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 353e41f4b71Sopenharmony_ci 354e41f4b71Sopenharmony_ci**Example** 355e41f4b71Sopenharmony_ci 356e41f4b71Sopenharmony_ci```ts 357e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 358e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 359e41f4b71Sopenharmony_ci 360e41f4b71Sopenharmony_cisim.getShowName(0).then((data: string) => { 361e41f4b71Sopenharmony_ci console.log(`getShowName success, promise: data->${JSON.stringify(data)}`); 362e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 363e41f4b71Sopenharmony_ci console.error(`getShowName failed, promise: err->${JSON.stringify(err)}`); 364e41f4b71Sopenharmony_ci}); 365e41f4b71Sopenharmony_ci``` 366e41f4b71Sopenharmony_ci 367e41f4b71Sopenharmony_ci## sim.setShowNumber<sup>8+</sup> 368e41f4b71Sopenharmony_ci 369e41f4b71Sopenharmony_cisetShowNumber\(slotId: number, number: string, callback: AsyncCallback\<void\>\): void 370e41f4b71Sopenharmony_ci 371e41f4b71Sopenharmony_ciSets a display number for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 372e41f4b71Sopenharmony_ci 373e41f4b71Sopenharmony_ci**System API**: This is a system API. 374e41f4b71Sopenharmony_ci 375e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 376e41f4b71Sopenharmony_ci 377e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 378e41f4b71Sopenharmony_ci 379e41f4b71Sopenharmony_ci**Parameters** 380e41f4b71Sopenharmony_ci 381e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 382e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | -------------------------------------- | 383e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 384e41f4b71Sopenharmony_ci| number | string | Yes | SIM card number. | 385e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 386e41f4b71Sopenharmony_ci 387e41f4b71Sopenharmony_ci**Error codes** 388e41f4b71Sopenharmony_ci 389e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 390e41f4b71Sopenharmony_ci 391e41f4b71Sopenharmony_ci| ID| Error Message | 392e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 393e41f4b71Sopenharmony_ci| 201 | Permission denied. | 394e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 395e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 396e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 397e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 398e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 399e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 400e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 401e41f4b71Sopenharmony_ci 402e41f4b71Sopenharmony_ci**Example** 403e41f4b71Sopenharmony_ci 404e41f4b71Sopenharmony_ci```ts 405e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 406e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 407e41f4b71Sopenharmony_ci 408e41f4b71Sopenharmony_cilet number: string = '+861xxxxxxxxxx'; 409e41f4b71Sopenharmony_cisim.setShowNumber(0, number, (err: BusinessError) => { 410e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 411e41f4b71Sopenharmony_ci}); 412e41f4b71Sopenharmony_ci``` 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci 415e41f4b71Sopenharmony_ci## sim.setShowNumber<sup>8+</sup> 416e41f4b71Sopenharmony_ci 417e41f4b71Sopenharmony_cisetShowNumber\(slotId: number, number: string\): Promise\<void\> 418e41f4b71Sopenharmony_ci 419e41f4b71Sopenharmony_ciSets a display number for the SIM card in the specified slot. This API uses a promise to return the result. 420e41f4b71Sopenharmony_ci 421e41f4b71Sopenharmony_ci**System API**: This is a system API. 422e41f4b71Sopenharmony_ci 423e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 424e41f4b71Sopenharmony_ci 425e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 426e41f4b71Sopenharmony_ci 427e41f4b71Sopenharmony_ci**Parameters** 428e41f4b71Sopenharmony_ci 429e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 430e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 431e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 432e41f4b71Sopenharmony_ci| number | string | Yes | SIM card number. | 433e41f4b71Sopenharmony_ci 434e41f4b71Sopenharmony_ci**Return value** 435e41f4b71Sopenharmony_ci 436e41f4b71Sopenharmony_ci| Type | Description | 437e41f4b71Sopenharmony_ci| -------------- | ------------------------------- | 438e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 439e41f4b71Sopenharmony_ci 440e41f4b71Sopenharmony_ci**Error codes** 441e41f4b71Sopenharmony_ci 442e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 443e41f4b71Sopenharmony_ci 444e41f4b71Sopenharmony_ci| ID| Error Message | 445e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 446e41f4b71Sopenharmony_ci| 201 | Permission denied. | 447e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 448e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 449e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 450e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 451e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 452e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 453e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 454e41f4b71Sopenharmony_ci 455e41f4b71Sopenharmony_ci**Example** 456e41f4b71Sopenharmony_ci 457e41f4b71Sopenharmony_ci```ts 458e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 459e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 460e41f4b71Sopenharmony_ci 461e41f4b71Sopenharmony_cilet number: string = '+861xxxxxxxxxx'; 462e41f4b71Sopenharmony_cisim.setShowNumber(0, number).then(() => { 463e41f4b71Sopenharmony_ci console.log(`setShowNumber success.`); 464e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 465e41f4b71Sopenharmony_ci console.error(`setShowNumber failed, promise: err->${JSON.stringify(err)}`); 466e41f4b71Sopenharmony_ci}); 467e41f4b71Sopenharmony_ci``` 468e41f4b71Sopenharmony_ci 469e41f4b71Sopenharmony_ci## sim.getShowNumber<sup>8+</sup> 470e41f4b71Sopenharmony_ci 471e41f4b71Sopenharmony_cigetShowNumber\(slotId: number, callback: AsyncCallback\<string\>): void 472e41f4b71Sopenharmony_ci 473e41f4b71Sopenharmony_ciObtains the display number of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 474e41f4b71Sopenharmony_ci 475e41f4b71Sopenharmony_ci**System API**: This is a system API. 476e41f4b71Sopenharmony_ci 477e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 478e41f4b71Sopenharmony_ci 479e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 480e41f4b71Sopenharmony_ci 481e41f4b71Sopenharmony_ci**Parameters** 482e41f4b71Sopenharmony_ci 483e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 484e41f4b71Sopenharmony_ci| -------- | --------------------------- | ---- | -------------------------------------- | 485e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 486e41f4b71Sopenharmony_ci| callback | AsyncCallback<string> | Yes | Callback used to return the result. | 487e41f4b71Sopenharmony_ci 488e41f4b71Sopenharmony_ci**Error codes** 489e41f4b71Sopenharmony_ci 490e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 491e41f4b71Sopenharmony_ci 492e41f4b71Sopenharmony_ci| ID| Error Message | 493e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 494e41f4b71Sopenharmony_ci| 201 | Permission denied. | 495e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 496e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 497e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 498e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 499e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 500e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 501e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 502e41f4b71Sopenharmony_ci 503e41f4b71Sopenharmony_ci**Example** 504e41f4b71Sopenharmony_ci 505e41f4b71Sopenharmony_ci```ts 506e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 507e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 508e41f4b71Sopenharmony_ci 509e41f4b71Sopenharmony_cisim.getShowNumber(0, (err: BusinessError, data: string) => { 510e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 511e41f4b71Sopenharmony_ci}); 512e41f4b71Sopenharmony_ci``` 513e41f4b71Sopenharmony_ci 514e41f4b71Sopenharmony_ci 515e41f4b71Sopenharmony_ci## sim.getShowNumber<sup>8+</sup> 516e41f4b71Sopenharmony_ci 517e41f4b71Sopenharmony_cigetShowNumber\(slotId: number\): Promise\<string\> 518e41f4b71Sopenharmony_ci 519e41f4b71Sopenharmony_ciObtains the display number of the SIM card in the specified slot. This API uses a promise to return the result. 520e41f4b71Sopenharmony_ci 521e41f4b71Sopenharmony_ci**System API**: This is a system API. 522e41f4b71Sopenharmony_ci 523e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 524e41f4b71Sopenharmony_ci 525e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 526e41f4b71Sopenharmony_ci 527e41f4b71Sopenharmony_ci**Parameters** 528e41f4b71Sopenharmony_ci 529e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 530e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 531e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 532e41f4b71Sopenharmony_ci 533e41f4b71Sopenharmony_ci**Return value** 534e41f4b71Sopenharmony_ci 535e41f4b71Sopenharmony_ci| Type | Description | 536e41f4b71Sopenharmony_ci| --------------------- | --------------------------------- | 537e41f4b71Sopenharmony_ci| Promise<string> | Promise used to return the result.| 538e41f4b71Sopenharmony_ci 539e41f4b71Sopenharmony_ci**Error codes** 540e41f4b71Sopenharmony_ci 541e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 542e41f4b71Sopenharmony_ci 543e41f4b71Sopenharmony_ci| ID| Error Message | 544e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 545e41f4b71Sopenharmony_ci| 201 | Permission denied. | 546e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 547e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 548e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 549e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 550e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 551e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 552e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 553e41f4b71Sopenharmony_ci 554e41f4b71Sopenharmony_ci**Example** 555e41f4b71Sopenharmony_ci 556e41f4b71Sopenharmony_ci```ts 557e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 558e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 559e41f4b71Sopenharmony_ci 560e41f4b71Sopenharmony_cisim.getShowNumber(0).then((data: string) => { 561e41f4b71Sopenharmony_ci console.log(`getShowNumber success, promise: data->${JSON.stringify(data)}`); 562e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 563e41f4b71Sopenharmony_ci console.error(`getShowNumber failed, promise: err->${JSON.stringify(err)}`); 564e41f4b71Sopenharmony_ci}); 565e41f4b71Sopenharmony_ci``` 566e41f4b71Sopenharmony_ci 567e41f4b71Sopenharmony_ci## sim.activateSim<sup>8+</sup> 568e41f4b71Sopenharmony_ci 569e41f4b71Sopenharmony_ciactivateSim\(slotId: number, callback: AsyncCallback\<void\>\): void 570e41f4b71Sopenharmony_ci 571e41f4b71Sopenharmony_ciActivates the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 572e41f4b71Sopenharmony_ci 573e41f4b71Sopenharmony_ci**System API**: This is a system API. 574e41f4b71Sopenharmony_ci 575e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 576e41f4b71Sopenharmony_ci 577e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 578e41f4b71Sopenharmony_ci 579e41f4b71Sopenharmony_ci**Parameters** 580e41f4b71Sopenharmony_ci 581e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 582e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | -------------------------------------- | 583e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 584e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 585e41f4b71Sopenharmony_ci 586e41f4b71Sopenharmony_ci**Error codes** 587e41f4b71Sopenharmony_ci 588e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 589e41f4b71Sopenharmony_ci 590e41f4b71Sopenharmony_ci| ID| Error Message | 591e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 592e41f4b71Sopenharmony_ci| 201 | Permission denied. | 593e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 594e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 595e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 596e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 597e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 598e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 599e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 600e41f4b71Sopenharmony_ci 601e41f4b71Sopenharmony_ci**Example** 602e41f4b71Sopenharmony_ci 603e41f4b71Sopenharmony_ci```ts 604e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 605e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 606e41f4b71Sopenharmony_ci 607e41f4b71Sopenharmony_cisim.activateSim(0, (err: BusinessError) => { 608e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 609e41f4b71Sopenharmony_ci}); 610e41f4b71Sopenharmony_ci``` 611e41f4b71Sopenharmony_ci 612e41f4b71Sopenharmony_ci 613e41f4b71Sopenharmony_ci## sim.activateSim<sup>8+</sup> 614e41f4b71Sopenharmony_ci 615e41f4b71Sopenharmony_ciactivateSim\(slotId: number\): Promise\<void\> 616e41f4b71Sopenharmony_ci 617e41f4b71Sopenharmony_ciActivates the SIM card in the specified slot. This API uses a promise to return the result. 618e41f4b71Sopenharmony_ci 619e41f4b71Sopenharmony_ci**System API**: This is a system API. 620e41f4b71Sopenharmony_ci 621e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 622e41f4b71Sopenharmony_ci 623e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 624e41f4b71Sopenharmony_ci 625e41f4b71Sopenharmony_ci**Parameters** 626e41f4b71Sopenharmony_ci 627e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 628e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 629e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 630e41f4b71Sopenharmony_ci 631e41f4b71Sopenharmony_ci**Return value** 632e41f4b71Sopenharmony_ci 633e41f4b71Sopenharmony_ci| Type | Description | 634e41f4b71Sopenharmony_ci| --------------- | ------------------------------- | 635e41f4b71Sopenharmony_ci| Promise\<void\> | Promise used to return the result.| 636e41f4b71Sopenharmony_ci 637e41f4b71Sopenharmony_ci**Error codes** 638e41f4b71Sopenharmony_ci 639e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 640e41f4b71Sopenharmony_ci 641e41f4b71Sopenharmony_ci| ID| Error Message | 642e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 643e41f4b71Sopenharmony_ci| 201 | Permission denied. | 644e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 645e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 646e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 647e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 648e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 649e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 650e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 651e41f4b71Sopenharmony_ci 652e41f4b71Sopenharmony_ci**Example** 653e41f4b71Sopenharmony_ci 654e41f4b71Sopenharmony_ci```ts 655e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 656e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 657e41f4b71Sopenharmony_ci 658e41f4b71Sopenharmony_cisim.activateSim(0).then(() => { 659e41f4b71Sopenharmony_ci console.log(`activateSim success.`); 660e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 661e41f4b71Sopenharmony_ci console.error(`activateSim failed, promise: err->${JSON.stringify(err)}`); 662e41f4b71Sopenharmony_ci}); 663e41f4b71Sopenharmony_ci``` 664e41f4b71Sopenharmony_ci 665e41f4b71Sopenharmony_ci## sim.deactivateSim<sup>8+</sup> 666e41f4b71Sopenharmony_ci 667e41f4b71Sopenharmony_cideactivateSim\(slotId: number, callback: AsyncCallback\<void\>\): void 668e41f4b71Sopenharmony_ci 669e41f4b71Sopenharmony_ciDisables the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 670e41f4b71Sopenharmony_ci 671e41f4b71Sopenharmony_ci**System API**: This is a system API. 672e41f4b71Sopenharmony_ci 673e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 674e41f4b71Sopenharmony_ci 675e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 676e41f4b71Sopenharmony_ci 677e41f4b71Sopenharmony_ci**Parameters** 678e41f4b71Sopenharmony_ci 679e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 680e41f4b71Sopenharmony_ci| -------- | ------------------------- | ---- | -------------------------------------- | 681e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 682e41f4b71Sopenharmony_ci| callback | AsyncCallback<void> | Yes | Callback used to return the result. | 683e41f4b71Sopenharmony_ci 684e41f4b71Sopenharmony_ci**Error codes** 685e41f4b71Sopenharmony_ci 686e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 687e41f4b71Sopenharmony_ci 688e41f4b71Sopenharmony_ci| ID| Error Message | 689e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 690e41f4b71Sopenharmony_ci| 201 | Permission denied. | 691e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 692e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 693e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 694e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 695e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 696e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 697e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 698e41f4b71Sopenharmony_ci 699e41f4b71Sopenharmony_ci**Example** 700e41f4b71Sopenharmony_ci 701e41f4b71Sopenharmony_ci```ts 702e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 703e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 704e41f4b71Sopenharmony_ci 705e41f4b71Sopenharmony_cisim.deactivateSim(0, (err: BusinessError) => { 706e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 707e41f4b71Sopenharmony_ci}); 708e41f4b71Sopenharmony_ci``` 709e41f4b71Sopenharmony_ci 710e41f4b71Sopenharmony_ci 711e41f4b71Sopenharmony_ci## sim.deactivateSim<sup>8+</sup> 712e41f4b71Sopenharmony_ci 713e41f4b71Sopenharmony_cideactivateSim\(slotId: number\): Promise\<void\> 714e41f4b71Sopenharmony_ci 715e41f4b71Sopenharmony_ciDisables the SIM card in the specified slot. This API uses a promise to return the result. 716e41f4b71Sopenharmony_ci 717e41f4b71Sopenharmony_ci**System API**: This is a system API. 718e41f4b71Sopenharmony_ci 719e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 720e41f4b71Sopenharmony_ci 721e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 722e41f4b71Sopenharmony_ci 723e41f4b71Sopenharmony_ci**Parameters** 724e41f4b71Sopenharmony_ci 725e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 726e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 727e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 728e41f4b71Sopenharmony_ci 729e41f4b71Sopenharmony_ci**Return value** 730e41f4b71Sopenharmony_ci 731e41f4b71Sopenharmony_ci| Type | Description | 732e41f4b71Sopenharmony_ci| --------------- | ------------------------------- | 733e41f4b71Sopenharmony_ci| Promise\<void\> | Promise used to return the result.| 734e41f4b71Sopenharmony_ci 735e41f4b71Sopenharmony_ci**Error codes** 736e41f4b71Sopenharmony_ci 737e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 738e41f4b71Sopenharmony_ci 739e41f4b71Sopenharmony_ci| ID| Error Message | 740e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 741e41f4b71Sopenharmony_ci| 201 | Permission denied. | 742e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 743e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 744e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 745e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 746e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 747e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 748e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 749e41f4b71Sopenharmony_ci 750e41f4b71Sopenharmony_ci**Example** 751e41f4b71Sopenharmony_ci 752e41f4b71Sopenharmony_ci```ts 753e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 754e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 755e41f4b71Sopenharmony_ci 756e41f4b71Sopenharmony_cisim.deactivateSim(0).then(() => { 757e41f4b71Sopenharmony_ci console.log(`deactivateSim success.`); 758e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 759e41f4b71Sopenharmony_ci console.error(`deactivateSim failed, promise: err->${JSON.stringify(err)}`); 760e41f4b71Sopenharmony_ci}); 761e41f4b71Sopenharmony_ci``` 762e41f4b71Sopenharmony_ci 763e41f4b71Sopenharmony_ci## sim.setLockState<sup>7+</sup> 764e41f4b71Sopenharmony_ci 765e41f4b71Sopenharmony_cisetLockState\(slotId: number, options: LockInfo, callback: AsyncCallback\<LockStatusResponse\>\): void 766e41f4b71Sopenharmony_ci 767e41f4b71Sopenharmony_ciSets the lock status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 768e41f4b71Sopenharmony_ci 769e41f4b71Sopenharmony_ci**System API**: This is a system API. 770e41f4b71Sopenharmony_ci 771e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 772e41f4b71Sopenharmony_ci 773e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 774e41f4b71Sopenharmony_ci 775e41f4b71Sopenharmony_ci**Parameters** 776e41f4b71Sopenharmony_ci 777e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 778e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ | 779e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 780e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | 781e41f4b71Sopenharmony_ci| options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- lockType: [LockType](#locktype8)<br>- password: string<br>- state: [LockState](#lockstate8) | 782e41f4b71Sopenharmony_ci 783e41f4b71Sopenharmony_ci**Error codes** 784e41f4b71Sopenharmony_ci 785e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 786e41f4b71Sopenharmony_ci 787e41f4b71Sopenharmony_ci| ID| Error Message | 788e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 789e41f4b71Sopenharmony_ci| 201 | Permission denied. | 790e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 791e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 792e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 793e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 794e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 795e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 796e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 797e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 798e41f4b71Sopenharmony_ci 799e41f4b71Sopenharmony_ci**Example** 800e41f4b71Sopenharmony_ci 801e41f4b71Sopenharmony_ci```ts 802e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 803e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 804e41f4b71Sopenharmony_ci 805e41f4b71Sopenharmony_cilet lockInfo: sim.LockInfo = { 806e41f4b71Sopenharmony_ci lockType: sim.LockType.PIN_LOCK, 807e41f4b71Sopenharmony_ci password: "1234", 808e41f4b71Sopenharmony_ci state: sim.LockState.LOCK_OFF 809e41f4b71Sopenharmony_ci}; 810e41f4b71Sopenharmony_cisim.setLockState(0, lockInfo, (err: BusinessError, data: sim.LockStatusResponse) => { 811e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 812e41f4b71Sopenharmony_ci}); 813e41f4b71Sopenharmony_ci``` 814e41f4b71Sopenharmony_ci 815e41f4b71Sopenharmony_ci 816e41f4b71Sopenharmony_ci## sim.setLockState<sup>7+</sup> 817e41f4b71Sopenharmony_ci 818e41f4b71Sopenharmony_cisetLockState\(slotId: number, options: LockInfo\): Promise\<LockStatusResponse\> 819e41f4b71Sopenharmony_ci 820e41f4b71Sopenharmony_ciSets the lock status of the SIM card in the specified slot. This API uses a promise to return the result. 821e41f4b71Sopenharmony_ci 822e41f4b71Sopenharmony_ci**System API**: This is a system API. 823e41f4b71Sopenharmony_ci 824e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 825e41f4b71Sopenharmony_ci 826e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 827e41f4b71Sopenharmony_ci 828e41f4b71Sopenharmony_ci**Parameters** 829e41f4b71Sopenharmony_ci 830e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 831e41f4b71Sopenharmony_ci| ------- | ---------------------- | ---- | ------------------------------------------------------------ | 832e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 833e41f4b71Sopenharmony_ci| options | [LockInfo](#lockinfo8) | Yes | Lock information.<br>- lockType: [LockType](#locktype8)<br>- password: string<br>- state: [LockState](#lockstate8) | 834e41f4b71Sopenharmony_ci 835e41f4b71Sopenharmony_ci**Return value** 836e41f4b71Sopenharmony_ci 837e41f4b71Sopenharmony_ci| Type | Description | 838e41f4b71Sopenharmony_ci| ---------------------------------------------------- | -------------------------------------------- | 839e41f4b71Sopenharmony_ci| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 840e41f4b71Sopenharmony_ci 841e41f4b71Sopenharmony_ci**Error codes** 842e41f4b71Sopenharmony_ci 843e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 844e41f4b71Sopenharmony_ci 845e41f4b71Sopenharmony_ci| ID| Error Message | 846e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 847e41f4b71Sopenharmony_ci| 201 | Permission denied. | 848e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 849e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 850e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 851e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 852e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 853e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 854e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 855e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 856e41f4b71Sopenharmony_ci 857e41f4b71Sopenharmony_ci**Example** 858e41f4b71Sopenharmony_ci 859e41f4b71Sopenharmony_ci```ts 860e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 861e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 862e41f4b71Sopenharmony_ci 863e41f4b71Sopenharmony_cilet lockInfo: sim.LockInfo = { 864e41f4b71Sopenharmony_ci lockType: sim.LockType.PIN_LOCK, 865e41f4b71Sopenharmony_ci password: "1234", 866e41f4b71Sopenharmony_ci state: sim.LockState.LOCK_OFF 867e41f4b71Sopenharmony_ci}; 868e41f4b71Sopenharmony_cisim.setLockState(0, lockInfo).then((data: sim.LockStatusResponse) => { 869e41f4b71Sopenharmony_ci console.log(`setLockState success, promise: data->${JSON.stringify(data)}`); 870e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 871e41f4b71Sopenharmony_ci console.error(`setLockState failed, promise: err->${JSON.stringify(err)}`); 872e41f4b71Sopenharmony_ci}); 873e41f4b71Sopenharmony_ci``` 874e41f4b71Sopenharmony_ci 875e41f4b71Sopenharmony_ci## sim.getLockState<sup>8+</sup> 876e41f4b71Sopenharmony_ci 877e41f4b71Sopenharmony_cigetLockState\(slotId: number, lockType: LockType, callback: AsyncCallback\<LockState\>\): void 878e41f4b71Sopenharmony_ci 879e41f4b71Sopenharmony_ciObtains the lock status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 880e41f4b71Sopenharmony_ci 881e41f4b71Sopenharmony_ci**System API**: This is a system API. 882e41f4b71Sopenharmony_ci 883e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 884e41f4b71Sopenharmony_ci 885e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 886e41f4b71Sopenharmony_ci 887e41f4b71Sopenharmony_ci**Parameters** 888e41f4b71Sopenharmony_ci 889e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 890e41f4b71Sopenharmony_ci| -------- | ----------------------------------------- | ---- | --------------------------------------- | 891e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 892e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[LockState](#lockstate8)\> | Yes | Callback used to return the result. | 893e41f4b71Sopenharmony_ci| options | [LockType](#locktype8) | Yes | Lock type.<br>- **1**: PIN lock<br>- **2**: PIN 2 lock| 894e41f4b71Sopenharmony_ci 895e41f4b71Sopenharmony_ci**Error codes** 896e41f4b71Sopenharmony_ci 897e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 898e41f4b71Sopenharmony_ci 899e41f4b71Sopenharmony_ci| ID| Error Message | 900e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 901e41f4b71Sopenharmony_ci| 201 | Permission denied. | 902e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 903e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 904e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 905e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 906e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 907e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 908e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 909e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 910e41f4b71Sopenharmony_ci 911e41f4b71Sopenharmony_ci**Example** 912e41f4b71Sopenharmony_ci 913e41f4b71Sopenharmony_ci```ts 914e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 915e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 916e41f4b71Sopenharmony_ci 917e41f4b71Sopenharmony_cisim.getLockState(0, 1, (err: BusinessError, data: sim.LockState) => { 918e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 919e41f4b71Sopenharmony_ci}); 920e41f4b71Sopenharmony_ci``` 921e41f4b71Sopenharmony_ci 922e41f4b71Sopenharmony_ci 923e41f4b71Sopenharmony_ci## sim.getLockState<sup>8+</sup> 924e41f4b71Sopenharmony_ci 925e41f4b71Sopenharmony_cigetLockState\(slotId: number, lockType: LockType\): Promise\<LockState\> 926e41f4b71Sopenharmony_ci 927e41f4b71Sopenharmony_ciObtains the lock status of the SIM card in the specified slot. This API uses a promise to return the result. 928e41f4b71Sopenharmony_ci 929e41f4b71Sopenharmony_ci**System API**: This is a system API. 930e41f4b71Sopenharmony_ci 931e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 932e41f4b71Sopenharmony_ci 933e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 934e41f4b71Sopenharmony_ci 935e41f4b71Sopenharmony_ci**Parameters** 936e41f4b71Sopenharmony_ci 937e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 938e41f4b71Sopenharmony_ci| ------- | ---------------------- | ---- | --------------------------------------- | 939e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 940e41f4b71Sopenharmony_ci| options | [LockType](#locktype8) | Yes | Lock type.<br>- **1**: PIN lock<br>- **2**: PIN 2 lock| 941e41f4b71Sopenharmony_ci 942e41f4b71Sopenharmony_ci**Return value** 943e41f4b71Sopenharmony_ci 944e41f4b71Sopenharmony_ci| Type | Description | 945e41f4b71Sopenharmony_ci| ---------------------------------- | -------------------------------------------- | 946e41f4b71Sopenharmony_ci| Promise<[LockState](#lockstate8)\> | Promise used to return the result.| 947e41f4b71Sopenharmony_ci 948e41f4b71Sopenharmony_ci**Error codes** 949e41f4b71Sopenharmony_ci 950e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 951e41f4b71Sopenharmony_ci 952e41f4b71Sopenharmony_ci| ID| Error Message | 953e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 954e41f4b71Sopenharmony_ci| 201 | Permission denied. | 955e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 956e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 957e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 958e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 959e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 960e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 961e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 962e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 963e41f4b71Sopenharmony_ci 964e41f4b71Sopenharmony_ci**Example** 965e41f4b71Sopenharmony_ci 966e41f4b71Sopenharmony_ci```ts 967e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 968e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 969e41f4b71Sopenharmony_ci 970e41f4b71Sopenharmony_cisim.getLockState(0, 1).then((data: sim.LockState) => { 971e41f4b71Sopenharmony_ci console.log(`getLockState success, promise: data->${JSON.stringify(data)}`); 972e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 973e41f4b71Sopenharmony_ci console.error(`getLockState failed, promise: err->${JSON.stringify(err)}`); 974e41f4b71Sopenharmony_ci}); 975e41f4b71Sopenharmony_ci``` 976e41f4b71Sopenharmony_ci 977e41f4b71Sopenharmony_ci## sim.alterPin<sup>7+</sup> 978e41f4b71Sopenharmony_ci 979e41f4b71Sopenharmony_cialterPin\(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback\<LockStatusResponse\>\): void 980e41f4b71Sopenharmony_ci 981e41f4b71Sopenharmony_ciChanges the PIN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 982e41f4b71Sopenharmony_ci 983e41f4b71Sopenharmony_ci**System API**: This is a system API. 984e41f4b71Sopenharmony_ci 985e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 986e41f4b71Sopenharmony_ci 987e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 988e41f4b71Sopenharmony_ci 989e41f4b71Sopenharmony_ci**Parameters** 990e41f4b71Sopenharmony_ci 991e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 992e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------------------- | ---- | -------------------------------------- | 993e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 994e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | 995e41f4b71Sopenharmony_ci| newPin | string | Yes | New PIN. | 996e41f4b71Sopenharmony_ci| oldPin | string | Yes | Old PIN. | 997e41f4b71Sopenharmony_ci 998e41f4b71Sopenharmony_ci**Error codes** 999e41f4b71Sopenharmony_ci 1000e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1001e41f4b71Sopenharmony_ci 1002e41f4b71Sopenharmony_ci| ID| Error Message | 1003e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1004e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1005e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1006e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1007e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1008e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1009e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1010e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1011e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1012e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1013e41f4b71Sopenharmony_ci 1014e41f4b71Sopenharmony_ci**Example** 1015e41f4b71Sopenharmony_ci 1016e41f4b71Sopenharmony_ci```ts 1017e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1018e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1019e41f4b71Sopenharmony_ci 1020e41f4b71Sopenharmony_cisim.alterPin(0, "1234", "0000", (err: BusinessError, data: sim.LockStatusResponse) => { 1021e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1022e41f4b71Sopenharmony_ci}); 1023e41f4b71Sopenharmony_ci``` 1024e41f4b71Sopenharmony_ci 1025e41f4b71Sopenharmony_ci 1026e41f4b71Sopenharmony_ci## sim.alterPin<sup>7+</sup> 1027e41f4b71Sopenharmony_ci 1028e41f4b71Sopenharmony_cialterPin\(slotId: number, newPin: string, oldPin: string\): Promise\<LockStatusResponse\> 1029e41f4b71Sopenharmony_ci 1030e41f4b71Sopenharmony_ciChanges the PIN of the SIM card in the specified slot. This API uses a promise to return the result. 1031e41f4b71Sopenharmony_ci 1032e41f4b71Sopenharmony_ci**System API**: This is a system API. 1033e41f4b71Sopenharmony_ci 1034e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1035e41f4b71Sopenharmony_ci 1036e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1037e41f4b71Sopenharmony_ci 1038e41f4b71Sopenharmony_ci**Parameters** 1039e41f4b71Sopenharmony_ci 1040e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1041e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1042e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1043e41f4b71Sopenharmony_ci| newPin | string | Yes | New PIN. | 1044e41f4b71Sopenharmony_ci| oldPin | string | Yes | Old PIN. | 1045e41f4b71Sopenharmony_ci 1046e41f4b71Sopenharmony_ci**Return value** 1047e41f4b71Sopenharmony_ci 1048e41f4b71Sopenharmony_ci| Type | Description | 1049e41f4b71Sopenharmony_ci| ---------------------------------------------------- | --------------------------------------------- | 1050e41f4b71Sopenharmony_ci| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1051e41f4b71Sopenharmony_ci 1052e41f4b71Sopenharmony_ci**Error codes** 1053e41f4b71Sopenharmony_ci 1054e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1055e41f4b71Sopenharmony_ci 1056e41f4b71Sopenharmony_ci| ID| Error Message | 1057e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1058e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1059e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1060e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1061e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1062e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1063e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1064e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1065e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1066e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1067e41f4b71Sopenharmony_ci 1068e41f4b71Sopenharmony_ci**Example** 1069e41f4b71Sopenharmony_ci 1070e41f4b71Sopenharmony_ci```ts 1071e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1072e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1073e41f4b71Sopenharmony_ci 1074e41f4b71Sopenharmony_cisim.alterPin(0, "1234", "0000").then((data: sim.LockStatusResponse) => { 1075e41f4b71Sopenharmony_ci console.log(`alterPin success, promise: data->${JSON.stringify(data)}`); 1076e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1077e41f4b71Sopenharmony_ci console.error(`alterPin failed, promise: err->${JSON.stringify(err)}`); 1078e41f4b71Sopenharmony_ci}); 1079e41f4b71Sopenharmony_ci``` 1080e41f4b71Sopenharmony_ci 1081e41f4b71Sopenharmony_ci## sim.alterPin2<sup>8+</sup> 1082e41f4b71Sopenharmony_ci 1083e41f4b71Sopenharmony_cialterPin2\(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallback\<LockStatusResponse\>\): void 1084e41f4b71Sopenharmony_ci 1085e41f4b71Sopenharmony_ciChanges PIN 2 of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1086e41f4b71Sopenharmony_ci 1087e41f4b71Sopenharmony_ci**System API**: This is a system API. 1088e41f4b71Sopenharmony_ci 1089e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1090e41f4b71Sopenharmony_ci 1091e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1092e41f4b71Sopenharmony_ci 1093e41f4b71Sopenharmony_ci**Parameters** 1094e41f4b71Sopenharmony_ci 1095e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1096e41f4b71Sopenharmony_ci| -------- | ----------------------------------------------------------- | ---- | -------------------------------------- | 1097e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1098e41f4b71Sopenharmony_ci| callback | AsyncCallback\<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | 1099e41f4b71Sopenharmony_ci| newPin2 | string | Yes | New PIN. | 1100e41f4b71Sopenharmony_ci| oldPin2 | string | Yes | Old PIN. | 1101e41f4b71Sopenharmony_ci 1102e41f4b71Sopenharmony_ci**Error codes** 1103e41f4b71Sopenharmony_ci 1104e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1105e41f4b71Sopenharmony_ci 1106e41f4b71Sopenharmony_ci| ID| Error Message | 1107e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1108e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1109e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1110e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1111e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1112e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1113e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1114e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1115e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1116e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1117e41f4b71Sopenharmony_ci 1118e41f4b71Sopenharmony_ci**Example** 1119e41f4b71Sopenharmony_ci 1120e41f4b71Sopenharmony_ci```ts 1121e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1122e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1123e41f4b71Sopenharmony_ci 1124e41f4b71Sopenharmony_cisim.alterPin2(0, "1234", "0000", (err: BusinessError, data: sim.LockStatusResponse) => { 1125e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1126e41f4b71Sopenharmony_ci}); 1127e41f4b71Sopenharmony_ci``` 1128e41f4b71Sopenharmony_ci 1129e41f4b71Sopenharmony_ci 1130e41f4b71Sopenharmony_ci## sim.alterPin2<sup>8+</sup> 1131e41f4b71Sopenharmony_ci 1132e41f4b71Sopenharmony_cialterPin2\(slotId: number, newPin2: string, oldPin2: string\): Promise\<LockStatusResponse\> 1133e41f4b71Sopenharmony_ci 1134e41f4b71Sopenharmony_ciChanges PIN 2 of the SIM card in the specified slot. This API uses a promise to return the result. 1135e41f4b71Sopenharmony_ci 1136e41f4b71Sopenharmony_ci**System API**: This is a system API. 1137e41f4b71Sopenharmony_ci 1138e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1139e41f4b71Sopenharmony_ci 1140e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1141e41f4b71Sopenharmony_ci 1142e41f4b71Sopenharmony_ci**Parameters** 1143e41f4b71Sopenharmony_ci 1144e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1145e41f4b71Sopenharmony_ci| ------- | ------ | ---- | -------------------------------------- | 1146e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1147e41f4b71Sopenharmony_ci| newPin2 | string | Yes | New PIN. | 1148e41f4b71Sopenharmony_ci| oldPin2 | string | Yes | Old PIN. | 1149e41f4b71Sopenharmony_ci 1150e41f4b71Sopenharmony_ci**Return value** 1151e41f4b71Sopenharmony_ci 1152e41f4b71Sopenharmony_ci| Type | Description | 1153e41f4b71Sopenharmony_ci| ---------------------------------------------------- | --------------------------------------------- | 1154e41f4b71Sopenharmony_ci| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1155e41f4b71Sopenharmony_ci 1156e41f4b71Sopenharmony_ci**Error codes** 1157e41f4b71Sopenharmony_ci 1158e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1159e41f4b71Sopenharmony_ci 1160e41f4b71Sopenharmony_ci| ID| Error Message | 1161e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1162e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1163e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1164e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1165e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1166e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1167e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1168e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1169e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1170e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1171e41f4b71Sopenharmony_ci 1172e41f4b71Sopenharmony_ci**Example** 1173e41f4b71Sopenharmony_ci 1174e41f4b71Sopenharmony_ci```ts 1175e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1176e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1177e41f4b71Sopenharmony_ci 1178e41f4b71Sopenharmony_cisim.alterPin2(0, "1234", "0000").then((data: sim.LockStatusResponse) => { 1179e41f4b71Sopenharmony_ci console.log(`alterPin2 success, promise: data->${JSON.stringify(data)}`); 1180e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1181e41f4b71Sopenharmony_ci console.error(`alterPin2 failed, promise: err->${JSON.stringify(err)}`); 1182e41f4b71Sopenharmony_ci}); 1183e41f4b71Sopenharmony_ci``` 1184e41f4b71Sopenharmony_ci 1185e41f4b71Sopenharmony_ci## sim.unlockPin<sup>7+</sup> 1186e41f4b71Sopenharmony_ci 1187e41f4b71Sopenharmony_ciunlockPin\(slotId: number, pin: string, callback: AsyncCallback\<LockStatusResponse\>\): void 1188e41f4b71Sopenharmony_ci 1189e41f4b71Sopenharmony_ciUnlocks the PIN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1190e41f4b71Sopenharmony_ci 1191e41f4b71Sopenharmony_ci**System API**: This is a system API. 1192e41f4b71Sopenharmony_ci 1193e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1194e41f4b71Sopenharmony_ci 1195e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1196e41f4b71Sopenharmony_ci 1197e41f4b71Sopenharmony_ci**Parameters** 1198e41f4b71Sopenharmony_ci 1199e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1200e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1201e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1202e41f4b71Sopenharmony_ci| pin | string | Yes | PIN of the SIM card. | 1203e41f4b71Sopenharmony_ci| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. | 1204e41f4b71Sopenharmony_ci 1205e41f4b71Sopenharmony_ci**Error codes** 1206e41f4b71Sopenharmony_ci 1207e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1208e41f4b71Sopenharmony_ci 1209e41f4b71Sopenharmony_ci| ID| Error Message | 1210e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1211e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1212e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1213e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1214e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1215e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1216e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1217e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1218e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1219e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1220e41f4b71Sopenharmony_ci 1221e41f4b71Sopenharmony_ci**Example** 1222e41f4b71Sopenharmony_ci 1223e41f4b71Sopenharmony_ci```ts 1224e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1225e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1226e41f4b71Sopenharmony_ci 1227e41f4b71Sopenharmony_cilet pin: string = '1234'; 1228e41f4b71Sopenharmony_cisim.unlockPin(0, pin, (err: BusinessError, data: sim.LockStatusResponse) => { 1229e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1230e41f4b71Sopenharmony_ci}); 1231e41f4b71Sopenharmony_ci``` 1232e41f4b71Sopenharmony_ci 1233e41f4b71Sopenharmony_ci 1234e41f4b71Sopenharmony_ci## sim.unlockPin<sup>7+</sup> 1235e41f4b71Sopenharmony_ci 1236e41f4b71Sopenharmony_ciunlockPin\(slotId: number, pin: string\): Promise\<LockStatusResponse\> 1237e41f4b71Sopenharmony_ci 1238e41f4b71Sopenharmony_ciUnlocks the PIN of the SIM card in the specified slot. This API uses a promise to return the result. 1239e41f4b71Sopenharmony_ci 1240e41f4b71Sopenharmony_ci**System API**: This is a system API. 1241e41f4b71Sopenharmony_ci 1242e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1243e41f4b71Sopenharmony_ci 1244e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1245e41f4b71Sopenharmony_ci 1246e41f4b71Sopenharmony_ci**Parameters** 1247e41f4b71Sopenharmony_ci 1248e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1249e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1250e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1251e41f4b71Sopenharmony_ci| pin | string | Yes | PIN of the SIM card. | 1252e41f4b71Sopenharmony_ci 1253e41f4b71Sopenharmony_ci**Return value** 1254e41f4b71Sopenharmony_ci 1255e41f4b71Sopenharmony_ci| Type | Description | 1256e41f4b71Sopenharmony_ci| ---------------------------------------------------- | -------------------------------------------------- | 1257e41f4b71Sopenharmony_ci| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1258e41f4b71Sopenharmony_ci 1259e41f4b71Sopenharmony_ci**Error codes** 1260e41f4b71Sopenharmony_ci 1261e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1262e41f4b71Sopenharmony_ci 1263e41f4b71Sopenharmony_ci| ID| Error Message | 1264e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1265e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1266e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1267e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1268e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1269e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1270e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1271e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1272e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1273e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1274e41f4b71Sopenharmony_ci 1275e41f4b71Sopenharmony_ci**Example** 1276e41f4b71Sopenharmony_ci 1277e41f4b71Sopenharmony_ci```ts 1278e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1279e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1280e41f4b71Sopenharmony_ci 1281e41f4b71Sopenharmony_cilet pin: string = '1234'; 1282e41f4b71Sopenharmony_cisim.unlockPin(0, pin).then((data: sim.LockStatusResponse) => { 1283e41f4b71Sopenharmony_ci console.log(`unlockPin success, promise: data->${JSON.stringify(data)}`); 1284e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1285e41f4b71Sopenharmony_ci console.error(`unlockPin failed, promise: err->${JSON.stringify(err)}`); 1286e41f4b71Sopenharmony_ci}); 1287e41f4b71Sopenharmony_ci``` 1288e41f4b71Sopenharmony_ci 1289e41f4b71Sopenharmony_ci## sim.unlockPuk<sup>7+</sup> 1290e41f4b71Sopenharmony_ci 1291e41f4b71Sopenharmony_ciunlockPuk\(slotId: number, newPin: string, puk: string, callback: AsyncCallback\<LockStatusResponse\>\): void 1292e41f4b71Sopenharmony_ci 1293e41f4b71Sopenharmony_ciUnlocks the PUK of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1294e41f4b71Sopenharmony_ci 1295e41f4b71Sopenharmony_ci**System API**: This is a system API. 1296e41f4b71Sopenharmony_ci 1297e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1298e41f4b71Sopenharmony_ci 1299e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1300e41f4b71Sopenharmony_ci 1301e41f4b71Sopenharmony_ci**Parameters** 1302e41f4b71Sopenharmony_ci 1303e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1304e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1305e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1306e41f4b71Sopenharmony_ci| newPin | string | Yes | New PIN. | 1307e41f4b71Sopenharmony_ci| puk | string | Yes | PUK of the SIM card. | 1308e41f4b71Sopenharmony_ci| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. | 1309e41f4b71Sopenharmony_ci 1310e41f4b71Sopenharmony_ci**Error codes** 1311e41f4b71Sopenharmony_ci 1312e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1313e41f4b71Sopenharmony_ci 1314e41f4b71Sopenharmony_ci| ID| Error Message | 1315e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1316e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1317e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1318e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1319e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1320e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1321e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1322e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1323e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1324e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1325e41f4b71Sopenharmony_ci 1326e41f4b71Sopenharmony_ci**Example** 1327e41f4b71Sopenharmony_ci 1328e41f4b71Sopenharmony_ci```ts 1329e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1330e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1331e41f4b71Sopenharmony_ci 1332e41f4b71Sopenharmony_cilet puk: string = '1xxxxxxx'; 1333e41f4b71Sopenharmony_cilet newPin: string = '1235'; 1334e41f4b71Sopenharmony_cisim.unlockPuk(0, newPin, puk, (err: BusinessError, data: sim.LockStatusResponse) => { 1335e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1336e41f4b71Sopenharmony_ci}); 1337e41f4b71Sopenharmony_ci``` 1338e41f4b71Sopenharmony_ci 1339e41f4b71Sopenharmony_ci 1340e41f4b71Sopenharmony_ci## sim.unlockPuk<sup>7+</sup> 1341e41f4b71Sopenharmony_ci 1342e41f4b71Sopenharmony_ciunlockPuk\(slotId: number, newPin: string, puk: string\): Promise\<LockStatusResponse\> 1343e41f4b71Sopenharmony_ci 1344e41f4b71Sopenharmony_ciUnlocks the PUK of the SIM card in the specified slot. This API uses a promise to return the result. 1345e41f4b71Sopenharmony_ci 1346e41f4b71Sopenharmony_ci**System API**: This is a system API. 1347e41f4b71Sopenharmony_ci 1348e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1349e41f4b71Sopenharmony_ci 1350e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1351e41f4b71Sopenharmony_ci 1352e41f4b71Sopenharmony_ci**Parameters** 1353e41f4b71Sopenharmony_ci 1354e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1355e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1356e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1357e41f4b71Sopenharmony_ci| newPin | string | Yes | New PIN. | 1358e41f4b71Sopenharmony_ci| puk | string | Yes | PUK of the SIM card. | 1359e41f4b71Sopenharmony_ci 1360e41f4b71Sopenharmony_ci**Return value** 1361e41f4b71Sopenharmony_ci 1362e41f4b71Sopenharmony_ci| Type | Description | 1363e41f4b71Sopenharmony_ci| ---------------------------------------------------- | -------------------------------------------------- | 1364e41f4b71Sopenharmony_ci| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1365e41f4b71Sopenharmony_ci 1366e41f4b71Sopenharmony_ci**Error codes** 1367e41f4b71Sopenharmony_ci 1368e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1369e41f4b71Sopenharmony_ci 1370e41f4b71Sopenharmony_ci| ID| Error Message | 1371e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1372e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1373e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1374e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1375e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1376e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1377e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1378e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1379e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1380e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1381e41f4b71Sopenharmony_ci 1382e41f4b71Sopenharmony_ci**Example** 1383e41f4b71Sopenharmony_ci 1384e41f4b71Sopenharmony_ci```ts 1385e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1386e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1387e41f4b71Sopenharmony_ci 1388e41f4b71Sopenharmony_cilet puk: string = '1xxxxxxx'; 1389e41f4b71Sopenharmony_cilet newPin: string = '1235'; 1390e41f4b71Sopenharmony_cisim.unlockPuk(0, newPin, puk).then((data: sim.LockStatusResponse) => { 1391e41f4b71Sopenharmony_ci console.log(`unlockPuk success, promise: data->${JSON.stringify(data)}`); 1392e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1393e41f4b71Sopenharmony_ci console.error(`unlockPuk failed, promise: err->${JSON.stringify(err)}`); 1394e41f4b71Sopenharmony_ci}); 1395e41f4b71Sopenharmony_ci``` 1396e41f4b71Sopenharmony_ci 1397e41f4b71Sopenharmony_ci## sim.unlockPin2<sup>8+</sup> 1398e41f4b71Sopenharmony_ci 1399e41f4b71Sopenharmony_ciunlockPin2\(slotId: number, pin2: string, callback: AsyncCallback\<LockStatusResponse\>\): void 1400e41f4b71Sopenharmony_ci 1401e41f4b71Sopenharmony_ciUnlocks the PIN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1402e41f4b71Sopenharmony_ci 1403e41f4b71Sopenharmony_ci**System API**: This is a system API. 1404e41f4b71Sopenharmony_ci 1405e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1406e41f4b71Sopenharmony_ci 1407e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1408e41f4b71Sopenharmony_ci 1409e41f4b71Sopenharmony_ci**Parameters** 1410e41f4b71Sopenharmony_ci 1411e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1412e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1413e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1414e41f4b71Sopenharmony_ci| pin2 | string | Yes | PIN of the SIM card. | 1415e41f4b71Sopenharmony_ci| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. | 1416e41f4b71Sopenharmony_ci 1417e41f4b71Sopenharmony_ci**Error codes** 1418e41f4b71Sopenharmony_ci 1419e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1420e41f4b71Sopenharmony_ci 1421e41f4b71Sopenharmony_ci| ID| Error Message | 1422e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1423e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1424e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1425e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1426e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1427e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1428e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1429e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1430e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1431e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1432e41f4b71Sopenharmony_ci 1433e41f4b71Sopenharmony_ci**Example** 1434e41f4b71Sopenharmony_ci 1435e41f4b71Sopenharmony_ci```ts 1436e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1437e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1438e41f4b71Sopenharmony_ci 1439e41f4b71Sopenharmony_cilet pin2: string = '1234'; 1440e41f4b71Sopenharmony_cisim.unlockPin2(0, pin2, (err: BusinessError, data: sim.LockStatusResponse) => { 1441e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1442e41f4b71Sopenharmony_ci}); 1443e41f4b71Sopenharmony_ci``` 1444e41f4b71Sopenharmony_ci 1445e41f4b71Sopenharmony_ci 1446e41f4b71Sopenharmony_ci## sim.unlockPin2<sup>8+</sup> 1447e41f4b71Sopenharmony_ci 1448e41f4b71Sopenharmony_ciunlockPin2\(slotId: number, pin2: string\): Promise\<LockStatusResponse\> 1449e41f4b71Sopenharmony_ci 1450e41f4b71Sopenharmony_ciUnlocks the PIN of the SIM card in the specified slot. This API uses a promise to return the result. 1451e41f4b71Sopenharmony_ci 1452e41f4b71Sopenharmony_ci**System API**: This is a system API. 1453e41f4b71Sopenharmony_ci 1454e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1455e41f4b71Sopenharmony_ci 1456e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1457e41f4b71Sopenharmony_ci 1458e41f4b71Sopenharmony_ci**Parameters** 1459e41f4b71Sopenharmony_ci 1460e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1461e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1462e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1463e41f4b71Sopenharmony_ci| pin2 | string | Yes | PIN of the SIM card. | 1464e41f4b71Sopenharmony_ci 1465e41f4b71Sopenharmony_ci**Return value** 1466e41f4b71Sopenharmony_ci 1467e41f4b71Sopenharmony_ci| Type | Description | 1468e41f4b71Sopenharmony_ci| ----------------------------------------------------- | -------------------------------------------------- | 1469e41f4b71Sopenharmony_ci| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1470e41f4b71Sopenharmony_ci 1471e41f4b71Sopenharmony_ci**Error codes** 1472e41f4b71Sopenharmony_ci 1473e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1474e41f4b71Sopenharmony_ci 1475e41f4b71Sopenharmony_ci| ID| Error Message | 1476e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1477e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1478e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1479e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1480e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1481e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1482e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1483e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1484e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1485e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1486e41f4b71Sopenharmony_ci 1487e41f4b71Sopenharmony_ci**Example** 1488e41f4b71Sopenharmony_ci 1489e41f4b71Sopenharmony_ci```ts 1490e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1491e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1492e41f4b71Sopenharmony_ci 1493e41f4b71Sopenharmony_cilet pin2: string = '1234'; 1494e41f4b71Sopenharmony_cisim.unlockPin2(0, pin2).then((data: sim.LockStatusResponse) => { 1495e41f4b71Sopenharmony_ci console.log(`unlockPin2 success, promise: data->${JSON.stringify(data)}`); 1496e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1497e41f4b71Sopenharmony_ci console.error(`unlockPin2 failed, promise: err->${JSON.stringify(err)}`); 1498e41f4b71Sopenharmony_ci}); 1499e41f4b71Sopenharmony_ci``` 1500e41f4b71Sopenharmony_ci 1501e41f4b71Sopenharmony_ci## sim.unlockPuk2<sup>8+</sup> 1502e41f4b71Sopenharmony_ci 1503e41f4b71Sopenharmony_ciunlockPuk2\(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback\<LockStatusResponse\>\): void 1504e41f4b71Sopenharmony_ci 1505e41f4b71Sopenharmony_ciUnlocks the PUK of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1506e41f4b71Sopenharmony_ci 1507e41f4b71Sopenharmony_ci**System API**: This is a system API. 1508e41f4b71Sopenharmony_ci 1509e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1510e41f4b71Sopenharmony_ci 1511e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1512e41f4b71Sopenharmony_ci 1513e41f4b71Sopenharmony_ci**Parameters** 1514e41f4b71Sopenharmony_ci 1515e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1516e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1517e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1518e41f4b71Sopenharmony_ci| newPin2 | string | Yes | New PIN 2. | 1519e41f4b71Sopenharmony_ci| puk2 | string | Yes | PUK of the SIM card. | 1520e41f4b71Sopenharmony_ci| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)> | Yes | Callback used to return the result. | 1521e41f4b71Sopenharmony_ci 1522e41f4b71Sopenharmony_ci**Error codes** 1523e41f4b71Sopenharmony_ci 1524e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1525e41f4b71Sopenharmony_ci 1526e41f4b71Sopenharmony_ci| ID| Error Message | 1527e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1528e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1529e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1530e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1531e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1532e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1533e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1534e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1535e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1536e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1537e41f4b71Sopenharmony_ci 1538e41f4b71Sopenharmony_ci**Example** 1539e41f4b71Sopenharmony_ci 1540e41f4b71Sopenharmony_ci```ts 1541e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1542e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1543e41f4b71Sopenharmony_ci 1544e41f4b71Sopenharmony_cilet puk2: string = '1xxxxxxx'; 1545e41f4b71Sopenharmony_cilet newPin2: string = '1235'; 1546e41f4b71Sopenharmony_cisim.unlockPuk2(0, newPin2, puk2, (err: BusinessError, data: sim.LockStatusResponse) => { 1547e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1548e41f4b71Sopenharmony_ci}); 1549e41f4b71Sopenharmony_ci``` 1550e41f4b71Sopenharmony_ci 1551e41f4b71Sopenharmony_ci 1552e41f4b71Sopenharmony_ci## sim.unlockPuk2<sup>8+</sup> 1553e41f4b71Sopenharmony_ci 1554e41f4b71Sopenharmony_ciunlockPuk2\(slotId: number, newPin2: string, puk2: string\): Promise\<LockStatusResponse\> 1555e41f4b71Sopenharmony_ci 1556e41f4b71Sopenharmony_ciUnlocks the PUK of the SIM card in the specified slot. This API uses a promise to return the result. 1557e41f4b71Sopenharmony_ci 1558e41f4b71Sopenharmony_ci**System API**: This is a system API. 1559e41f4b71Sopenharmony_ci 1560e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1561e41f4b71Sopenharmony_ci 1562e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1563e41f4b71Sopenharmony_ci 1564e41f4b71Sopenharmony_ci**Parameters** 1565e41f4b71Sopenharmony_ci 1566e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1567e41f4b71Sopenharmony_ci| ------- | ------ | ---- | -------------------------------------- | 1568e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1569e41f4b71Sopenharmony_ci| newPin2 | string | Yes | New PIN 2. | 1570e41f4b71Sopenharmony_ci| puk2 | string | Yes | PUK of the SIM card. | 1571e41f4b71Sopenharmony_ci 1572e41f4b71Sopenharmony_ci**Return value** 1573e41f4b71Sopenharmony_ci 1574e41f4b71Sopenharmony_ci| Type | Description | 1575e41f4b71Sopenharmony_ci| ---------------------------------------------------- | -------------------------------------------------- | 1576e41f4b71Sopenharmony_ci| Promise\<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 1577e41f4b71Sopenharmony_ci 1578e41f4b71Sopenharmony_ci**Error codes** 1579e41f4b71Sopenharmony_ci 1580e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1581e41f4b71Sopenharmony_ci 1582e41f4b71Sopenharmony_ci| ID| Error Message | 1583e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1584e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1585e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1586e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1587e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1588e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1589e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1590e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1591e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1592e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1593e41f4b71Sopenharmony_ci 1594e41f4b71Sopenharmony_ci**Example** 1595e41f4b71Sopenharmony_ci 1596e41f4b71Sopenharmony_ci```ts 1597e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1598e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1599e41f4b71Sopenharmony_ci 1600e41f4b71Sopenharmony_cilet puk2: string = '1xxxxxxx'; 1601e41f4b71Sopenharmony_cilet newPin2: string = '1235'; 1602e41f4b71Sopenharmony_cisim.unlockPuk2(0, newPin2, puk2).then((data: sim.LockStatusResponse) => { 1603e41f4b71Sopenharmony_ci console.log(`unlockPuk2 success, promise: data->${JSON.stringify(data)}`); 1604e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1605e41f4b71Sopenharmony_ci console.error(`unlockPuk2 failed, promise: err->${JSON.stringify(err)}`); 1606e41f4b71Sopenharmony_ci}); 1607e41f4b71Sopenharmony_ci``` 1608e41f4b71Sopenharmony_ci 1609e41f4b71Sopenharmony_ci## sim.getSimIccId<sup>7+</sup> 1610e41f4b71Sopenharmony_ci 1611e41f4b71Sopenharmony_cigetSimIccId\(slotId: number, callback: AsyncCallback\<string\>\): void 1612e41f4b71Sopenharmony_ci 1613e41f4b71Sopenharmony_ciObtains the ICCID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1614e41f4b71Sopenharmony_ci 1615e41f4b71Sopenharmony_ci**System API**: This is a system API. 1616e41f4b71Sopenharmony_ci 1617e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1618e41f4b71Sopenharmony_ci 1619e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1620e41f4b71Sopenharmony_ci 1621e41f4b71Sopenharmony_ci**Parameters** 1622e41f4b71Sopenharmony_ci 1623e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1624e41f4b71Sopenharmony_ci| -------- | ---------------------- | ---- | -------------------------------------- | 1625e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1626e41f4b71Sopenharmony_ci| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | 1627e41f4b71Sopenharmony_ci 1628e41f4b71Sopenharmony_ci**Error codes** 1629e41f4b71Sopenharmony_ci 1630e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1631e41f4b71Sopenharmony_ci 1632e41f4b71Sopenharmony_ci| ID| Error Message | 1633e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1634e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1635e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1636e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1637e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1638e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1639e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1640e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1641e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1642e41f4b71Sopenharmony_ci 1643e41f4b71Sopenharmony_ci**Example** 1644e41f4b71Sopenharmony_ci 1645e41f4b71Sopenharmony_ci```ts 1646e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1647e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1648e41f4b71Sopenharmony_ci 1649e41f4b71Sopenharmony_cisim.getSimIccId(0, (err: BusinessError, data: string) => { 1650e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1651e41f4b71Sopenharmony_ci}); 1652e41f4b71Sopenharmony_ci``` 1653e41f4b71Sopenharmony_ci 1654e41f4b71Sopenharmony_ci 1655e41f4b71Sopenharmony_ci## sim.getSimIccId<sup>7+</sup> 1656e41f4b71Sopenharmony_ci 1657e41f4b71Sopenharmony_cigetSimIccId\(slotId: number\): Promise\<string\> 1658e41f4b71Sopenharmony_ci 1659e41f4b71Sopenharmony_ciObtains the ICCID of the SIM card in the specified slot. This API uses a promise to return the result. 1660e41f4b71Sopenharmony_ci 1661e41f4b71Sopenharmony_ci**System API**: This is a system API. 1662e41f4b71Sopenharmony_ci 1663e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1664e41f4b71Sopenharmony_ci 1665e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1666e41f4b71Sopenharmony_ci 1667e41f4b71Sopenharmony_ci**Parameters** 1668e41f4b71Sopenharmony_ci 1669e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1670e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1671e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1672e41f4b71Sopenharmony_ci 1673e41f4b71Sopenharmony_ci**Return value** 1674e41f4b71Sopenharmony_ci 1675e41f4b71Sopenharmony_ci| Type | Description | 1676e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------- | 1677e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 1678e41f4b71Sopenharmony_ci 1679e41f4b71Sopenharmony_ci**Error codes** 1680e41f4b71Sopenharmony_ci 1681e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1682e41f4b71Sopenharmony_ci 1683e41f4b71Sopenharmony_ci| ID| Error Message | 1684e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1685e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1686e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1687e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1688e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1689e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1690e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1691e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1692e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1693e41f4b71Sopenharmony_ci 1694e41f4b71Sopenharmony_ci**Example** 1695e41f4b71Sopenharmony_ci 1696e41f4b71Sopenharmony_ci```ts 1697e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1698e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1699e41f4b71Sopenharmony_ci 1700e41f4b71Sopenharmony_cisim.getSimIccId(0).then((data:string) => { 1701e41f4b71Sopenharmony_ci console.log(`getSimIccId success, promise: data->${JSON.stringify(data)}`); 1702e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1703e41f4b71Sopenharmony_ci console.error(`getSimIccId failed, promise: err->${JSON.stringify(err)}`); 1704e41f4b71Sopenharmony_ci}); 1705e41f4b71Sopenharmony_ci``` 1706e41f4b71Sopenharmony_ci 1707e41f4b71Sopenharmony_ci## sim.getVoiceMailIdentifier<sup>8+</sup> 1708e41f4b71Sopenharmony_ci 1709e41f4b71Sopenharmony_cigetVoiceMailIdentifier\(slotId: number, callback: AsyncCallback\<string\>\): void 1710e41f4b71Sopenharmony_ci 1711e41f4b71Sopenharmony_ciObtains the voice mailbox alpha identifier of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1712e41f4b71Sopenharmony_ci 1713e41f4b71Sopenharmony_ci**System API**: This is a system API. 1714e41f4b71Sopenharmony_ci 1715e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1716e41f4b71Sopenharmony_ci 1717e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1718e41f4b71Sopenharmony_ci 1719e41f4b71Sopenharmony_ci**Parameters** 1720e41f4b71Sopenharmony_ci 1721e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1722e41f4b71Sopenharmony_ci| -------- | ---------------------- | ---- | -------------------------------------- | 1723e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1724e41f4b71Sopenharmony_ci| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | 1725e41f4b71Sopenharmony_ci 1726e41f4b71Sopenharmony_ci**Error codes** 1727e41f4b71Sopenharmony_ci 1728e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1729e41f4b71Sopenharmony_ci 1730e41f4b71Sopenharmony_ci| ID| Error Message | 1731e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1732e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1733e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1734e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1735e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1736e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1737e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1738e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1739e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1740e41f4b71Sopenharmony_ci 1741e41f4b71Sopenharmony_ci**Example** 1742e41f4b71Sopenharmony_ci 1743e41f4b71Sopenharmony_ci```ts 1744e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1745e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1746e41f4b71Sopenharmony_ci 1747e41f4b71Sopenharmony_cisim.getVoiceMailIdentifier(0, (err: BusinessError, data: string) => { 1748e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1749e41f4b71Sopenharmony_ci}); 1750e41f4b71Sopenharmony_ci``` 1751e41f4b71Sopenharmony_ci 1752e41f4b71Sopenharmony_ci 1753e41f4b71Sopenharmony_ci## sim.getVoiceMailIdentifier<sup>8+</sup> 1754e41f4b71Sopenharmony_ci 1755e41f4b71Sopenharmony_cigetVoiceMailIdentifier\(slotId: number\): Promise\<string\> 1756e41f4b71Sopenharmony_ci 1757e41f4b71Sopenharmony_ciObtains the voice mailbox alpha identifier of the SIM card in the specified slot. This API uses a promise to return the result. 1758e41f4b71Sopenharmony_ci 1759e41f4b71Sopenharmony_ci**System API**: This is a system API. 1760e41f4b71Sopenharmony_ci 1761e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1762e41f4b71Sopenharmony_ci 1763e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1764e41f4b71Sopenharmony_ci 1765e41f4b71Sopenharmony_ci**Parameters** 1766e41f4b71Sopenharmony_ci 1767e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1768e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1769e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1770e41f4b71Sopenharmony_ci 1771e41f4b71Sopenharmony_ci**Return value** 1772e41f4b71Sopenharmony_ci 1773e41f4b71Sopenharmony_ci| Type | Description | 1774e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------------- | 1775e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 1776e41f4b71Sopenharmony_ci 1777e41f4b71Sopenharmony_ci**Error codes** 1778e41f4b71Sopenharmony_ci 1779e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1780e41f4b71Sopenharmony_ci 1781e41f4b71Sopenharmony_ci| ID| Error Message | 1782e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1783e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1784e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1785e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1786e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1787e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1788e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1789e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1790e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1791e41f4b71Sopenharmony_ci 1792e41f4b71Sopenharmony_ci**Example** 1793e41f4b71Sopenharmony_ci 1794e41f4b71Sopenharmony_ci```ts 1795e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1796e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1797e41f4b71Sopenharmony_ci 1798e41f4b71Sopenharmony_cisim.getVoiceMailIdentifier(0).then((data: string) => { 1799e41f4b71Sopenharmony_ci console.log(`getVoiceMailIdentifier success, promise: data->${JSON.stringify(data)}`); 1800e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1801e41f4b71Sopenharmony_ci console.error(`getVoiceMailIdentifier failed, promise: err->${JSON.stringify(err)}`); 1802e41f4b71Sopenharmony_ci}); 1803e41f4b71Sopenharmony_ci``` 1804e41f4b71Sopenharmony_ci 1805e41f4b71Sopenharmony_ci## sim.getVoiceMailNumber<sup>8+</sup> 1806e41f4b71Sopenharmony_ci 1807e41f4b71Sopenharmony_cigetVoiceMailNumber\(slotId: number, callback: AsyncCallback\<string\>): void 1808e41f4b71Sopenharmony_ci 1809e41f4b71Sopenharmony_ciObtains the voice mailbox number of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1810e41f4b71Sopenharmony_ci 1811e41f4b71Sopenharmony_ci**System API**: This is a system API. 1812e41f4b71Sopenharmony_ci 1813e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1814e41f4b71Sopenharmony_ci 1815e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1816e41f4b71Sopenharmony_ci 1817e41f4b71Sopenharmony_ci**Parameters** 1818e41f4b71Sopenharmony_ci 1819e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1820e41f4b71Sopenharmony_ci| -------- | ---------------------- | ---- | -------------------------------------- | 1821e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1822e41f4b71Sopenharmony_ci| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | 1823e41f4b71Sopenharmony_ci 1824e41f4b71Sopenharmony_ci**Error codes** 1825e41f4b71Sopenharmony_ci 1826e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1827e41f4b71Sopenharmony_ci 1828e41f4b71Sopenharmony_ci| ID| Error Message | 1829e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1830e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1831e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1832e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1833e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1834e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1835e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1836e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1837e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1838e41f4b71Sopenharmony_ci 1839e41f4b71Sopenharmony_ci**Example** 1840e41f4b71Sopenharmony_ci 1841e41f4b71Sopenharmony_ci```ts 1842e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1843e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1844e41f4b71Sopenharmony_ci 1845e41f4b71Sopenharmony_cisim.getVoiceMailNumber(0, (err: BusinessError, data: string) => { 1846e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1847e41f4b71Sopenharmony_ci}); 1848e41f4b71Sopenharmony_ci``` 1849e41f4b71Sopenharmony_ci 1850e41f4b71Sopenharmony_ci 1851e41f4b71Sopenharmony_ci## sim.getVoiceMailNumber<sup>8+</sup> 1852e41f4b71Sopenharmony_ci 1853e41f4b71Sopenharmony_cigetVoiceMailNumber\(slotId: number\): Promise\<string\> 1854e41f4b71Sopenharmony_ci 1855e41f4b71Sopenharmony_ciObtains the voice mailbox number of the SIM card in the specified slot. This API uses a promise to return the result. 1856e41f4b71Sopenharmony_ci 1857e41f4b71Sopenharmony_ci**System API**: This is a system API. 1858e41f4b71Sopenharmony_ci 1859e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1860e41f4b71Sopenharmony_ci 1861e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1862e41f4b71Sopenharmony_ci 1863e41f4b71Sopenharmony_ci**Parameters** 1864e41f4b71Sopenharmony_ci 1865e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 1866e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 1867e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1868e41f4b71Sopenharmony_ci 1869e41f4b71Sopenharmony_ci**Return value** 1870e41f4b71Sopenharmony_ci 1871e41f4b71Sopenharmony_ci| Type | Description | 1872e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------------ | 1873e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 1874e41f4b71Sopenharmony_ci 1875e41f4b71Sopenharmony_ci**Error codes** 1876e41f4b71Sopenharmony_ci 1877e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1878e41f4b71Sopenharmony_ci 1879e41f4b71Sopenharmony_ci| ID| Error Message | 1880e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1881e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1882e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1883e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1884e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1885e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1886e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1887e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1888e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1889e41f4b71Sopenharmony_ci 1890e41f4b71Sopenharmony_ci**Example** 1891e41f4b71Sopenharmony_ci 1892e41f4b71Sopenharmony_ci```ts 1893e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1894e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1895e41f4b71Sopenharmony_ci 1896e41f4b71Sopenharmony_cisim.getVoiceMailNumber(0).then((data: string) => { 1897e41f4b71Sopenharmony_ci console.log(`getVoiceMailNumber success, promise: data->${JSON.stringify(data)}`); 1898e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 1899e41f4b71Sopenharmony_ci console.error(`getVoiceMailNumber failed, promise: err->${JSON.stringify(err)}`); 1900e41f4b71Sopenharmony_ci}); 1901e41f4b71Sopenharmony_ci``` 1902e41f4b71Sopenharmony_ci 1903e41f4b71Sopenharmony_ci 1904e41f4b71Sopenharmony_ci## sim.setVoiceMailInfo<sup>8+</sup> 1905e41f4b71Sopenharmony_ci 1906e41f4b71Sopenharmony_cisetVoiceMailInfo\(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback\<void\>\): void 1907e41f4b71Sopenharmony_ci 1908e41f4b71Sopenharmony_ciSets voice mailbox information for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1909e41f4b71Sopenharmony_ci 1910e41f4b71Sopenharmony_ci**System API**: This is a system API. 1911e41f4b71Sopenharmony_ci 1912e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1913e41f4b71Sopenharmony_ci 1914e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1915e41f4b71Sopenharmony_ci 1916e41f4b71Sopenharmony_ci**Parameters** 1917e41f4b71Sopenharmony_ci 1918e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1919e41f4b71Sopenharmony_ci| ---------- | -------------------- | ---- | -------------------------------------- | 1920e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1921e41f4b71Sopenharmony_ci| mailName | string | Yes | Voice mailbox name. | 1922e41f4b71Sopenharmony_ci| mailNumber | string | Yes | Voice mailbox number. | 1923e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 1924e41f4b71Sopenharmony_ci 1925e41f4b71Sopenharmony_ci**Error codes** 1926e41f4b71Sopenharmony_ci 1927e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1928e41f4b71Sopenharmony_ci 1929e41f4b71Sopenharmony_ci| ID| Error Message | 1930e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1931e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1932e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1933e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1934e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1935e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1936e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1937e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1938e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1939e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1940e41f4b71Sopenharmony_ci 1941e41f4b71Sopenharmony_ci**Example** 1942e41f4b71Sopenharmony_ci 1943e41f4b71Sopenharmony_ci```ts 1944e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1945e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 1946e41f4b71Sopenharmony_ci 1947e41f4b71Sopenharmony_cisim.setVoiceMailInfo(0, "mail", "xxx@xxx.com", (err: BusinessError) => { 1948e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 1949e41f4b71Sopenharmony_ci}); 1950e41f4b71Sopenharmony_ci``` 1951e41f4b71Sopenharmony_ci 1952e41f4b71Sopenharmony_ci 1953e41f4b71Sopenharmony_ci## sim.setVoiceMailInfo<sup>8+</sup> 1954e41f4b71Sopenharmony_ci 1955e41f4b71Sopenharmony_cisetVoiceMailInfo\(slotId: number, mailName: string, mailNumber: string\): Promise\<void\> 1956e41f4b71Sopenharmony_ci 1957e41f4b71Sopenharmony_ciSets voice mailbox information for the SIM card in the specified slot. This API uses a promise to return the result. 1958e41f4b71Sopenharmony_ci 1959e41f4b71Sopenharmony_ci**System API**: This is a system API. 1960e41f4b71Sopenharmony_ci 1961e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1962e41f4b71Sopenharmony_ci 1963e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 1964e41f4b71Sopenharmony_ci 1965e41f4b71Sopenharmony_ci**Parameters** 1966e41f4b71Sopenharmony_ci 1967e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 1968e41f4b71Sopenharmony_ci| ---------- | ------ | ---- | -------------------------------------- | 1969e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1970e41f4b71Sopenharmony_ci| mailName | string | Yes | Voice mailbox name. | 1971e41f4b71Sopenharmony_ci| mailNumber | string | Yes | Voice mailbox number. | 1972e41f4b71Sopenharmony_ci 1973e41f4b71Sopenharmony_ci**Return value** 1974e41f4b71Sopenharmony_ci 1975e41f4b71Sopenharmony_ci| Type | Description | 1976e41f4b71Sopenharmony_ci| -------------- | ----------------------- | 1977e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 1978e41f4b71Sopenharmony_ci 1979e41f4b71Sopenharmony_ci**Error codes** 1980e41f4b71Sopenharmony_ci 1981e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 1982e41f4b71Sopenharmony_ci 1983e41f4b71Sopenharmony_ci| ID| Error Message | 1984e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 1985e41f4b71Sopenharmony_ci| 201 | Permission denied. | 1986e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 1987e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 1988e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 1989e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 1990e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 1991e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 1992e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 1993e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 1994e41f4b71Sopenharmony_ci 1995e41f4b71Sopenharmony_ci**Example** 1996e41f4b71Sopenharmony_ci 1997e41f4b71Sopenharmony_ci```ts 1998e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 1999e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2000e41f4b71Sopenharmony_ci 2001e41f4b71Sopenharmony_cisim.setVoiceMailInfo(0, "mail", "xxx@xxx.com").then(() => { 2002e41f4b71Sopenharmony_ci console.log(`setVoiceMailInfo success.`); 2003e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2004e41f4b71Sopenharmony_ci console.error(`setVoiceMailInfo failed, promise: err->${JSON.stringify(err)}`); 2005e41f4b71Sopenharmony_ci}); 2006e41f4b71Sopenharmony_ci``` 2007e41f4b71Sopenharmony_ci 2008e41f4b71Sopenharmony_ci## sim.getSimTelephoneNumber<sup>8+</sup> 2009e41f4b71Sopenharmony_ci 2010e41f4b71Sopenharmony_cigetSimTelephoneNumber\(slotId: number, callback: AsyncCallback\<string\>\): void 2011e41f4b71Sopenharmony_ci 2012e41f4b71Sopenharmony_ciObtains the MSISDN of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2013e41f4b71Sopenharmony_ci 2014e41f4b71Sopenharmony_ci**System API**: This is a system API. 2015e41f4b71Sopenharmony_ci 2016e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_PHONE_NUMBERS 2017e41f4b71Sopenharmony_ci 2018e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2019e41f4b71Sopenharmony_ci 2020e41f4b71Sopenharmony_ci**Parameters** 2021e41f4b71Sopenharmony_ci 2022e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2023e41f4b71Sopenharmony_ci| -------- | ---------------------- | ---- | -------------------------------------- | 2024e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2025e41f4b71Sopenharmony_ci| callback | AsyncCallback<string\> | Yes | Callback used to return the result. | 2026e41f4b71Sopenharmony_ci 2027e41f4b71Sopenharmony_ci**Error codes** 2028e41f4b71Sopenharmony_ci 2029e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2030e41f4b71Sopenharmony_ci 2031e41f4b71Sopenharmony_ci| ID| Error Message | 2032e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2033e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2034e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2035e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2036e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2037e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2038e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2039e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2040e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2041e41f4b71Sopenharmony_ci 2042e41f4b71Sopenharmony_ci**Example** 2043e41f4b71Sopenharmony_ci 2044e41f4b71Sopenharmony_ci```ts 2045e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2046e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2047e41f4b71Sopenharmony_ci 2048e41f4b71Sopenharmony_cisim.getSimTelephoneNumber(0, (err: BusinessError, data: string) => { 2049e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2050e41f4b71Sopenharmony_ci}); 2051e41f4b71Sopenharmony_ci``` 2052e41f4b71Sopenharmony_ci 2053e41f4b71Sopenharmony_ci 2054e41f4b71Sopenharmony_ci## sim.getSimTelephoneNumber<sup>8+</sup> 2055e41f4b71Sopenharmony_ci 2056e41f4b71Sopenharmony_cigetSimTelephoneNumber\(slotId: number\): Promise\<string\> 2057e41f4b71Sopenharmony_ci 2058e41f4b71Sopenharmony_ciObtains the MSISDN of the SIM card in the specified slot. This API uses a promise to return the result. 2059e41f4b71Sopenharmony_ci 2060e41f4b71Sopenharmony_ci**System API**: This is a system API. 2061e41f4b71Sopenharmony_ci 2062e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_PHONE_NUMBERS 2063e41f4b71Sopenharmony_ci 2064e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2065e41f4b71Sopenharmony_ci 2066e41f4b71Sopenharmony_ci**Parameters** 2067e41f4b71Sopenharmony_ci 2068e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2069e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2070e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2071e41f4b71Sopenharmony_ci 2072e41f4b71Sopenharmony_ci**Return value** 2073e41f4b71Sopenharmony_ci 2074e41f4b71Sopenharmony_ci| Type | Description | 2075e41f4b71Sopenharmony_ci| ---------------- | -------------------------------------------- | 2076e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 2077e41f4b71Sopenharmony_ci 2078e41f4b71Sopenharmony_ci**Error codes** 2079e41f4b71Sopenharmony_ci 2080e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2081e41f4b71Sopenharmony_ci 2082e41f4b71Sopenharmony_ci| ID| Error Message | 2083e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2084e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2085e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2086e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2087e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2088e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2089e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2090e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2091e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2092e41f4b71Sopenharmony_ci 2093e41f4b71Sopenharmony_ci**Example** 2094e41f4b71Sopenharmony_ci 2095e41f4b71Sopenharmony_ci```ts 2096e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2097e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2098e41f4b71Sopenharmony_ci 2099e41f4b71Sopenharmony_cisim.getSimTelephoneNumber(0).then((data: string) => { 2100e41f4b71Sopenharmony_ci console.log(`getSimTelephoneNumber success, promise: data->${JSON.stringify(data)}`); 2101e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2102e41f4b71Sopenharmony_ci console.error(`getSimTelephoneNumber failed, promise: err->${JSON.stringify(err)}`); 2103e41f4b71Sopenharmony_ci}); 2104e41f4b71Sopenharmony_ci``` 2105e41f4b71Sopenharmony_ci 2106e41f4b71Sopenharmony_ci## sim.getSimGid1<sup>7+</sup> 2107e41f4b71Sopenharmony_ci 2108e41f4b71Sopenharmony_cigetSimGid1\(slotId: number, callback: AsyncCallback\<string\>\): void 2109e41f4b71Sopenharmony_ci 2110e41f4b71Sopenharmony_ciObtains the group identifier level 1 (GID1) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2111e41f4b71Sopenharmony_ci 2112e41f4b71Sopenharmony_ci**System API**: This is a system API. 2113e41f4b71Sopenharmony_ci 2114e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2115e41f4b71Sopenharmony_ci 2116e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2117e41f4b71Sopenharmony_ci 2118e41f4b71Sopenharmony_ci**Parameters** 2119e41f4b71Sopenharmony_ci 2120e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2121e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | -------------------------------------- | 2122e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2123e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | 2124e41f4b71Sopenharmony_ci 2125e41f4b71Sopenharmony_ci**Error codes** 2126e41f4b71Sopenharmony_ci 2127e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2128e41f4b71Sopenharmony_ci 2129e41f4b71Sopenharmony_ci| ID| Error Message | 2130e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2131e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2132e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2133e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2134e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2135e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2136e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2137e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2138e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2139e41f4b71Sopenharmony_ci 2140e41f4b71Sopenharmony_ci**Example** 2141e41f4b71Sopenharmony_ci 2142e41f4b71Sopenharmony_ci```ts 2143e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2144e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2145e41f4b71Sopenharmony_ci 2146e41f4b71Sopenharmony_cisim.getSimGid1(0, (err: BusinessError, data: string) => { 2147e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2148e41f4b71Sopenharmony_ci}); 2149e41f4b71Sopenharmony_ci``` 2150e41f4b71Sopenharmony_ci 2151e41f4b71Sopenharmony_ci 2152e41f4b71Sopenharmony_ci## sim.getSimGid1<sup>7+</sup> 2153e41f4b71Sopenharmony_ci 2154e41f4b71Sopenharmony_cigetSimGid1\(slotId: number\): Promise\<string\> 2155e41f4b71Sopenharmony_ci 2156e41f4b71Sopenharmony_ciObtains the GID1 of the SIM card in the specified slot. This API uses a promise to return the result. 2157e41f4b71Sopenharmony_ci 2158e41f4b71Sopenharmony_ci**System API**: This is a system API. 2159e41f4b71Sopenharmony_ci 2160e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2161e41f4b71Sopenharmony_ci 2162e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2163e41f4b71Sopenharmony_ci 2164e41f4b71Sopenharmony_ci**Parameters** 2165e41f4b71Sopenharmony_ci 2166e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2167e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2168e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2169e41f4b71Sopenharmony_ci 2170e41f4b71Sopenharmony_ci**Return value** 2171e41f4b71Sopenharmony_ci 2172e41f4b71Sopenharmony_ci| Type | Description | 2173e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------------- | 2174e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 2175e41f4b71Sopenharmony_ci 2176e41f4b71Sopenharmony_ci**Error codes** 2177e41f4b71Sopenharmony_ci 2178e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2179e41f4b71Sopenharmony_ci 2180e41f4b71Sopenharmony_ci| ID| Error Message | 2181e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2182e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2183e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2184e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2185e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2186e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2187e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2188e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2189e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2190e41f4b71Sopenharmony_ci 2191e41f4b71Sopenharmony_ci**Example** 2192e41f4b71Sopenharmony_ci 2193e41f4b71Sopenharmony_ci```ts 2194e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2195e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2196e41f4b71Sopenharmony_ci 2197e41f4b71Sopenharmony_cisim.getSimGid1(0).then((data: string) => { 2198e41f4b71Sopenharmony_ci console.log(`getSimGid1 success, promise: data->${JSON.stringify(data)}`); 2199e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2200e41f4b71Sopenharmony_ci console.error(`getSimGid1 failed, promise: err->${JSON.stringify(err)}`); 2201e41f4b71Sopenharmony_ci}); 2202e41f4b71Sopenharmony_ci``` 2203e41f4b71Sopenharmony_ci 2204e41f4b71Sopenharmony_ci## sim.getIMSI 2205e41f4b71Sopenharmony_ci 2206e41f4b71Sopenharmony_cigetIMSI\(slotId: number, callback: AsyncCallback\<string\>\): void 2207e41f4b71Sopenharmony_ci 2208e41f4b71Sopenharmony_ciObtains the international mobile subscriber identity (IMSI) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2209e41f4b71Sopenharmony_ci 2210e41f4b71Sopenharmony_ci**System API**: This is a system API. 2211e41f4b71Sopenharmony_ci 2212e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2213e41f4b71Sopenharmony_ci 2214e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2215e41f4b71Sopenharmony_ci 2216e41f4b71Sopenharmony_ci**Parameters** 2217e41f4b71Sopenharmony_ci 2218e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2219e41f4b71Sopenharmony_ci| -------- | ----------------------- | ---- | -------------------------------------- | 2220e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2221e41f4b71Sopenharmony_ci| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | 2222e41f4b71Sopenharmony_ci 2223e41f4b71Sopenharmony_ci**Error codes** 2224e41f4b71Sopenharmony_ci 2225e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2226e41f4b71Sopenharmony_ci 2227e41f4b71Sopenharmony_ci| ID| Error Message | 2228e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2229e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2230e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2231e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2232e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2233e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2234e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2235e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2236e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2237e41f4b71Sopenharmony_ci 2238e41f4b71Sopenharmony_ci**Example** 2239e41f4b71Sopenharmony_ci 2240e41f4b71Sopenharmony_ci```ts 2241e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2242e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2243e41f4b71Sopenharmony_ci 2244e41f4b71Sopenharmony_cisim.getIMSI(0, (err: BusinessError, data: string) => { 2245e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2246e41f4b71Sopenharmony_ci}); 2247e41f4b71Sopenharmony_ci``` 2248e41f4b71Sopenharmony_ci 2249e41f4b71Sopenharmony_ci 2250e41f4b71Sopenharmony_ci## sim.getIMSI 2251e41f4b71Sopenharmony_ci 2252e41f4b71Sopenharmony_cigetIMSI\(slotId: number\): Promise\<string\> 2253e41f4b71Sopenharmony_ci 2254e41f4b71Sopenharmony_ciObtains the IMSI of the SIM card in the specified slot. This API uses a promise to return the result. 2255e41f4b71Sopenharmony_ci 2256e41f4b71Sopenharmony_ci**System API**: This is a system API. 2257e41f4b71Sopenharmony_ci 2258e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2259e41f4b71Sopenharmony_ci 2260e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2261e41f4b71Sopenharmony_ci 2262e41f4b71Sopenharmony_ci**Parameters** 2263e41f4b71Sopenharmony_ci 2264e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2265e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2266e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2267e41f4b71Sopenharmony_ci 2268e41f4b71Sopenharmony_ci**Return value** 2269e41f4b71Sopenharmony_ci 2270e41f4b71Sopenharmony_ci| Type | Description | 2271e41f4b71Sopenharmony_ci| ---------------- | ------------------------------------------- | 2272e41f4b71Sopenharmony_ci| Promise<string\> | Promise used to return the result.| 2273e41f4b71Sopenharmony_ci 2274e41f4b71Sopenharmony_ci**Error codes** 2275e41f4b71Sopenharmony_ci 2276e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2277e41f4b71Sopenharmony_ci 2278e41f4b71Sopenharmony_ci| ID| Error Message | 2279e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2280e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2281e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2282e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2283e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2284e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2285e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2286e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2287e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2288e41f4b71Sopenharmony_ci 2289e41f4b71Sopenharmony_ci**Example** 2290e41f4b71Sopenharmony_ci 2291e41f4b71Sopenharmony_ci```ts 2292e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2293e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2294e41f4b71Sopenharmony_ci 2295e41f4b71Sopenharmony_cisim.getIMSI(0).then((data: string) => { 2296e41f4b71Sopenharmony_ci console.log(`getIMSI success, promise: data->${JSON.stringify(data)}`); 2297e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2298e41f4b71Sopenharmony_ci console.error(`getIMSI failed, promise: err->${JSON.stringify(err)}`); 2299e41f4b71Sopenharmony_ci}); 2300e41f4b71Sopenharmony_ci``` 2301e41f4b71Sopenharmony_ci 2302e41f4b71Sopenharmony_ci## sim.getOperatorConfigs<sup>8+</sup> 2303e41f4b71Sopenharmony_ci 2304e41f4b71Sopenharmony_cigetOperatorConfigs\(slotId: number, callback: AsyncCallback\<Array\<OperatorConfig\>\>\): void 2305e41f4b71Sopenharmony_ci 2306e41f4b71Sopenharmony_ciObtains the carrier configuration of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2307e41f4b71Sopenharmony_ci 2308e41f4b71Sopenharmony_ci**System API**: This is a system API. 2309e41f4b71Sopenharmony_ci 2310e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2311e41f4b71Sopenharmony_ci 2312e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2313e41f4b71Sopenharmony_ci 2314e41f4b71Sopenharmony_ci**Parameters** 2315e41f4b71Sopenharmony_ci 2316e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2317e41f4b71Sopenharmony_ci| -------- | --------------------------------------------------------- | ---- | -------------------------------------- | 2318e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2319e41f4b71Sopenharmony_ci| callback | AsyncCallback<Array<[OperatorConfig](#operatorconfig8)\>> | Yes | Callback used to return the result. | 2320e41f4b71Sopenharmony_ci 2321e41f4b71Sopenharmony_ci**Error codes** 2322e41f4b71Sopenharmony_ci 2323e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2324e41f4b71Sopenharmony_ci 2325e41f4b71Sopenharmony_ci| ID| Error Message | 2326e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2327e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2328e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2329e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2330e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2331e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2332e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2333e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2334e41f4b71Sopenharmony_ci 2335e41f4b71Sopenharmony_ci**Example** 2336e41f4b71Sopenharmony_ci 2337e41f4b71Sopenharmony_ci```ts 2338e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2339e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2340e41f4b71Sopenharmony_ci 2341e41f4b71Sopenharmony_cisim.getOperatorConfigs(0, (err: BusinessError, data: Array<sim.OperatorConfig>) => { 2342e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2343e41f4b71Sopenharmony_ci}); 2344e41f4b71Sopenharmony_ci``` 2345e41f4b71Sopenharmony_ci 2346e41f4b71Sopenharmony_ci 2347e41f4b71Sopenharmony_ci## sim.getOperatorConfigs<sup>8+</sup> 2348e41f4b71Sopenharmony_ci 2349e41f4b71Sopenharmony_cigetOperatorConfigs\(slotId: number\): Promise\<Array\<OperatorConfig\>\> 2350e41f4b71Sopenharmony_ci 2351e41f4b71Sopenharmony_ciObtains the carrier configuration of the SIM card in the specified slot. This API uses a promise to return the result. 2352e41f4b71Sopenharmony_ci 2353e41f4b71Sopenharmony_ci**System API**: This is a system API. 2354e41f4b71Sopenharmony_ci 2355e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2356e41f4b71Sopenharmony_ci 2357e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2358e41f4b71Sopenharmony_ci 2359e41f4b71Sopenharmony_ci**Parameters** 2360e41f4b71Sopenharmony_ci 2361e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2362e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2363e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2364e41f4b71Sopenharmony_ci 2365e41f4b71Sopenharmony_ci**Return value** 2366e41f4b71Sopenharmony_ci 2367e41f4b71Sopenharmony_ci| Type | Description | 2368e41f4b71Sopenharmony_ci| --------------------------------------------------- | ----------------------------- | 2369e41f4b71Sopenharmony_ci| Promise<Array<[OperatorConfig](#operatorconfig8)\>> | Promise used to return the result.| 2370e41f4b71Sopenharmony_ci 2371e41f4b71Sopenharmony_ci**Error codes** 2372e41f4b71Sopenharmony_ci 2373e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2374e41f4b71Sopenharmony_ci 2375e41f4b71Sopenharmony_ci| ID| Error Message | 2376e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2377e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2378e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2379e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2380e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2381e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2382e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2383e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2384e41f4b71Sopenharmony_ci 2385e41f4b71Sopenharmony_ci**Example** 2386e41f4b71Sopenharmony_ci 2387e41f4b71Sopenharmony_ci```ts 2388e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2389e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2390e41f4b71Sopenharmony_ci 2391e41f4b71Sopenharmony_cisim.getOperatorConfigs(0).then((data: Array<sim.OperatorConfig>) => { 2392e41f4b71Sopenharmony_ci console.log(`getOperatorConfigs success, promise: data->${JSON.stringify(data)}`); 2393e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2394e41f4b71Sopenharmony_ci console.error(`getOperatorConfigs failed, promise: err->${JSON.stringify(err)}`); 2395e41f4b71Sopenharmony_ci}); 2396e41f4b71Sopenharmony_ci``` 2397e41f4b71Sopenharmony_ci 2398e41f4b71Sopenharmony_ci## sim.queryIccDiallingNumbers<sup>8+</sup> 2399e41f4b71Sopenharmony_ci 2400e41f4b71Sopenharmony_ciqueryIccDiallingNumbers\(slotId: number, type: ContactType, callback: AsyncCallback\<Array\<DiallingNumbersInfo\>\>\): void 2401e41f4b71Sopenharmony_ci 2402e41f4b71Sopenharmony_ciQueries contact numbers of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2403e41f4b71Sopenharmony_ci 2404e41f4b71Sopenharmony_ci>**NOTE** 2405e41f4b71Sopenharmony_ci> 2406e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2407e41f4b71Sopenharmony_ci> 2408e41f4b71Sopenharmony_ci 2409e41f4b71Sopenharmony_ci**System API**: This is a system API. 2410e41f4b71Sopenharmony_ci 2411e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.READ_CONTACTS 2412e41f4b71Sopenharmony_ci 2413e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2414e41f4b71Sopenharmony_ci 2415e41f4b71Sopenharmony_ci**Parameters** 2416e41f4b71Sopenharmony_ci 2417e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2418e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | ---- | ---------------------------------------------------------- | 2419e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2420e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING| 2421e41f4b71Sopenharmony_ci| callback | AsyncCallback<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Yes | Callback used to return the result. | 2422e41f4b71Sopenharmony_ci 2423e41f4b71Sopenharmony_ci**Error codes** 2424e41f4b71Sopenharmony_ci 2425e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2426e41f4b71Sopenharmony_ci 2427e41f4b71Sopenharmony_ci| ID| Error Message | 2428e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2429e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2430e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2431e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2432e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2433e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2434e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2435e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2436e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2437e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2438e41f4b71Sopenharmony_ci 2439e41f4b71Sopenharmony_ci**Example** 2440e41f4b71Sopenharmony_ci 2441e41f4b71Sopenharmony_ci```ts 2442e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2443e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2444e41f4b71Sopenharmony_ci 2445e41f4b71Sopenharmony_cisim.queryIccDiallingNumbers(0, 1, (err: BusinessError, data: Array<sim.DiallingNumbersInfo>) => { 2446e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2447e41f4b71Sopenharmony_ci}); 2448e41f4b71Sopenharmony_ci``` 2449e41f4b71Sopenharmony_ci 2450e41f4b71Sopenharmony_ci 2451e41f4b71Sopenharmony_ci## sim.queryIccDiallingNumbers<sup>8+</sup> 2452e41f4b71Sopenharmony_ci 2453e41f4b71Sopenharmony_ciqueryIccDiallingNumbers\(slotId: number, type: ContactType\): Promise\<Array\<DiallingNumbersInfo\>\> 2454e41f4b71Sopenharmony_ci 2455e41f4b71Sopenharmony_ciQueries contact numbers of the SIM card in the specified slot. This API uses a promise to return the result. 2456e41f4b71Sopenharmony_ci 2457e41f4b71Sopenharmony_ci>**NOTE** 2458e41f4b71Sopenharmony_ci> 2459e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2460e41f4b71Sopenharmony_ci> 2461e41f4b71Sopenharmony_ci 2462e41f4b71Sopenharmony_ci**System API**: This is a system API. 2463e41f4b71Sopenharmony_ci 2464e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.READ_CONTACTS 2465e41f4b71Sopenharmony_ci 2466e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2467e41f4b71Sopenharmony_ci 2468e41f4b71Sopenharmony_ci**Parameters** 2469e41f4b71Sopenharmony_ci 2470e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2471e41f4b71Sopenharmony_ci| ------ | ----------- | ---- | ---------------------------------------------------------- | 2472e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2473e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING| 2474e41f4b71Sopenharmony_ci 2475e41f4b71Sopenharmony_ci**Return value** 2476e41f4b71Sopenharmony_ci 2477e41f4b71Sopenharmony_ci| Type | Description | 2478e41f4b71Sopenharmony_ci| ------------------------------------------------------------ | ------------------------------ | 2479e41f4b71Sopenharmony_ci| Promise<Array<[DiallingNumbersInfo](#diallingnumbersinfo8)\>> | Promise used to return the result.| 2480e41f4b71Sopenharmony_ci 2481e41f4b71Sopenharmony_ci**Error codes** 2482e41f4b71Sopenharmony_ci 2483e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2484e41f4b71Sopenharmony_ci 2485e41f4b71Sopenharmony_ci| ID| Error Message | 2486e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2487e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2488e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2489e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2490e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2491e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2492e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2493e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2494e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2495e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2496e41f4b71Sopenharmony_ci 2497e41f4b71Sopenharmony_ci**Example** 2498e41f4b71Sopenharmony_ci 2499e41f4b71Sopenharmony_ci```ts 2500e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2501e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2502e41f4b71Sopenharmony_ci 2503e41f4b71Sopenharmony_cisim.queryIccDiallingNumbers(0, 1).then((data: Array<sim.DiallingNumbersInfo>) => { 2504e41f4b71Sopenharmony_ci console.log(`queryIccDiallingNumbers success, promise: data->${JSON.stringify(data)}`); 2505e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2506e41f4b71Sopenharmony_ci console.error(`queryIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); 2507e41f4b71Sopenharmony_ci}); 2508e41f4b71Sopenharmony_ci``` 2509e41f4b71Sopenharmony_ci 2510e41f4b71Sopenharmony_ci## sim.addIccDiallingNumbers<sup>8+</sup> 2511e41f4b71Sopenharmony_ci 2512e41f4b71Sopenharmony_ciaddIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback\<void\>\): void 2513e41f4b71Sopenharmony_ci 2514e41f4b71Sopenharmony_ciAdds contact numbers to the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2515e41f4b71Sopenharmony_ci 2516e41f4b71Sopenharmony_ci>**NOTE** 2517e41f4b71Sopenharmony_ci> 2518e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2519e41f4b71Sopenharmony_ci> 2520e41f4b71Sopenharmony_ci 2521e41f4b71Sopenharmony_ci**System API**: This is a system API. 2522e41f4b71Sopenharmony_ci 2523e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2524e41f4b71Sopenharmony_ci 2525e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2526e41f4b71Sopenharmony_ci 2527e41f4b71Sopenharmony_ci**Parameters** 2528e41f4b71Sopenharmony_ci 2529e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2530e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2531e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2532e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2533e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2534e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 2535e41f4b71Sopenharmony_ci 2536e41f4b71Sopenharmony_ci**Error codes** 2537e41f4b71Sopenharmony_ci 2538e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2539e41f4b71Sopenharmony_ci 2540e41f4b71Sopenharmony_ci| ID| Error Message | 2541e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2542e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2543e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2544e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2545e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2546e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2547e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2548e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2549e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2550e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2551e41f4b71Sopenharmony_ci 2552e41f4b71Sopenharmony_ci**Example** 2553e41f4b71Sopenharmony_ci 2554e41f4b71Sopenharmony_ci```ts 2555e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2556e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2557e41f4b71Sopenharmony_ci 2558e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2559e41f4b71Sopenharmony_ci alphaTag: "alpha", 2560e41f4b71Sopenharmony_ci number: "138xxxxxxxx", 2561e41f4b71Sopenharmony_ci pin2: "1234" 2562e41f4b71Sopenharmony_ci}; 2563e41f4b71Sopenharmony_cisim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err: BusinessError) => { 2564e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 2565e41f4b71Sopenharmony_ci}); 2566e41f4b71Sopenharmony_ci``` 2567e41f4b71Sopenharmony_ci 2568e41f4b71Sopenharmony_ci 2569e41f4b71Sopenharmony_ci## sim.addIccDiallingNumbers<sup>8+</sup> 2570e41f4b71Sopenharmony_ci 2571e41f4b71Sopenharmony_ciaddIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo\): Promise\<void\> 2572e41f4b71Sopenharmony_ci 2573e41f4b71Sopenharmony_ciAdds contact numbers to the SIM card in the specified slot. This API uses a promise to return the result. 2574e41f4b71Sopenharmony_ci 2575e41f4b71Sopenharmony_ci>**NOTE** 2576e41f4b71Sopenharmony_ci> 2577e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2578e41f4b71Sopenharmony_ci> 2579e41f4b71Sopenharmony_ci 2580e41f4b71Sopenharmony_ci**System API**: This is a system API. 2581e41f4b71Sopenharmony_ci 2582e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2583e41f4b71Sopenharmony_ci 2584e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2585e41f4b71Sopenharmony_ci 2586e41f4b71Sopenharmony_ci**Parameters** 2587e41f4b71Sopenharmony_ci 2588e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2589e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2590e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2591e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2592e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2593e41f4b71Sopenharmony_ci 2594e41f4b71Sopenharmony_ci**Return value** 2595e41f4b71Sopenharmony_ci 2596e41f4b71Sopenharmony_ci| Type | Description | 2597e41f4b71Sopenharmony_ci| -------------- | --------------------------- | 2598e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 2599e41f4b71Sopenharmony_ci 2600e41f4b71Sopenharmony_ci**Error codes** 2601e41f4b71Sopenharmony_ci 2602e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2603e41f4b71Sopenharmony_ci 2604e41f4b71Sopenharmony_ci| ID| Error Message | 2605e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2606e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2607e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2608e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2609e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2610e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2611e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2612e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2613e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2614e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2615e41f4b71Sopenharmony_ci 2616e41f4b71Sopenharmony_ci**Example** 2617e41f4b71Sopenharmony_ci 2618e41f4b71Sopenharmony_ci```ts 2619e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2620e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2621e41f4b71Sopenharmony_ci 2622e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2623e41f4b71Sopenharmony_ci alphaTag: "alpha", 2624e41f4b71Sopenharmony_ci number: "138xxxxxxxx" 2625e41f4b71Sopenharmony_ci}; 2626e41f4b71Sopenharmony_cisim.addIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof).then(() => { 2627e41f4b71Sopenharmony_ci console.log(`addIccDiallingNumbers success.`); 2628e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2629e41f4b71Sopenharmony_ci console.error(`addIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); 2630e41f4b71Sopenharmony_ci}); 2631e41f4b71Sopenharmony_ci``` 2632e41f4b71Sopenharmony_ci 2633e41f4b71Sopenharmony_ci## sim.delIccDiallingNumbers<sup>8+</sup> 2634e41f4b71Sopenharmony_ci 2635e41f4b71Sopenharmony_cidelIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback\<void\>\): void 2636e41f4b71Sopenharmony_ci 2637e41f4b71Sopenharmony_ciDeletes contact numbers from the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2638e41f4b71Sopenharmony_ci 2639e41f4b71Sopenharmony_ci>**NOTE** 2640e41f4b71Sopenharmony_ci> 2641e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2642e41f4b71Sopenharmony_ci> 2643e41f4b71Sopenharmony_ci 2644e41f4b71Sopenharmony_ci**System API**: This is a system API. 2645e41f4b71Sopenharmony_ci 2646e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2647e41f4b71Sopenharmony_ci 2648e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2649e41f4b71Sopenharmony_ci 2650e41f4b71Sopenharmony_ci**Parameters** 2651e41f4b71Sopenharmony_ci 2652e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2653e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2654e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2655e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2656e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2657e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 2658e41f4b71Sopenharmony_ci 2659e41f4b71Sopenharmony_ci**Error codes** 2660e41f4b71Sopenharmony_ci 2661e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2662e41f4b71Sopenharmony_ci 2663e41f4b71Sopenharmony_ci| ID| Error Message | 2664e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2665e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2666e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2667e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2668e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2669e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2670e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2671e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2672e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2673e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2674e41f4b71Sopenharmony_ci 2675e41f4b71Sopenharmony_ci**Example** 2676e41f4b71Sopenharmony_ci 2677e41f4b71Sopenharmony_ci```ts 2678e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2679e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2680e41f4b71Sopenharmony_ci 2681e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2682e41f4b71Sopenharmony_ci alphaTag: "alpha", 2683e41f4b71Sopenharmony_ci number: "138xxxxxxxx", 2684e41f4b71Sopenharmony_ci recordNumber: 123, 2685e41f4b71Sopenharmony_ci pin2: "1234" 2686e41f4b71Sopenharmony_ci}; 2687e41f4b71Sopenharmony_cisim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err: BusinessError) => { 2688e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 2689e41f4b71Sopenharmony_ci}); 2690e41f4b71Sopenharmony_ci``` 2691e41f4b71Sopenharmony_ci 2692e41f4b71Sopenharmony_ci 2693e41f4b71Sopenharmony_ci## sim.delIccDiallingNumbers<sup>8+</sup> 2694e41f4b71Sopenharmony_ci 2695e41f4b71Sopenharmony_cidelIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo\): Promise\<void\> 2696e41f4b71Sopenharmony_ci 2697e41f4b71Sopenharmony_ciDeletes contact numbers from the SIM card in the specified slot. This API uses a promise to return the result. 2698e41f4b71Sopenharmony_ci 2699e41f4b71Sopenharmony_ci>**NOTE** 2700e41f4b71Sopenharmony_ci> 2701e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2702e41f4b71Sopenharmony_ci> 2703e41f4b71Sopenharmony_ci 2704e41f4b71Sopenharmony_ci**System API**: This is a system API. 2705e41f4b71Sopenharmony_ci 2706e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2707e41f4b71Sopenharmony_ci 2708e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2709e41f4b71Sopenharmony_ci 2710e41f4b71Sopenharmony_ci**Parameters** 2711e41f4b71Sopenharmony_ci 2712e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2713e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2714e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2715e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2716e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2717e41f4b71Sopenharmony_ci 2718e41f4b71Sopenharmony_ci**Return value** 2719e41f4b71Sopenharmony_ci 2720e41f4b71Sopenharmony_ci| Type | Description | 2721e41f4b71Sopenharmony_ci| -------------- | --------------------------- | 2722e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 2723e41f4b71Sopenharmony_ci 2724e41f4b71Sopenharmony_ci**Error codes** 2725e41f4b71Sopenharmony_ci 2726e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2727e41f4b71Sopenharmony_ci 2728e41f4b71Sopenharmony_ci| ID| Error Message | 2729e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2730e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2731e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2732e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2733e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2734e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2735e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2736e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2737e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2738e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2739e41f4b71Sopenharmony_ci 2740e41f4b71Sopenharmony_ci**Example** 2741e41f4b71Sopenharmony_ci 2742e41f4b71Sopenharmony_ci```ts 2743e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2744e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2745e41f4b71Sopenharmony_ci 2746e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2747e41f4b71Sopenharmony_ci alphaTag: "alpha", 2748e41f4b71Sopenharmony_ci number: "138xxxxxxxx" 2749e41f4b71Sopenharmony_ci}; 2750e41f4b71Sopenharmony_cisim.delIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof).then(() => { 2751e41f4b71Sopenharmony_ci console.log(`delIccDiallingNumbers success.`); 2752e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2753e41f4b71Sopenharmony_ci console.error(`delIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); 2754e41f4b71Sopenharmony_ci}); 2755e41f4b71Sopenharmony_ci``` 2756e41f4b71Sopenharmony_ci 2757e41f4b71Sopenharmony_ci## sim.updateIccDiallingNumbers<sup>8+</sup> 2758e41f4b71Sopenharmony_ci 2759e41f4b71Sopenharmony_ciupdateIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback\<void\>\): void 2760e41f4b71Sopenharmony_ci 2761e41f4b71Sopenharmony_ciUpdates contact numbers for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2762e41f4b71Sopenharmony_ci 2763e41f4b71Sopenharmony_ci>**NOTE** 2764e41f4b71Sopenharmony_ci> 2765e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2766e41f4b71Sopenharmony_ci> 2767e41f4b71Sopenharmony_ci 2768e41f4b71Sopenharmony_ci**System API**: This is a system API. 2769e41f4b71Sopenharmony_ci 2770e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2771e41f4b71Sopenharmony_ci 2772e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2773e41f4b71Sopenharmony_ci 2774e41f4b71Sopenharmony_ci**Parameters** 2775e41f4b71Sopenharmony_ci 2776e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2777e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2778e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2779e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2780e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2781e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 2782e41f4b71Sopenharmony_ci 2783e41f4b71Sopenharmony_ci**Error codes** 2784e41f4b71Sopenharmony_ci 2785e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2786e41f4b71Sopenharmony_ci 2787e41f4b71Sopenharmony_ci| ID| Error Message | 2788e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2789e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2790e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2791e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2792e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2793e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2794e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2795e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2796e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2797e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2798e41f4b71Sopenharmony_ci 2799e41f4b71Sopenharmony_ci**Example** 2800e41f4b71Sopenharmony_ci 2801e41f4b71Sopenharmony_ci```ts 2802e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2803e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2804e41f4b71Sopenharmony_ci 2805e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2806e41f4b71Sopenharmony_ci alphaTag: "alpha", 2807e41f4b71Sopenharmony_ci number: "138xxxxxxxx", 2808e41f4b71Sopenharmony_ci recordNumber: 123, 2809e41f4b71Sopenharmony_ci pin2: "1234" 2810e41f4b71Sopenharmony_ci}; 2811e41f4b71Sopenharmony_cisim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof, (err: BusinessError) => { 2812e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 2813e41f4b71Sopenharmony_ci}); 2814e41f4b71Sopenharmony_ci``` 2815e41f4b71Sopenharmony_ci 2816e41f4b71Sopenharmony_ci 2817e41f4b71Sopenharmony_ci## sim.updateIccDiallingNumbers<sup>8+</sup> 2818e41f4b71Sopenharmony_ci 2819e41f4b71Sopenharmony_ciupdateIccDiallingNumbers\(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo\): Promise\<void\> 2820e41f4b71Sopenharmony_ci 2821e41f4b71Sopenharmony_ciUpdates contact numbers for the SIM card in the specified slot. This API uses a promise to return the result. 2822e41f4b71Sopenharmony_ci 2823e41f4b71Sopenharmony_ci>**NOTE** 2824e41f4b71Sopenharmony_ci> 2825e41f4b71Sopenharmony_ci>A cache mechanism is available for SIM card contacts. When a contact is added, deleted, or modified, a SIM card contact cache is maintained based on the corresponding card slot ID and contact type. Therefore, when calling **sim.queryIccDiallingNumbers** to query contact numbers, you must pass the card slot ID and contact type to generate a a SIM card contact cache. If no cache is generated, the attempt to call the **sim.addIccDiallingNumbers**, **sim.delIccDiallingNumbers**, or **sim.updateIccDiallingNumbers** API will fail. 2826e41f4b71Sopenharmony_ci> 2827e41f4b71Sopenharmony_ci 2828e41f4b71Sopenharmony_ci**System API**: This is a system API. 2829e41f4b71Sopenharmony_ci 2830e41f4b71Sopenharmony_ci**Permission required**: ohos.permission.WRITE_CONTACTS 2831e41f4b71Sopenharmony_ci 2832e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2833e41f4b71Sopenharmony_ci 2834e41f4b71Sopenharmony_ci**Parameters** 2835e41f4b71Sopenharmony_ci 2836e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2837e41f4b71Sopenharmony_ci| --------------- | -------------------------------------------- | ---- | ---------------------------------------------------------- | 2838e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 2839e41f4b71Sopenharmony_ci| type | [ContactType](#contacttype8) | Yes | Contact type.<br>- **1**: GENERAL_CONTACT<br>- **2**: FIXED_DIALING | 2840e41f4b71Sopenharmony_ci| diallingNumbers | [DiallingNumbersInfo](#diallingnumbersinfo8) | Yes | Contact number information. | 2841e41f4b71Sopenharmony_ci 2842e41f4b71Sopenharmony_ci**Return value** 2843e41f4b71Sopenharmony_ci 2844e41f4b71Sopenharmony_ci| Type | Description | 2845e41f4b71Sopenharmony_ci| -------------- | ----------------------------- | 2846e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 2847e41f4b71Sopenharmony_ci 2848e41f4b71Sopenharmony_ci**Error codes** 2849e41f4b71Sopenharmony_ci 2850e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2851e41f4b71Sopenharmony_ci 2852e41f4b71Sopenharmony_ci| ID| Error Message | 2853e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2854e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2855e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2856e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2857e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2858e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2859e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2860e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2861e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2862e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 2863e41f4b71Sopenharmony_ci 2864e41f4b71Sopenharmony_ci**Example** 2865e41f4b71Sopenharmony_ci 2866e41f4b71Sopenharmony_ci```ts 2867e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2868e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2869e41f4b71Sopenharmony_ci 2870e41f4b71Sopenharmony_cilet diallingNumbersInof: sim.DiallingNumbersInfo = { 2871e41f4b71Sopenharmony_ci alphaTag: "alpha", 2872e41f4b71Sopenharmony_ci number: "138xxxxxxxx", 2873e41f4b71Sopenharmony_ci recordNumber: 123 2874e41f4b71Sopenharmony_ci}; 2875e41f4b71Sopenharmony_cisim.updateIccDiallingNumbers(0, sim.ContactType.GENERAL_CONTACT, diallingNumbersInof).then(() => { 2876e41f4b71Sopenharmony_ci console.log(`updateIccDiallingNumbers success.`); 2877e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2878e41f4b71Sopenharmony_ci console.error(`updateIccDiallingNumbers failed, promise: err->${JSON.stringify(err)}`); 2879e41f4b71Sopenharmony_ci}); 2880e41f4b71Sopenharmony_ci``` 2881e41f4b71Sopenharmony_ci 2882e41f4b71Sopenharmony_ci## sim.sendEnvelopeCmd<sup>8+</sup> 2883e41f4b71Sopenharmony_ci 2884e41f4b71Sopenharmony_cisendEnvelopeCmd\(slotId: number, cmd: string, callback: AsyncCallback\<void\>\): void 2885e41f4b71Sopenharmony_ci 2886e41f4b71Sopenharmony_ciSends an envelope command to the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2887e41f4b71Sopenharmony_ci 2888e41f4b71Sopenharmony_ci**System API**: This is a system API. 2889e41f4b71Sopenharmony_ci 2890e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2891e41f4b71Sopenharmony_ci 2892e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2893e41f4b71Sopenharmony_ci 2894e41f4b71Sopenharmony_ci**Parameters** 2895e41f4b71Sopenharmony_ci 2896e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2897e41f4b71Sopenharmony_ci| -------- | -------------------- | ---- | -------------------------------------- | 2898e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2899e41f4b71Sopenharmony_ci| cmd | string | Yes | Envelope command. | 2900e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 2901e41f4b71Sopenharmony_ci 2902e41f4b71Sopenharmony_ci**Error codes** 2903e41f4b71Sopenharmony_ci 2904e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2905e41f4b71Sopenharmony_ci 2906e41f4b71Sopenharmony_ci| ID| Error Message | 2907e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2908e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2909e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2910e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2911e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2912e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2913e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2914e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2915e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2916e41f4b71Sopenharmony_ci 2917e41f4b71Sopenharmony_ci**Example** 2918e41f4b71Sopenharmony_ci 2919e41f4b71Sopenharmony_ci```ts 2920e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2921e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2922e41f4b71Sopenharmony_ci 2923e41f4b71Sopenharmony_cisim.sendEnvelopeCmd(0, "ls", (err: BusinessError) => { 2924e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 2925e41f4b71Sopenharmony_ci}); 2926e41f4b71Sopenharmony_ci``` 2927e41f4b71Sopenharmony_ci 2928e41f4b71Sopenharmony_ci 2929e41f4b71Sopenharmony_ci## sim.sendEnvelopeCmd<sup>8+</sup> 2930e41f4b71Sopenharmony_ci 2931e41f4b71Sopenharmony_cisendEnvelopeCmd\(slotId: number, cmd: string\): Promise\<void\> 2932e41f4b71Sopenharmony_ci 2933e41f4b71Sopenharmony_ciSends an envelope command to the SIM card in the specified slot. This API uses a promise to return the result. 2934e41f4b71Sopenharmony_ci 2935e41f4b71Sopenharmony_ci**System API**: This is a system API. 2936e41f4b71Sopenharmony_ci 2937e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2938e41f4b71Sopenharmony_ci 2939e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2940e41f4b71Sopenharmony_ci 2941e41f4b71Sopenharmony_ci**Parameters** 2942e41f4b71Sopenharmony_ci 2943e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 2944e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 2945e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2946e41f4b71Sopenharmony_ci| cmd | string | Yes | Envelope command. | 2947e41f4b71Sopenharmony_ci 2948e41f4b71Sopenharmony_ci**Return value** 2949e41f4b71Sopenharmony_ci 2950e41f4b71Sopenharmony_ci| Type | Description | 2951e41f4b71Sopenharmony_ci| -------------- | --------------------------- | 2952e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 2953e41f4b71Sopenharmony_ci 2954e41f4b71Sopenharmony_ci**Error codes** 2955e41f4b71Sopenharmony_ci 2956e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 2957e41f4b71Sopenharmony_ci 2958e41f4b71Sopenharmony_ci| ID| Error Message | 2959e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 2960e41f4b71Sopenharmony_ci| 201 | Permission denied. | 2961e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 2962e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 2963e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 2964e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 2965e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 2966e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 2967e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 2968e41f4b71Sopenharmony_ci 2969e41f4b71Sopenharmony_ci**Example** 2970e41f4b71Sopenharmony_ci 2971e41f4b71Sopenharmony_ci```ts 2972e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 2973e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 2974e41f4b71Sopenharmony_ci 2975e41f4b71Sopenharmony_cisim.sendEnvelopeCmd(0, "ls").then(() => { 2976e41f4b71Sopenharmony_ci console.log(`sendEnvelopeCmd success.`); 2977e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 2978e41f4b71Sopenharmony_ci console.error(`sendEnvelopeCmd failed, promise: err->${JSON.stringify(err)}`); 2979e41f4b71Sopenharmony_ci}); 2980e41f4b71Sopenharmony_ci``` 2981e41f4b71Sopenharmony_ci 2982e41f4b71Sopenharmony_ci## sim.sendTerminalResponseCmd<sup>8+</sup> 2983e41f4b71Sopenharmony_ci 2984e41f4b71Sopenharmony_cisendTerminalResponseCmd\(slotId: number, cmd: string, callback: AsyncCallback\<void\>\): void 2985e41f4b71Sopenharmony_ci 2986e41f4b71Sopenharmony_ciSends a terminal response command to the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2987e41f4b71Sopenharmony_ci 2988e41f4b71Sopenharmony_ci**System API**: This is a system API. 2989e41f4b71Sopenharmony_ci 2990e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2991e41f4b71Sopenharmony_ci 2992e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 2993e41f4b71Sopenharmony_ci 2994e41f4b71Sopenharmony_ci**Parameters** 2995e41f4b71Sopenharmony_ci 2996e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 2997e41f4b71Sopenharmony_ci| -------- | -------------------- | ---- | -------------------------------------- | 2998e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2999e41f4b71Sopenharmony_ci| cmd | string | Yes | Envelope command. | 3000e41f4b71Sopenharmony_ci| callback | AsyncCallback<void\> | Yes | Callback used to return the result. | 3001e41f4b71Sopenharmony_ci 3002e41f4b71Sopenharmony_ci**Error codes** 3003e41f4b71Sopenharmony_ci 3004e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3005e41f4b71Sopenharmony_ci 3006e41f4b71Sopenharmony_ci| ID| Error Message | 3007e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3008e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3009e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3010e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3011e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 3012e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3013e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3014e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 3015e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3016e41f4b71Sopenharmony_ci 3017e41f4b71Sopenharmony_ci**Example** 3018e41f4b71Sopenharmony_ci 3019e41f4b71Sopenharmony_ci```ts 3020e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3021e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3022e41f4b71Sopenharmony_ci 3023e41f4b71Sopenharmony_cisim.sendTerminalResponseCmd(0, "ls", (err: BusinessError) => { 3024e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}`); 3025e41f4b71Sopenharmony_ci}); 3026e41f4b71Sopenharmony_ci``` 3027e41f4b71Sopenharmony_ci 3028e41f4b71Sopenharmony_ci 3029e41f4b71Sopenharmony_ci## sim.sendTerminalResponseCmd<sup>8+</sup> 3030e41f4b71Sopenharmony_ci 3031e41f4b71Sopenharmony_cisendTerminalResponseCmd\(slotId: number, cmd: string\): Promise\<void\> 3032e41f4b71Sopenharmony_ci 3033e41f4b71Sopenharmony_ciSends a terminal response command to the SIM card in the specified slot. This API uses a promise to return the result. 3034e41f4b71Sopenharmony_ci 3035e41f4b71Sopenharmony_ci**System API**: This is a system API. 3036e41f4b71Sopenharmony_ci 3037e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3038e41f4b71Sopenharmony_ci 3039e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3040e41f4b71Sopenharmony_ci 3041e41f4b71Sopenharmony_ci**Parameters** 3042e41f4b71Sopenharmony_ci 3043e41f4b71Sopenharmony_ci| Name| Type | Mandatory| Description | 3044e41f4b71Sopenharmony_ci| ------ | ------ | ---- | -------------------------------------- | 3045e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3046e41f4b71Sopenharmony_ci| cmd | string | Yes | Envelope command. | 3047e41f4b71Sopenharmony_ci 3048e41f4b71Sopenharmony_ci**Return value** 3049e41f4b71Sopenharmony_ci 3050e41f4b71Sopenharmony_ci| Type | Description | 3051e41f4b71Sopenharmony_ci| -------------- | --------------------------- | 3052e41f4b71Sopenharmony_ci| Promise<void\> | Promise used to return the result.| 3053e41f4b71Sopenharmony_ci 3054e41f4b71Sopenharmony_ci**Error codes** 3055e41f4b71Sopenharmony_ci 3056e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3057e41f4b71Sopenharmony_ci 3058e41f4b71Sopenharmony_ci| ID| Error Message | 3059e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3060e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3061e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3062e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3063e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 3064e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3065e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3066e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 3067e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3068e41f4b71Sopenharmony_ci 3069e41f4b71Sopenharmony_ci**Example** 3070e41f4b71Sopenharmony_ci 3071e41f4b71Sopenharmony_ci```ts 3072e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3073e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3074e41f4b71Sopenharmony_ci 3075e41f4b71Sopenharmony_cisim.sendTerminalResponseCmd(0, "ls").then(() => { 3076e41f4b71Sopenharmony_ci console.log(`sendTerminalResponseCmd success.`); 3077e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 3078e41f4b71Sopenharmony_ci console.error(`sendTerminalResponseCmd failed, promise: err->${JSON.stringify(err)}`); 3079e41f4b71Sopenharmony_ci}); 3080e41f4b71Sopenharmony_ci``` 3081e41f4b71Sopenharmony_ci 3082e41f4b71Sopenharmony_ci 3083e41f4b71Sopenharmony_ci## sim.unlockSimLock<sup>8+</sup> 3084e41f4b71Sopenharmony_ci 3085e41f4b71Sopenharmony_ciunlockSimLock\(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback\<LockStatusResponse\>\): void 3086e41f4b71Sopenharmony_ci 3087e41f4b71Sopenharmony_ciUnlocks the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 3088e41f4b71Sopenharmony_ci 3089e41f4b71Sopenharmony_ci**System API**: This is a system API. 3090e41f4b71Sopenharmony_ci 3091e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3092e41f4b71Sopenharmony_ci 3093e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3094e41f4b71Sopenharmony_ci 3095e41f4b71Sopenharmony_ci**Parameters** 3096e41f4b71Sopenharmony_ci 3097e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3098e41f4b71Sopenharmony_ci| -------- | ---------------------------------------------------------- | ---- | -------------------------------------- | 3099e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3100e41f4b71Sopenharmony_ci| lockInfo | [PersoLockInfo](#persolockinfo8) | Yes | Personalized lock information. | 3101e41f4b71Sopenharmony_ci| callback | AsyncCallback<[LockStatusResponse](#lockstatusresponse7)\> | Yes | Callback used to return the result. | 3102e41f4b71Sopenharmony_ci 3103e41f4b71Sopenharmony_ci**Error codes** 3104e41f4b71Sopenharmony_ci 3105e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3106e41f4b71Sopenharmony_ci 3107e41f4b71Sopenharmony_ci| ID| Error Message | 3108e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3109e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3110e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3111e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3112e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 3113e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3114e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3115e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 3116e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3117e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 3118e41f4b71Sopenharmony_ci 3119e41f4b71Sopenharmony_ci**Example** 3120e41f4b71Sopenharmony_ci 3121e41f4b71Sopenharmony_ci```ts 3122e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3123e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3124e41f4b71Sopenharmony_ci 3125e41f4b71Sopenharmony_cilet persoLockInfo: sim.PersoLockInfo = { 3126e41f4b71Sopenharmony_ci lockType: sim.PersoLockType.PN_PIN_LOCK, 3127e41f4b71Sopenharmony_ci password: "1234" 3128e41f4b71Sopenharmony_ci}; 3129e41f4b71Sopenharmony_cisim.unlockSimLock(0, persoLockInfo, (err: BusinessError, data: sim.LockStatusResponse) => { 3130e41f4b71Sopenharmony_ci console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 3131e41f4b71Sopenharmony_ci}); 3132e41f4b71Sopenharmony_ci``` 3133e41f4b71Sopenharmony_ci 3134e41f4b71Sopenharmony_ci 3135e41f4b71Sopenharmony_ci## sim.unlockSimLock<sup>8+</sup> 3136e41f4b71Sopenharmony_ci 3137e41f4b71Sopenharmony_ciunlockSimLock\(slotId: number, lockInfo: PersoLockInfo\): Promise\<LockStatusResponse\> 3138e41f4b71Sopenharmony_ci 3139e41f4b71Sopenharmony_ciUnlocks the SIM card in the specified slot. This API uses a promise to return the result. 3140e41f4b71Sopenharmony_ci 3141e41f4b71Sopenharmony_ci**System API**: This is a system API. 3142e41f4b71Sopenharmony_ci 3143e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.SET_TELEPHONY_STATE 3144e41f4b71Sopenharmony_ci 3145e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3146e41f4b71Sopenharmony_ci 3147e41f4b71Sopenharmony_ci**Parameters** 3148e41f4b71Sopenharmony_ci 3149e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3150e41f4b71Sopenharmony_ci| -------- | -------------------------------- | ---- | -------------------------------------- | 3151e41f4b71Sopenharmony_ci| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 3152e41f4b71Sopenharmony_ci| lockInfo | [PersoLockInfo](#persolockinfo8) | Yes | Personalized lock information. | 3153e41f4b71Sopenharmony_ci 3154e41f4b71Sopenharmony_ci**Return value** 3155e41f4b71Sopenharmony_ci 3156e41f4b71Sopenharmony_ci| Type | Description | 3157e41f4b71Sopenharmony_ci| ---------------------------------------------------- | ------------------------- | 3158e41f4b71Sopenharmony_ci| Promise<[LockStatusResponse](#lockstatusresponse7)\> | Promise used to return the result.| 3159e41f4b71Sopenharmony_ci 3160e41f4b71Sopenharmony_ci**Error codes** 3161e41f4b71Sopenharmony_ci 3162e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3163e41f4b71Sopenharmony_ci 3164e41f4b71Sopenharmony_ci| ID| Error Message | 3165e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3166e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3167e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3168e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3169e41f4b71Sopenharmony_ci| 8300001 | Invalid parameter value. | 3170e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3171e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3172e41f4b71Sopenharmony_ci| 8300004 | No SIM card found. | 3173e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3174e41f4b71Sopenharmony_ci| 8301002 | The SIM card failed to read or update data. | 3175e41f4b71Sopenharmony_ci 3176e41f4b71Sopenharmony_ci**Example** 3177e41f4b71Sopenharmony_ci 3178e41f4b71Sopenharmony_ci```ts 3179e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3180e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3181e41f4b71Sopenharmony_ci 3182e41f4b71Sopenharmony_cilet persoLockInfo: sim.PersoLockInfo = { 3183e41f4b71Sopenharmony_ci lockType: sim.PersoLockType.PN_PIN_LOCK, 3184e41f4b71Sopenharmony_ci password: "1234" 3185e41f4b71Sopenharmony_ci}; 3186e41f4b71Sopenharmony_cisim.unlockSimLock(0, persoLockInfo).then((data: sim.LockStatusResponse) => { 3187e41f4b71Sopenharmony_ci console.log(`unlockSimLock success, promise: data->${JSON.stringify(data)}`); 3188e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 3189e41f4b71Sopenharmony_ci console.error(`unlockSimLock failed, promise: err->${JSON.stringify(err)}`); 3190e41f4b71Sopenharmony_ci}); 3191e41f4b71Sopenharmony_ci``` 3192e41f4b71Sopenharmony_ci 3193e41f4b71Sopenharmony_ci## sim.getDsdsMode<sup>11+</sup> 3194e41f4b71Sopenharmony_ci 3195e41f4b71Sopenharmony_cigetDsdsMode\(callback: AsyncCallback\<DsdsMode\>\): void 3196e41f4b71Sopenharmony_ci 3197e41f4b71Sopenharmony_ciObtains the Dual Sim Dual Standby (DSDS) mode supported by the device. This API uses an asynchronous callback to return the result. 3198e41f4b71Sopenharmony_ci 3199e41f4b71Sopenharmony_ci**System API**: This is a system API. 3200e41f4b71Sopenharmony_ci 3201e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 3202e41f4b71Sopenharmony_ci 3203e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3204e41f4b71Sopenharmony_ci 3205e41f4b71Sopenharmony_ci**Parameters** 3206e41f4b71Sopenharmony_ci 3207e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3208e41f4b71Sopenharmony_ci| -------- | --------------------------- | ---- | ---------- | 3209e41f4b71Sopenharmony_ci| callback | AsyncCallback<DsdsMode> | Yes | Callback used to return the result, which can be:<br>- **0**: DSDS_MODE_V2<br>- **1**: DSDS_MODE_V3<br>- **2**: DSDS_MODE_V5_TDM<br>- **3**: DSDS_MODE_V5_DSDA| 3210e41f4b71Sopenharmony_ci 3211e41f4b71Sopenharmony_ci**Error codes** 3212e41f4b71Sopenharmony_ci 3213e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3214e41f4b71Sopenharmony_ci 3215e41f4b71Sopenharmony_ci| ID| Error Message | 3216e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3217e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3218e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3219e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3220e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3221e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3222e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3223e41f4b71Sopenharmony_ci 3224e41f4b71Sopenharmony_ci**Example** 3225e41f4b71Sopenharmony_ci 3226e41f4b71Sopenharmony_ci```ts 3227e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3228e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3229e41f4b71Sopenharmony_ci 3230e41f4b71Sopenharmony_cisim.getDsdsMode((err: BusinessError, data: sim.DsdsMode) => { 3231e41f4b71Sopenharmony_ci if (err) { 3232e41f4b71Sopenharmony_ci console.error(`getDsdsMode failed, callback: err->${JSON.stringify(err)}`); 3233e41f4b71Sopenharmony_ci } else { 3234e41f4b71Sopenharmony_ci console.log(`getDsdsMode success, callback: data->${JSON.stringify(data)}`); 3235e41f4b71Sopenharmony_ci } 3236e41f4b71Sopenharmony_ci}); 3237e41f4b71Sopenharmony_ci``` 3238e41f4b71Sopenharmony_ci 3239e41f4b71Sopenharmony_ci## sim.getDsdsMode<sup>11+</sup> 3240e41f4b71Sopenharmony_ci 3241e41f4b71Sopenharmony_cigetDsdsMode\(\): Promise\<DsdsMode\> 3242e41f4b71Sopenharmony_ci 3243e41f4b71Sopenharmony_ciObtains the Dual Sim Dual Standby (DSDS) mode supported by the device. This API uses a promise to return the result. 3244e41f4b71Sopenharmony_ci 3245e41f4b71Sopenharmony_ci**System API**: This is a system API. 3246e41f4b71Sopenharmony_ci 3247e41f4b71Sopenharmony_ci**Required permission**: ohos.permission.GET_TELEPHONY_STATE 3248e41f4b71Sopenharmony_ci 3249e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3250e41f4b71Sopenharmony_ci 3251e41f4b71Sopenharmony_ci**Return value** 3252e41f4b71Sopenharmony_ci 3253e41f4b71Sopenharmony_ci| Type | Description | 3254e41f4b71Sopenharmony_ci| ----------------- | --------------------------------------- | 3255e41f4b71Sopenharmony_ci| Promise\<DsdsMode\> | Promise used to return the result.<br>- **0**: DSDS_MODE_V2<br>- **1**: DSDS_MODE_V3<br>- **2**: DSDS_MODE_V5_TDM<br>- **3**: DSDS_MODE_V5_DSDA| 3256e41f4b71Sopenharmony_ci 3257e41f4b71Sopenharmony_ci**Error codes** 3258e41f4b71Sopenharmony_ci 3259e41f4b71Sopenharmony_ciFor details about the error codes, see[ohos.telephony (Telephony) Error Codes](errorcode-telephony.md). 3260e41f4b71Sopenharmony_ci 3261e41f4b71Sopenharmony_ci| ID| Error Message | 3262e41f4b71Sopenharmony_ci| -------- | -------------------------------------------- | 3263e41f4b71Sopenharmony_ci| 201 | Permission denied. | 3264e41f4b71Sopenharmony_ci| 202 | Non-system applications use system APIs. | 3265e41f4b71Sopenharmony_ci| 401 | Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. 2. Incorrect parameter types. | 3266e41f4b71Sopenharmony_ci| 8300002 | Service connection failed. | 3267e41f4b71Sopenharmony_ci| 8300003 | System internal error. | 3268e41f4b71Sopenharmony_ci| 8300999 | Unknown error. | 3269e41f4b71Sopenharmony_ci 3270e41f4b71Sopenharmony_ci**Example** 3271e41f4b71Sopenharmony_ci 3272e41f4b71Sopenharmony_ci```ts 3273e41f4b71Sopenharmony_ciimport { BusinessError } from '@kit.BasicServicesKit'; 3274e41f4b71Sopenharmony_ciimport { sim } from '@kit.TelephonyKit'; 3275e41f4b71Sopenharmony_ci 3276e41f4b71Sopenharmony_cilet promise = sim.getDsdsMode(); 3277e41f4b71Sopenharmony_cipromise.then((data: sim.DsdsMode) => { 3278e41f4b71Sopenharmony_ci console.log(`getDsdsMode success, promise: data->${JSON.stringify(data)}`); 3279e41f4b71Sopenharmony_ci}).catch((err: BusinessError) => { 3280e41f4b71Sopenharmony_ci console.error(`getDsdsMode failed, promise: err->${JSON.stringify(err)}`); 3281e41f4b71Sopenharmony_ci}); 3282e41f4b71Sopenharmony_ci``` 3283e41f4b71Sopenharmony_ci 3284e41f4b71Sopenharmony_ci## LockType<sup>8+</sup> 3285e41f4b71Sopenharmony_ci 3286e41f4b71Sopenharmony_ciEnumerates lock types. 3287e41f4b71Sopenharmony_ci 3288e41f4b71Sopenharmony_ci**System API**: This is a system API. 3289e41f4b71Sopenharmony_ci 3290e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3291e41f4b71Sopenharmony_ci 3292e41f4b71Sopenharmony_ci| Name | Value | Description | 3293e41f4b71Sopenharmony_ci| -------- | ---- | ----------- | 3294e41f4b71Sopenharmony_ci| PIN_LOCK | 1 | SIM card password lock.| 3295e41f4b71Sopenharmony_ci| FDN_LOCK | 2 | Fixed dialing lock. | 3296e41f4b71Sopenharmony_ci 3297e41f4b71Sopenharmony_ci## LockState<sup>8+</sup> 3298e41f4b71Sopenharmony_ci 3299e41f4b71Sopenharmony_ciEnumerates lock states. 3300e41f4b71Sopenharmony_ci 3301e41f4b71Sopenharmony_ci**System API**: This is a system API. 3302e41f4b71Sopenharmony_ci 3303e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3304e41f4b71Sopenharmony_ci 3305e41f4b71Sopenharmony_ci| Name | Value | Description | 3306e41f4b71Sopenharmony_ci| -------- | ---- | ---------- | 3307e41f4b71Sopenharmony_ci| LOCK_OFF | 0 | The lock is off.| 3308e41f4b71Sopenharmony_ci| LOCK_ON | 1 | The lock is on.| 3309e41f4b71Sopenharmony_ci 3310e41f4b71Sopenharmony_ci## PersoLockType<sup>8+</sup> 3311e41f4b71Sopenharmony_ci 3312e41f4b71Sopenharmony_ciEnumerates personalized lock types. 3313e41f4b71Sopenharmony_ci 3314e41f4b71Sopenharmony_ci**System API**: This is a system API. 3315e41f4b71Sopenharmony_ci 3316e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3317e41f4b71Sopenharmony_ci 3318e41f4b71Sopenharmony_ci| Name | Value | Description | 3319e41f4b71Sopenharmony_ci| ------------ | ---- | ------------------------------------------------ | 3320e41f4b71Sopenharmony_ci| PN_PIN_LOCK | 0 | Personalized network PIN lock. For details, see *3GPP TS 22.022 [33]*. | 3321e41f4b71Sopenharmony_ci| PN_PUK_LOCK | 1 | Personalized network PUK lock. | 3322e41f4b71Sopenharmony_ci| PU_PIN_LOCK | 2 | Personalized network subset PIN lock. For details, see *3GPP TS 22.022 [33]*. | 3323e41f4b71Sopenharmony_ci| PU_PUK_LOCK | 3 | Personalized network subset PUK lock. | 3324e41f4b71Sopenharmony_ci| PP_PIN_LOCK | 4 | Personalized service provider PIN lock. For details, see *3GPP TS 22.022 [33]*. | 3325e41f4b71Sopenharmony_ci| PP_PUK_LOCK | 5 | Personalized service provider PUK lock. | 3326e41f4b71Sopenharmony_ci| PC_PIN_LOCK | 6 | Personalized corporate PIN lock. For details, see *3GPP TS 22.022 [33]*. | 3327e41f4b71Sopenharmony_ci| PC_PUK_LOCK | 7 | Personalized corporate PUK lock. | 3328e41f4b71Sopenharmony_ci| SIM_PIN_LOCK | 8 | Personalized SIM card PIN lock. For details, see *3GPP TS 22.022 [33]*. | 3329e41f4b71Sopenharmony_ci| SIM_PUK_LOCK | 9 | Personalized SIM card PUK lock. | 3330e41f4b71Sopenharmony_ci 3331e41f4b71Sopenharmony_ci## LockStatusResponse<sup>7+</sup> 3332e41f4b71Sopenharmony_ci 3333e41f4b71Sopenharmony_ciDefines the personalized lock information. 3334e41f4b71Sopenharmony_ci 3335e41f4b71Sopenharmony_ci**System API**: This is a system API. 3336e41f4b71Sopenharmony_ci 3337e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3338e41f4b71Sopenharmony_ci 3339e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3340e41f4b71Sopenharmony_ci| --------------- | ------ | ---- | --------------------- | 3341e41f4b71Sopenharmony_ci| result | number | Yes | Operation result. | 3342e41f4b71Sopenharmony_ci| remain | number | No | Remaining attempts (can be null).| 3343e41f4b71Sopenharmony_ci 3344e41f4b71Sopenharmony_ci## LockInfo<sup>8+</sup> 3345e41f4b71Sopenharmony_ci 3346e41f4b71Sopenharmony_ciDefines the personalized lock information. 3347e41f4b71Sopenharmony_ci 3348e41f4b71Sopenharmony_ci**System API**: This is a system API. 3349e41f4b71Sopenharmony_ci 3350e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3351e41f4b71Sopenharmony_ci 3352e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3353e41f4b71Sopenharmony_ci| -------- | ------------------------ | ---- | -------- | 3354e41f4b71Sopenharmony_ci| lockType | [LockType](#locktype8) | Yes | Lock type.| 3355e41f4b71Sopenharmony_ci| password | string | Yes | Password. | 3356e41f4b71Sopenharmony_ci| state | [LockState](#lockstate8) | Yes | Lock state.| 3357e41f4b71Sopenharmony_ci 3358e41f4b71Sopenharmony_ci## PersoLockInfo<sup>8+</sup> 3359e41f4b71Sopenharmony_ci 3360e41f4b71Sopenharmony_ciDefines the personalized lock information. 3361e41f4b71Sopenharmony_ci 3362e41f4b71Sopenharmony_ci**System API**: This is a system API. 3363e41f4b71Sopenharmony_ci 3364e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3365e41f4b71Sopenharmony_ci 3366e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3367e41f4b71Sopenharmony_ci| -------- | -------------------------------- | ---- | ------------- | 3368e41f4b71Sopenharmony_ci| lockType | [PersoLockType](#persolocktype8) | Yes | Personalized lock type.| 3369e41f4b71Sopenharmony_ci| password | string | Yes | Password. | 3370e41f4b71Sopenharmony_ci 3371e41f4b71Sopenharmony_ci 3372e41f4b71Sopenharmony_ci 3373e41f4b71Sopenharmony_ci## OperatorConfig<sup>8+</sup> 3374e41f4b71Sopenharmony_ci 3375e41f4b71Sopenharmony_ciDefines the carrier configuration. 3376e41f4b71Sopenharmony_ci 3377e41f4b71Sopenharmony_ci**System API**: This is a system API. 3378e41f4b71Sopenharmony_ci 3379e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3380e41f4b71Sopenharmony_ci 3381e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description| 3382e41f4b71Sopenharmony_ci| ----- | ------ | ---- | ---- | 3383e41f4b71Sopenharmony_ci| field | string | Yes | Field name.| 3384e41f4b71Sopenharmony_ci| value | string | Yes | Field value. | 3385e41f4b71Sopenharmony_ci 3386e41f4b71Sopenharmony_ci## DiallingNumbersInfo<sup>8+</sup> 3387e41f4b71Sopenharmony_ci 3388e41f4b71Sopenharmony_ciDefines the contact number information. 3389e41f4b71Sopenharmony_ci 3390e41f4b71Sopenharmony_ci**System API**: This is a system API. 3391e41f4b71Sopenharmony_ci 3392e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3393e41f4b71Sopenharmony_ci 3394e41f4b71Sopenharmony_ci| Name | Type | Mandatory| Description | 3395e41f4b71Sopenharmony_ci| ------------ | ------ | ---- | ---------- | 3396e41f4b71Sopenharmony_ci| alphaTag | string | Yes | Tag. | 3397e41f4b71Sopenharmony_ci| number | string | Yes | Call transfer number. | 3398e41f4b71Sopenharmony_ci| recordNumber | number | No | Record number.| 3399e41f4b71Sopenharmony_ci| pin2 | string | No | PIN 2.| 3400e41f4b71Sopenharmony_ci 3401e41f4b71Sopenharmony_ci## ContactType<sup>8+</sup> 3402e41f4b71Sopenharmony_ci 3403e41f4b71Sopenharmony_ciEnumerates contact types. 3404e41f4b71Sopenharmony_ci 3405e41f4b71Sopenharmony_ci**System API**: This is a system API. 3406e41f4b71Sopenharmony_ci 3407e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3408e41f4b71Sopenharmony_ci 3409e41f4b71Sopenharmony_ci| Name | Value | Description | 3410e41f4b71Sopenharmony_ci| --------------- | ---- | ---------- | 3411e41f4b71Sopenharmony_ci| GENERAL_CONTACT | 1 | Common contact number.| 3412e41f4b71Sopenharmony_ci| FIXED_DIALING | 2 | Fixed dialing number. | 3413e41f4b71Sopenharmony_ci 3414e41f4b71Sopenharmony_ci## OperatorConfigKey<sup>9+</sup> 3415e41f4b71Sopenharmony_ci 3416e41f4b71Sopenharmony_ciEnumerates carrier configuration keys. 3417e41f4b71Sopenharmony_ci 3418e41f4b71Sopenharmony_ci**System API**: This is a system API. 3419e41f4b71Sopenharmony_ci 3420e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3421e41f4b71Sopenharmony_ci 3422e41f4b71Sopenharmony_ci| Name | Value | Description | 3423e41f4b71Sopenharmony_ci| ------------------------------------------------------- | ------------------------------------------------------ | -------------------- | 3424e41f4b71Sopenharmony_ci| KEY_VOICE_MAIL_NUMBER_STRING | "voice_mail_number_string" | Voice mailbox number. | 3425e41f4b71Sopenharmony_ci| KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL | "ims_switch_on_by_default_bool" | Fixed dialing number. | 3426e41f4b71Sopenharmony_ci| KEY_HIDE_IMS_SWITCH_BOOL | "hide_ims_switch_bool" | Whether to hide the IMS switch. | 3427e41f4b71Sopenharmony_ci| KEY_VOLTE_SUPPORTED_BOOL | "volte_supported_bool" | Whether to support VoLTE. | 3428e41f4b71Sopenharmony_ci| KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY | "nr_mode_supported_list_int_array" | List of supported NR modes. | 3429e41f4b71Sopenharmony_ci| KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL | "volte_provisioning_supported_bool" | Whether to support VoLTE provisioning. | 3430e41f4b71Sopenharmony_ci| KEY_SS_OVER_UT_SUPPORTED_BOOL | "ss_over_ut_supported_bool" | Whether SS over UT is supported. | 3431e41f4b71Sopenharmony_ci| KEY_IMS_GBA_REQUIRED_BOOL | "ims_gba_required_bool" | Whether GBA is required for IMS. | 3432e41f4b71Sopenharmony_ci| KEY_UT_PROVISIONING_SUPPORTED_BOOL | "ut_provisioning_supported_bool" | Whether to support UT provisioning. | 3433e41f4b71Sopenharmony_ci| KEY_IMS_PREFER_FOR_EMERGENCY_BOOL | "ims_prefer_for_emergency_bool" | IMS preferences for emergency. | 3434e41f4b71Sopenharmony_ci| KEY_CALL_WAITING_SERVICE_CLASS_INT | "call_waiting_service_class_int" | Call waiting service. | 3435e41f4b71Sopenharmony_ci| KEY_CALL_TRANSFER_VISIBILITY_BOOL | "call_transfer_visibility_bool" | Call transfer visibility. | 3436e41f4b71Sopenharmony_ci| KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY| "ims_call_disconnect_reason_info_mapping_string_array" | List of IMS call disconnection reasons.| 3437e41f4b71Sopenharmony_ci| KEY_FORCE_VOLTE_SWITCH_ON_BOOL | "force_volte_switch_on_bool" | Whether to forcibly turn on VoLTE. | 3438e41f4b71Sopenharmony_ci| KEY_ENABLE_OPERATOR_NAME_CUST_BOOL | "enable_operator_name_cust_bool" | Whether to display the carrier name.| 3439e41f4b71Sopenharmony_ci| KEY_OPERATOR_NAME_CUST_STRING | "operator_name_cust_string" | Carrier name. | 3440e41f4b71Sopenharmony_ci| KEY_SPN_DISPLAY_CONDITION_CUST_INT | "spn_display_condition_cust_int" | SPN display rule. | 3441e41f4b71Sopenharmony_ci| KEY_PNN_CUST_STRING_ARRAY | "pnn_cust_string_array" | PLMN name | 3442e41f4b71Sopenharmony_ci| KEY_OPL_CUST_STRING_ARRAY | "opl_cust_string_array" | PLMN information of the carrier. | 3443e41f4b71Sopenharmony_ci| KEY_EMERGENCY_CALL_STRING_ARRAY | "emergency_call_string_array" | Emergency call list. | 3444e41f4b71Sopenharmony_ci 3445e41f4b71Sopenharmony_ci## DsdsMode<sup>11+</sup> 3446e41f4b71Sopenharmony_ci 3447e41f4b71Sopenharmony_ciEnumerates DSDS modes supported by the device. 3448e41f4b71Sopenharmony_ci 3449e41f4b71Sopenharmony_ci**System API**: This is a system API. 3450e41f4b71Sopenharmony_ci 3451e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3452e41f4b71Sopenharmony_ci 3453e41f4b71Sopenharmony_ci| Name | Value | Description | 3454e41f4b71Sopenharmony_ci| -------------------| ---- | -------------------------- | 3455e41f4b71Sopenharmony_ci| DSDS_MODE_V2 | 0 | DSDS 2.0 mode. | 3456e41f4b71Sopenharmony_ci| DSDS_MODE_V3 | 1 | DSDS 3.0 mode. | 3457e41f4b71Sopenharmony_ci| DSDS_MODE_V5_TDM | 2 | DSDS 5.0 TDM mode. | 3458e41f4b71Sopenharmony_ci| DSDS_MODE_V5_DSDA | 3 | DSDS 5.0 DSDA mode.| 3459e41f4b71Sopenharmony_ci 3460e41f4b71Sopenharmony_ci## OperatorSimCard<sup>11+</sup> 3461e41f4b71Sopenharmony_ci 3462e41f4b71Sopenharmony_ciCarrier name. 3463e41f4b71Sopenharmony_ci 3464e41f4b71Sopenharmony_ci**System API**: This is a system API. 3465e41f4b71Sopenharmony_ci 3466e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Telephony.CoreService 3467e41f4b71Sopenharmony_ci 3468e41f4b71Sopenharmony_ci| Name | Value | Description | 3469e41f4b71Sopenharmony_ci| ------------------ | --------------------- | -------- | 3470e41f4b71Sopenharmony_ci| CHINA_TELECOM_CARD | "china_telecom_card" | SIM card of China Telecom.| 3471