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 * Defines the carrier configuration. 2222 * 2223 * @interface OperatorConfig 2224 * @syscap SystemCapability.Telephony.CoreService 2225 * @systemapi Hide this for inner system use. 2226 * @since 8 2227 */ 2228 export interface OperatorConfig { 2229 /** 2230 * Indicates the field. 2231 * 2232 * @type { string } 2233 * @syscap SystemCapability.Telephony.CoreService 2234 * @systemapi Hide this for inner system use. 2235 * @since 8 2236 */ 2237 field: string; 2238 2239 /** 2240 * Indicates the value. 2241 * 2242 * @type { string } 2243 * @syscap SystemCapability.Telephony.CoreService 2244 * @systemapi Hide this for inner system use. 2245 * @since 8 2246 */ 2247 value: string; 2248 } 2249 2250 /** 2251 * Defines the ICC account information. 2252 * 2253 * @interface IccAccountInfo 2254 * @syscap SystemCapability.Telephony.CoreService 2255 * @since 10 2256 */ 2257 export interface IccAccountInfo { 2258 /** 2259 * Indicates the sim Id for card. 2260 * 2261 * @type { number } 2262 * @syscap SystemCapability.Telephony.CoreService 2263 * @since 10 2264 */ 2265 simId: number; 2266 2267 /** 2268 * Indicates the card slot index number, 2269 * ranging from 0 to the maximum card slot index number supported by the device. 2270 * 2271 * @type { number } 2272 * @syscap SystemCapability.Telephony.CoreService 2273 * @since 10 2274 */ 2275 slotIndex: number; 2276 2277 /** 2278 * Indicates the mark card is eSim or not. 2279 * 2280 * @type { boolean } 2281 * @syscap SystemCapability.Telephony.CoreService 2282 * @since 10 2283 */ 2284 isEsim: boolean; 2285 2286 /** 2287 * Indicates the active status for card. 2288 * 2289 * @type { boolean } 2290 * @syscap SystemCapability.Telephony.CoreService 2291 * @since 10 2292 */ 2293 isActive: boolean; 2294 2295 /** 2296 * Indicates the iccId for card. 2297 * 2298 * @type { string } 2299 * @syscap SystemCapability.Telephony.CoreService 2300 * @since 10 2301 */ 2302 iccId: string; 2303 2304 /** 2305 * Indicates the display name for card. 2306 * 2307 * @type { string } 2308 * @syscap SystemCapability.Telephony.CoreService 2309 * @since 10 2310 */ 2311 showName: string; 2312 2313 /** 2314 * Indicates the display number for card. 2315 * 2316 * @type { string } 2317 * @syscap SystemCapability.Telephony.CoreService 2318 * @since 10 2319 */ 2320 showNumber: string; 2321 } 2322 2323/** 2324 * Get the list of all SIM card account information. 2325 * 2326 * @permission ohos.permission.GET_TELEPHONY_STATE 2327 * @param { AsyncCallback<Array<IccAccountInfo>> } callback - The callback is used to 2328 * return the array of {@link IccAccountInfo}. The ICCID and phone number will be null 2329 * if has no ohos.permission.GET_TELEPHONY_STATE. 2330 * @throws { BusinessError } 201 - Permission denied. 2331 * @throws { BusinessError } 202 - Non-system applications use system APIs. 2332 * @throws { BusinessError } 8300001 - Invalid parameter value. 2333 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 2334 * @throws { BusinessError } 8300003 - System internal error. 2335 * @throws { BusinessError } 8300004 - Do not have sim card. 2336 * @throws { BusinessError } 8300999 - Unknown error code. 2337 * @syscap SystemCapability.Telephony.CoreService 2338 * @systemapi Hide this for inner system use. 2339 * @since 20 2340 * @arkts 1.1&1.2 2341 */ 2342 function getAllSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo>>): void; 2343 2344 /** 2345 * Get the list of all SIM card account information. 2346 * 2347 * @permission ohos.permission.GET_TELEPHONY_STATE 2348 * @returns { Promise<Array<IccAccountInfo>> } Returns the array of {@link IccAccountInfo}. The ICCID 2349 * and phone number will be null if has no ohos.permission.GET_TELEPHONY_STATE. 2350 * @throws { BusinessError } 201 - Permission denied. 2351 * @throws { BusinessError } 202 - Non-system applications use system APIs. 2352 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 2353 * @throws { BusinessError } 8300003 - System internal error. 2354 * @throws { BusinessError } 8300004 - Do not have sim card. 2355 * @throws { BusinessError } 8300999 - Unknown error code. 2356 * @syscap SystemCapability.Telephony.CoreService 2357 * @systemapi Hide this for inner system use. 2358 * @since 20 2359 * @arkts 1.1&1.2 2360 */ 2361 function getAllSimAccountInfoList(): Promise<Array<IccAccountInfo>>; 2362 2363 /** 2364 * Get SIM card label name. 2365 * 2366 * @param { number } slotId - Indicates the card slot index number, 2367 * ranging from {@code 0} to the maximum card slot index number supported by the device. 2368 * @param { AsyncCallback<SimLabel> } callback - Indicates the callback for getting the SIM card label: 2369 * @throws { BusinessError } 8300001 - Invalid parameter value. 2370 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 2371 * @throws { BusinessError } 8300003 - System internal error. 2372 * @throws { BusinessError } 8300999 - Unknown error code. 2373 * @syscap SystemCapability.Telephony.CoreService 2374 * @since 20 2375 * @arkts 1.1&1.2 2376 */ 2377 function getSimLabel(slotId: number, callback: AsyncCallback<SimLabel>): void; 2378 2379 /** 2380 * Get SIM card label name. 2381 * 2382 * @param { number } slotId - Indicates the card slot index number, 2383 * ranging from {@code 0} to the maximum card slot index number supported by the device. 2384 * @returns { Promise<SimLabel> } Returns the SIM card label: 2385 * @throws { BusinessError } 8300001 - Invalid parameter value. 2386 * @throws { BusinessError } 8300002 - Operation failed. Cannot connect to service. 2387 * @throws { BusinessError } 8300003 - System internal error. 2388 * @throws { BusinessError } 8300999 - Unknown error code. 2389 * @syscap SystemCapability.Telephony.CoreService 2390 * @since 20 2391 * @arkts 1.1&1.2 2392 */ 2393 function getSimLabel(slotId: number): Promise<SimLabel>; 2394 2395 /** 2396 * Get SIM card label name. 2397 * 2398 * @param { number } slotId - Indicates the card slot index number, 2399 * ranging from 0 to the maximum card slots supported by the device. 2400 * @returns { SimLabel } Returns the SIM card label: 2401 * @syscap SystemCapability.Telephony.CoreService 2402 * @since 20 2403 * @arkts 1.1&1.2 2404 */ 2405 function getSimLabelSync(slotId: number): SimLabel; 2406 2407 /** 2408 * Indicates the SIM card type. 2409 * 2410 * @enum { number } 2411 * @syscap SystemCapability.Telephony.CoreService 2412 * @since 20 2413 * @arkts 1.1&1.2 2414 */ 2415 export enum SimType { 2416 /** 2417 * Indicates psim type. 2418 * 2419 * @syscap SystemCapability.Telephony.CoreService 2420 * @since 20 2421 * @arkts 1.1&1.2 2422 */ 2423 PSIM = 0, 2424 2425 /** 2426 * Indicates esim type. 2427 * 2428 * @syscap SystemCapability.Telephony.CoreService 2429 * @since 20 2430 * @arkts 1.1&1.2 2431 */ 2432 ESIM = 1 2433 } 2434 2435 /** 2436 * Defines the sim card label information. 2437 * 2438 * @interface SimLabel 2439 * @syscap SystemCapability.Telephony.CoreService 2440 * @since 20 2441 * @arkts 1.1&1.2 2442 */ 2443 export interface SimLabel { 2444 /** 2445 * Indicates the sim type. 2446 * 2447 * @type { SimType } 2448 * @syscap SystemCapability.Telephony.CoreService 2449 * @since 20 2450 * @arkts 1.1&1.2 2451 */ 2452 simType: SimType; 2453 2454 /** 2455 * Indicates the card index. 2456 * 2457 * @type { number } 2458 * @syscap SystemCapability.Telephony.CoreService 2459 * @since 20 2460 * @arkts 1.1&1.2 2461 */ 2462 index: number; 2463 } 2464 2465 /** 2466 * Defines the personalized lock information. 2467 * 2468 * @interface LockStatusResponse 2469 * @syscap SystemCapability.Telephony.CoreService 2470 * @systemapi Hide this for inner system use. 2471 * @since 7 2472 */ 2473 export interface LockStatusResponse { 2474 /** 2475 * Indicates the current operation result. 2476 * 2477 * @type { number } 2478 * @syscap SystemCapability.Telephony.CoreService 2479 * @systemapi Hide this for inner system use. 2480 * @since 7 2481 */ 2482 result: number; 2483 2484 /** 2485 * Indicates the operations remaining. 2486 * 2487 * @type { ?number } 2488 * @syscap SystemCapability.Telephony.CoreService 2489 * @systemapi Hide this for inner system use. 2490 * @since 7 2491 */ 2492 remain?: number; 2493 } 2494 2495 /** 2496 * Defines the contact number information. 2497 * 2498 * @interface DiallingNumbersInfo 2499 * @syscap SystemCapability.Telephony.CoreService 2500 * @systemapi Hide this for inner system use. 2501 * @since 8 2502 */ 2503 export interface DiallingNumbersInfo { 2504 /** 2505 * Indicates the tag. 2506 * 2507 * @type { string } 2508 * @syscap SystemCapability.Telephony.CoreService 2509 * @systemapi Hide this for inner system use. 2510 * @since 8 2511 */ 2512 alphaTag: string; 2513 2514 /** 2515 * Indicates the call transfer number. 2516 * 2517 * @type { string } 2518 * @syscap SystemCapability.Telephony.CoreService 2519 * @systemapi Hide this for inner system use. 2520 * @since 8 2521 */ 2522 number: string; 2523 2524 /** 2525 * Indicates the record number. 2526 * 2527 * @type { ?number } 2528 * @syscap SystemCapability.Telephony.CoreService 2529 * @systemapi Hide this for inner system use. 2530 * @since 8 2531 */ 2532 recordNumber?: number; 2533 2534 /** 2535 * Indicates the PIN 2. 2536 * 2537 * @type { ?string } 2538 * @syscap SystemCapability.Telephony.CoreService 2539 * @systemapi Hide this for inner system use. 2540 * @since 8 2541 */ 2542 pin2?: string; 2543 } 2544 2545 /** 2546 * Defines the personalized lock information. 2547 * 2548 * @interface LockInfo 2549 * @syscap SystemCapability.Telephony.CoreService 2550 * @systemapi Hide this for inner system use. 2551 * @since 8 2552 */ 2553 export interface LockInfo { 2554 /** 2555 * Indicates the lock type. 2556 * 2557 * @type { LockType } 2558 * @syscap SystemCapability.Telephony.CoreService 2559 * @systemapi Hide this for inner system use. 2560 * @since 8 2561 */ 2562 lockType: LockType; 2563 2564 /** 2565 * Indicates the password. 2566 * 2567 * @type { string } 2568 * @syscap SystemCapability.Telephony.CoreService 2569 * @systemapi Hide this for inner system use. 2570 * @since 8 2571 */ 2572 password: string; 2573 2574 /** 2575 * Indicates the lock state. 2576 * 2577 * @type { LockState } 2578 * @syscap SystemCapability.Telephony.CoreService 2579 * @systemapi Hide this for inner system use. 2580 * @since 8 2581 */ 2582 state: LockState; 2583 } 2584 2585 /** 2586 * Defines the personalized lock information. 2587 * 2588 * @interface PersoLockInfo 2589 * @syscap SystemCapability.Telephony.CoreService 2590 * @systemapi Hide this for inner system use. 2591 * @since 8 2592 */ 2593 export interface PersoLockInfo { 2594 /** 2595 * Indicates the personalized lock type. 2596 * 2597 * @type { PersoLockType } 2598 * @syscap SystemCapability.Telephony.CoreService 2599 * @systemapi Hide this for inner system use. 2600 * @since 8 2601 */ 2602 lockType: PersoLockType; 2603 2604 /** 2605 * Indicates the password. 2606 * 2607 * @type { string } 2608 * @syscap SystemCapability.Telephony.CoreService 2609 * @systemapi Hide this for inner system use. 2610 * @since 8 2611 */ 2612 password: string; 2613 } 2614 2615 /** 2616 * Indicates the lock types. 2617 * 2618 * @enum { number } 2619 * @syscap SystemCapability.Telephony.CoreService 2620 * @systemapi Hide this for inner system use. 2621 * @since 8 2622 */ 2623 export enum LockType { 2624 /** 2625 * Indicates the SIM card password lock. 2626 * 2627 * @syscap SystemCapability.Telephony.CoreService 2628 * @systemapi Hide this for inner system use. 2629 * @since 8 2630 */ 2631 PIN_LOCK = 1, 2632 2633 /** 2634 * Indicates the fixed dialing lock. 2635 * 2636 * @syscap SystemCapability.Telephony.CoreService 2637 * @systemapi Hide this for inner system use. 2638 * @since 8 2639 */ 2640 FDN_LOCK = 2, 2641 } 2642 2643 /** 2644 * Indicates the SIM card types. 2645 * 2646 * @enum { number } 2647 * @syscap SystemCapability.Telephony.CoreService 2648 * @since 7 2649 */ 2650 export enum CardType { 2651 /** 2652 * Icc card type: unknown type Card. 2653 * 2654 * @syscap SystemCapability.Telephony.CoreService 2655 * @since 7 2656 */ 2657 UNKNOWN_CARD = -1, 2658 2659 /** 2660 * Icc card type: Single sim card type. 2661 * 2662 * @syscap SystemCapability.Telephony.CoreService 2663 * @since 7 2664 */ 2665 SINGLE_MODE_SIM_CARD = 10, 2666 2667 /** 2668 * Icc card type: Single usim card type. 2669 * 2670 * @syscap SystemCapability.Telephony.CoreService 2671 * @since 7 2672 */ 2673 SINGLE_MODE_USIM_CARD = 20, 2674 2675 /** 2676 * Icc card type: Single ruim card type. 2677 * 2678 * @syscap SystemCapability.Telephony.CoreService 2679 * @since 7 2680 */ 2681 SINGLE_MODE_RUIM_CARD = 30, 2682 2683 /** 2684 * Icc card type: Double card C+G. 2685 * 2686 * @syscap SystemCapability.Telephony.CoreService 2687 * @since 7 2688 */ 2689 DUAL_MODE_CG_CARD = 40, 2690 2691 /** 2692 * Icc card type: China Telecom Internal Roaming Card (Dual Mode). 2693 * 2694 * @syscap SystemCapability.Telephony.CoreService 2695 * @since 7 2696 */ 2697 CT_NATIONAL_ROAMING_CARD = 41, 2698 2699 /** 2700 * Icc card type: China Unicom Dual Mode Card. 2701 * 2702 * @syscap SystemCapability.Telephony.CoreService 2703 * @since 7 2704 */ 2705 CU_DUAL_MODE_CARD = 42, 2706 2707 /** 2708 * Icc card type: China Telecom LTE Card (Dual Mode). 2709 * 2710 * @syscap SystemCapability.Telephony.CoreService 2711 * @since 7 2712 */ 2713 DUAL_MODE_TELECOM_LTE_CARD = 43, 2714 2715 /** 2716 * Icc card type: Double card U+G. 2717 * 2718 * @syscap SystemCapability.Telephony.CoreService 2719 * @since 7 2720 */ 2721 DUAL_MODE_UG_CARD = 50, 2722 2723 /** 2724 * Icc card type: Single isim card type. 2725 * @syscap SystemCapability.Telephony.CoreService 2726 * @since 8 2727 */ 2728 SINGLE_MODE_ISIM_CARD = 60 2729 } 2730 2731 /** 2732 * Indicates the SIM card states. 2733 * 2734 * @enum { number } 2735 * @syscap SystemCapability.Telephony.CoreService 2736 * @since 6 2737 */ 2738 export enum SimState { 2739 /** 2740 * Indicates unknown SIM card state, that is, the accurate status cannot be 2741 * obtained. 2742 * 2743 * @syscap SystemCapability.Telephony.CoreService 2744 * @since 6 2745 */ 2746 SIM_STATE_UNKNOWN, 2747 2748 /** 2749 * Indicates that the SIM card is in the <b>not present</b> state, that is, 2750 * no SIM card is inserted into the card slot. 2751 * 2752 * @syscap SystemCapability.Telephony.CoreService 2753 * @since 6 2754 */ 2755 SIM_STATE_NOT_PRESENT, 2756 2757 /** 2758 * Indicates that the SIM card is in the <b>locked</b> state, that is, the 2759 * SIM card is locked by the personal identification number (PIN)/PIN 2760 * unblocking key (PUK) or network. 2761 * 2762 * @syscap SystemCapability.Telephony.CoreService 2763 * @since 6 2764 */ 2765 SIM_STATE_LOCKED, 2766 2767 /** 2768 * Indicates that the SIM card is in the <b>not ready</b> state, that is, 2769 * the SIM card is in position but cannot work properly. 2770 * 2771 * @syscap SystemCapability.Telephony.CoreService 2772 * @since 6 2773 */ 2774 SIM_STATE_NOT_READY, 2775 2776 /** 2777 * Indicates that the SIM card is in the <b>ready</b> state, that is, the 2778 * SIM card is in position and is working properly. 2779 * 2780 * @syscap SystemCapability.Telephony.CoreService 2781 * @since 6 2782 */ 2783 SIM_STATE_READY, 2784 2785 /** 2786 * Indicates that the SIM card is in the <b>loaded</b> state, that is, the 2787 * SIM card is in position and is working properly. 2788 * 2789 * @syscap SystemCapability.Telephony.CoreService 2790 * @since 6 2791 */ 2792 SIM_STATE_LOADED 2793 } 2794 2795 /** 2796 * Indicates the lock states. 2797 * 2798 * @enum { number } 2799 * @syscap SystemCapability.Telephony.CoreService 2800 * @systemapi Hide this for inner system use. 2801 * @since 8 2802 */ 2803 export enum LockState { 2804 /** 2805 * Indicates that the lock state card is in the <b>off</b> state. 2806 * 2807 * @syscap SystemCapability.Telephony.CoreService 2808 * @systemapi Hide this for inner system use. 2809 * @since 8 2810 */ 2811 LOCK_OFF = 0, 2812 2813 /** 2814 * Indicates that the lock state card is in the <b>on</b> state. 2815 * 2816 * @syscap SystemCapability.Telephony.CoreService 2817 * @systemapi Hide this for inner system use. 2818 * @since 8 2819 */ 2820 LOCK_ON = 1, 2821 } 2822 2823 /** 2824 * Indicates the contact types. 2825 * 2826 * @enum { number } 2827 * @syscap SystemCapability.Telephony.CoreService 2828 * @systemapi Hide this for inner system use. 2829 * @since 8 2830 */ 2831 export enum ContactType { 2832 /** 2833 * Indicates the common contact number. 2834 * 2835 * @syscap SystemCapability.Telephony.CoreService 2836 * @systemapi Hide this for inner system use. 2837 * @since 8 2838 */ 2839 GENERAL_CONTACT = 1, 2840 2841 /** 2842 * Indicates the fixed dialing number. 2843 * 2844 * @syscap SystemCapability.Telephony.CoreService 2845 * @systemapi Hide this for inner system use. 2846 * @since 8 2847 */ 2848 FIXED_DIALING = 2, 2849 } 2850 2851 /** 2852 * Indicates the personalized lock types. 2853 * 2854 * @enum { number } 2855 * @syscap SystemCapability.Telephony.CoreService 2856 * @systemapi Hide this for inner system use. 2857 * @since 8 2858 */ 2859 export enum PersoLockType { 2860 /** 2861 * Indicates network personalization of PIN lock(refer 3GPP TS 22.022 [33]). 2862 * 2863 * @syscap SystemCapability.Telephony.CoreService 2864 * @systemapi Hide this for inner system use. 2865 * @since 8 2866 */ 2867 PN_PIN_LOCK, 2868 2869 /** 2870 * Indicates network personalization of PUK lock(refer 3GPP TS 22.022 [33]). 2871 * 2872 * @syscap SystemCapability.Telephony.CoreService 2873 * @systemapi Hide this for inner system use. 2874 * @since 8 2875 */ 2876 PN_PUK_LOCK, 2877 2878 /** 2879 * Indicates network subset personalization of PIN lock(refer 3GPP TS 22.022 [33]). 2880 * 2881 * @syscap SystemCapability.Telephony.CoreService 2882 * @systemapi Hide this for inner system use. 2883 * @since 8 2884 */ 2885 PU_PIN_LOCK, 2886 2887 /** 2888 * Indicates network subset personalization of PUK lock(refer 3GPP TS 22.022 [33]). 2889 * 2890 * @syscap SystemCapability.Telephony.CoreService 2891 * @systemapi Hide this for inner system use. 2892 * @since 8 2893 */ 2894 PU_PUK_LOCK, 2895 2896 /** 2897 * Indicates service provider personalization of PIN lock(refer 3GPP TS 22.022 [33]). 2898 * 2899 * @syscap SystemCapability.Telephony.CoreService 2900 * @systemapi Hide this for inner system use. 2901 * @since 8 2902 */ 2903 PP_PIN_LOCK, 2904 2905 /** 2906 * Indicates service provider personalization of PUK lock(refer 3GPP TS 22.022 [33]). 2907 * 2908 * @syscap SystemCapability.Telephony.CoreService 2909 * @systemapi Hide this for inner system use. 2910 * @since 8 2911 */ 2912 PP_PUK_LOCK, 2913 2914 /** 2915 * Indicates corporate personalization of PIN lock(refer 3GPP TS 22.022 [33]). 2916 * 2917 * @syscap SystemCapability.Telephony.CoreService 2918 * @systemapi Hide this for inner system use. 2919 * @since 8 2920 */ 2921 PC_PIN_LOCK, 2922 2923 /** 2924 * Indicates corporate personalization of PUK lock(refer 3GPP TS 22.022 [33]). 2925 * 2926 * @syscap SystemCapability.Telephony.CoreService 2927 * @systemapi Hide this for inner system use. 2928 * @since 8 2929 */ 2930 PC_PUK_LOCK, 2931 2932 /** 2933 * Indicates SIM/USIM personalization of PIN lock(refer 3GPP TS 22.022 [33]). 2934 * 2935 * @syscap SystemCapability.Telephony.CoreService 2936 * @systemapi Hide this for inner system use. 2937 * @since 8 2938 */ 2939 SIM_PIN_LOCK, 2940 2941 /** 2942 * Indicates SIM/USIM personalization of PUK lock(refer 3GPP TS 22.022 [33]). 2943 * 2944 * @syscap SystemCapability.Telephony.CoreService 2945 * @systemapi Hide this for inner system use. 2946 * @since 8 2947 */ 2948 SIM_PUK_LOCK, 2949 } 2950 2951 /** 2952 * Indicates the carrier configuration keys. 2953 * 2954 * @enum { string } 2955 * @syscap SystemCapability.Telephony.CoreService 2956 * @systemapi Hide this for inner system use. 2957 * @since 9 2958 */ 2959 export enum OperatorConfigKey { 2960 /** 2961 * Indicates the voice mail number. 2962 * 2963 * @syscap SystemCapability.Telephony.CoreService 2964 * @systemapi Hide this for inner system use. 2965 * @since 9 2966 */ 2967 KEY_VOICE_MAIL_NUMBER_STRING = 'voice_mail_number_string', 2968 2969 /** 2970 * Indicates the status of ims switch. 2971 * 2972 * @syscap SystemCapability.Telephony.CoreService 2973 * @systemapi Hide this for inner system use. 2974 * @since 9 2975 */ 2976 KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL = 'ims_switch_on_by_default_bool', 2977 2978 /** 2979 * Indicates whether the ims switch status is hidden. 2980 * 2981 * @syscap SystemCapability.Telephony.CoreService 2982 * @systemapi Hide this for inner system use. 2983 * @since 9 2984 */ 2985 KEY_HIDE_IMS_SWITCH_BOOL = 'hide_ims_switch_bool', 2986 2987 /** 2988 * Indicates whether volte mode is supported. 2989 * 2990 * @syscap SystemCapability.Telephony.CoreService 2991 * @systemapi Hide this for inner system use. 2992 * @since 9 2993 */ 2994 KEY_VOLTE_SUPPORTED_BOOL = 'volte_supported_bool', 2995 2996 /** 2997 * Indicates the list supported by nr mode. 2998 * 2999 * @syscap SystemCapability.Telephony.CoreService 3000 * @systemapi Hide this for inner system use. 3001 * @since 9 3002 */ 3003 KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY = 'nr_mode_supported_list_int_array', 3004 3005 /** 3006 * Indicates whether VOLTE supports configuration. 3007 * 3008 * @syscap SystemCapability.Telephony.CoreService 3009 * @systemapi Hide this for inner system use. 3010 * @since 9 3011 */ 3012 KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL = 'volte_provisioning_supported_bool', 3013 3014 /** 3015 * Indicates whether SS service supports UT. 3016 * 3017 * @syscap SystemCapability.Telephony.CoreService 3018 * @systemapi Hide this for inner system use. 3019 * @since 9 3020 */ 3021 KEY_SS_OVER_UT_SUPPORTED_BOOL = 'ss_over_ut_supported_bool', 3022 3023 /** 3024 * Indicates whether the IMS requires GBA. 3025 * 3026 * @syscap SystemCapability.Telephony.CoreService 3027 * @systemapi Hide this for inner system use. 3028 * @since 9 3029 */ 3030 KEY_IMS_GBA_REQUIRED_BOOL = 'ims_gba_required_bool', 3031 3032 /** 3033 * Indicates whether UT configuration is supported. 3034 * 3035 * @syscap SystemCapability.Telephony.CoreService 3036 * @systemapi Hide this for inner system use. 3037 * @since 9 3038 */ 3039 KEY_UT_PROVISIONING_SUPPORTED_BOOL = 'ut_provisioning_supported_bool', 3040 3041 /** 3042 * Indicates the ims emergency preference. 3043 * 3044 * @syscap SystemCapability.Telephony.CoreService 3045 * @systemapi Hide this for inner system use. 3046 * @since 9 3047 */ 3048 KEY_IMS_PREFER_FOR_EMERGENCY_BOOL = 'ims_prefer_for_emergency_bool', 3049 3050 /** 3051 * Indicates call waiting service. 3052 * 3053 * @syscap SystemCapability.Telephony.CoreService 3054 * @systemapi Hide this for inner system use. 3055 * @since 9 3056 */ 3057 KEY_CALL_WAITING_SERVICE_CLASS_INT = 'call_waiting_service_class_int', 3058 3059 /** 3060 * Indicates call forwarding visibility. 3061 * 3062 * @syscap SystemCapability.Telephony.CoreService 3063 * @systemapi Hide this for inner system use. 3064 * @since 9 3065 */ 3066 KEY_CALL_TRANSFER_VISIBILITY_BOOL = 'call_transfer_visibility_bool', 3067 3068 /** 3069 * Indicates the list of ims call end reasons. 3070 * 3071 * @syscap SystemCapability.Telephony.CoreService 3072 * @systemapi Hide this for inner system use. 3073 * @since 9 3074 */ 3075 KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY = 3076 'ims_call_disconnect_reason_info_mapping_string_array', 3077 3078 /** 3079 * Indicates the forced Volte switch on state. 3080 * 3081 * @syscap SystemCapability.Telephony.CoreService 3082 * @systemapi Hide this for inner system use. 3083 * @since 9 3084 */ 3085 KEY_FORCE_VOLTE_SWITCH_ON_BOOL = 'force_volte_switch_on_bool', 3086 3087 /** 3088 * Indicates whether the operator name is displayed. 3089 * 3090 * @syscap SystemCapability.Telephony.CoreService 3091 * @systemapi Hide this for inner system use. 3092 * @since 9 3093 */ 3094 KEY_ENABLE_OPERATOR_NAME_CUST_BOOL = 'enable_operator_name_cust_bool', 3095 3096 /** 3097 * Indicates the name of the operator. 3098 * 3099 * @syscap SystemCapability.Telephony.CoreService 3100 * @systemapi Hide this for inner system use. 3101 * @since 9 3102 */ 3103 KEY_OPERATOR_NAME_CUST_STRING = 'operator_name_cust_string', 3104 3105 /** 3106 * Indicates the spn display rule. 3107 * 3108 * @syscap SystemCapability.Telephony.CoreService 3109 * @systemapi Hide this for inner system use. 3110 * @since 9 3111 */ 3112 KEY_SPN_DISPLAY_CONDITION_CUST_INT = 'spn_display_condition_cust_int', 3113 3114 /** 3115 * Indicates the PLMN name. 3116 * 3117 * @syscap SystemCapability.Telephony.CoreService 3118 * @systemapi Hide this for inner system use. 3119 * @since 9 3120 */ 3121 KEY_PNN_CUST_STRING_ARRAY = 'pnn_cust_string_array', 3122 3123 /** 3124 * Indicates operator PLMN information. 3125 * 3126 * @syscap SystemCapability.Telephony.CoreService 3127 * @systemapi Hide this for inner system use. 3128 * @since 9 3129 */ 3130 KEY_OPL_CUST_STRING_ARRAY = 'opl_cust_string_array', 3131 3132 /** 3133 * Indicates the emergency call list. 3134 * 3135 * @syscap SystemCapability.Telephony.CoreService 3136 * @systemapi Hide this for inner system use. 3137 * @since 9 3138 */ 3139 KEY_EMERGENCY_CALL_STRING_ARRAY = 'emergency_call_string_array', 3140 } 3141 3142 /** 3143 * Indicates the Dsds Mode. 3144 * 3145 * @enum { number } 3146 * @syscap SystemCapability.Telephony.CoreService 3147 * @systemapi Hide this for inner system use. 3148 * @since 11 3149 */ 3150 export enum DsdsMode { 3151 /** 3152 * Indicates the DSDS 2.0 Mode. 3153 * 3154 * @syscap SystemCapability.Telephony.CoreService 3155 * @systemapi Hide this for inner system use. 3156 * @since 11 3157 */ 3158 DSDS_MODE_V2 = 0, 3159 3160 /** 3161 * Indicates the DSDS 3.0 Mode. 3162 * 3163 * @syscap SystemCapability.Telephony.CoreService 3164 * @systemapi Hide this for inner system use. 3165 * @since 11 3166 */ 3167 DSDS_MODE_V3 = 1, 3168 3169 /** 3170 * Indicates the DSDS 5.0 TDM Mode. 3171 * 3172 * @syscap SystemCapability.Telephony.CoreService 3173 * @systemapi Hide this for inner system use. 3174 * @since 11 3175 */ 3176 DSDS_MODE_V5_TDM = 2, 3177 3178 /** 3179 * Indicates the DSDS 5.0 DSDA Mode. 3180 * 3181 * @syscap SystemCapability.Telephony.CoreService 3182 * @systemapi Hide this for inner system use. 3183 * @since 11 3184 */ 3185 DSDS_MODE_V5_DSDA = 3, 3186 } 3187 3188 /** 3189 * Indicates the operator of SIM. 3190 * 3191 * @enum { string } 3192 * @syscap SystemCapability.Telephony.CoreService 3193 * @systemapi Hide this for inner system use. 3194 * @since 11 3195 */ 3196 export enum OperatorSimCard { 3197 /** 3198 * Indicates the China Telecom card. 3199 * 3200 * @syscap SystemCapability.Telephony.CoreService 3201 * @systemapi Hide this for inner system use. 3202 * @since 11 3203 */ 3204 CHINA_TELECOM_CARD = 'china_telecom_card', 3205 } 3206 3207 /** 3208 * Indicates the Authentication type 3209 * 3210 * @enum { number } 3211 * @syscap SystemCapability.Telephony.CoreService 3212 * @systemapi Hide this for inner system use. 3213 * @since 14 3214 */ 3215 export enum AuthType { 3216 /** 3217 * Authentication type is EAP-SIM. See RFC 4186 3218 * 3219 * @syscap SystemCapability.Telephony.CoreService 3220 * @systemapi Hide this for inner system use. 3221 * @since 14 3222 */ 3223 SIM_AUTH_EAP_SIM_TYPE = 128, 3224 /** 3225 * Authentication type is EAP-AKA. See RFC 4187 3226 * 3227 * @syscap SystemCapability.Telephony.CoreService 3228 * @systemapi Hide this for inner system use. 3229 * @since 14 3230 */ 3231 SIM_AUTH_EAP_AKA_TYPE = 129, 3232 } 3233 3234 /** 3235 * Defines the SIM card authentication response. 3236 * 3237 * @interface SimAuthenticationResponse 3238 * @syscap SystemCapability.Telephony.CoreService 3239 * @systemapi Hide this for inner system use. 3240 * @since 14 3241 */ 3242 export interface SimAuthenticationResponse { 3243 /** 3244 * Status word 1 of the SIM card, which is returned by the SIM card after command execution. 3245 * 3246 * @type { number } 3247 * @syscap SystemCapability.Telephony.CoreService 3248 * @systemapi Hide this for inner system use. 3249 * @since 14 3250 */ 3251 simStatusWord1: number; 3252 3253 /** 3254 * Status word 2 of the SIM card, which is returned by the SIM card after command execution. 3255 * 3256 * @type { number } 3257 * @syscap SystemCapability.Telephony.CoreService 3258 * @systemapi Hide this for inner system use. 3259 * @since 14 3260 */ 3261 simStatusWord2: number; 3262 3263 /** 3264 * Indicates the response of authentication. 3265 * 3266 * @type { string } 3267 * @syscap SystemCapability.Telephony.CoreService 3268 * @systemapi Hide this for inner system use. 3269 * @since 14 3270 */ 3271 response: string; 3272 } 3273} 3274 3275export default sim; 3276