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