1/* 2 * Copyright (C) 2021-2022 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 16import {AsyncCallback} from "./basic"; 17 18/** 19 * Provides applications with APIs for obtaining SIM card status, card file information, and card specifications. 20 * SIM cards include SIM, USIM, and CSIM cards. 21 * 22 * @since 6 23 * @syscap SystemCapability.Telephony.CoreService 24 */ 25declare namespace sim { 26 /** 27 * Checks whether the SIM card in a specified slot is activated. 28 * 29 * @param slotId Indicates the card slot index number, 30 * ranging from {@code 0} to the maximum card slot index number supported by the device. 31 * @param callback Returns {@code true} if the SIM card is activated; returns {@code false} otherwise. 32 * @since 7 33 */ 34 function isSimActive(slotId: number, callback: AsyncCallback<boolean>): void; 35 function isSimActive(slotId: number): Promise<boolean>; 36 37 /** 38 * Obtains the default card slot for the voice service. 39 * 40 * @param callback Returns {@code 0} if card 1 is used as the default card slot for the voice service; 41 * returns {@code 1} if card 2 is used as the default card slot for the voice service; 42 * returns {@code -1} if no card is available for the voice service. 43 * @since 7 44 */ 45 function getDefaultVoiceSlotId(callback: AsyncCallback<number>): void; 46 function getDefaultVoiceSlotId(): Promise<number>; 47 48 /** 49 * Checks whether your application (the caller) has been granted the operator permissions. 50 * 51 * @param slotId Indicates the ID of the SIM card slot. 52 * @param callback Returns {@code true} if your application has been granted the operator permissions; 53 * returns {@code false} otherwise. If no SIM card is inserted or the SIM card is deactivated 54 * will be return {@code false}. 55 * @throws {BusinessError} 401 - Parameter error. 56 * @throws {BusinessError} 8300001 - Invalid parameter value. 57 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 58 * @throws {BusinessError} 8300003 - System internal error. 59 * @throws {BusinessError} 8300999 - Unknown error code. 60 * @since 7 61 */ 62 function hasOperatorPrivileges(slotId: number, callback: AsyncCallback<boolean>): void; 63 function hasOperatorPrivileges(slotId: number): Promise<boolean>; 64 65 /** 66 * Obtains the ISO country code of the SIM card in a specified slot. 67 * 68 * @param slotId Indicates the card slot index number, 69 * ranging from 0 to the maximum card slot index number supported by the device. 70 * @param callback Returns the country code defined in ISO 3166-2; returns an empty string if no SIM card is inserted. 71 * @throws {BusinessError} 401 - Parameter error. 72 * @throws {BusinessError} 8300001 - Invalid parameter value. 73 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 74 * @throws {BusinessError} 8300003 - System internal error. 75 * @throws {BusinessError} 8300004 - Do not have sim card. 76 * @throws {BusinessError} 8300999 - Unknown error code. 77 */ 78 function getISOCountryCodeForSim(slotId: number, callback: AsyncCallback<string>): void; 79 function getISOCountryCodeForSim(slotId: number): Promise<string>; 80 81 /** 82 * Obtains the home PLMN number of the SIM card in a specified slot. 83 * 84 * <p>The value is recorded in the SIM card and is irrelevant to the network 85 * with which the SIM card is currently registered. 86 * 87 * @param slotId Indicates the card slot index number, 88 * ranging from 0 to the maximum card slot index number supported by the device. 89 * @param callback Returns the PLMN number; returns an empty string if no SIM card is inserted. 90 * @throws {BusinessError} 401 - Parameter error. 91 * @throws {BusinessError} 8300001 - Invalid parameter value. 92 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 93 * @throws {BusinessError} 8300003 - System internal error. 94 * @throws {BusinessError} 8300004 - Do not have sim card. 95 * @throws {BusinessError} 8300999 - Unknown error code. 96 */ 97 function getSimOperatorNumeric(slotId: number, callback: AsyncCallback<string>): void; 98 function getSimOperatorNumeric(slotId: number): Promise<string>; 99 100 /** 101 * Obtains the service provider name (SPN) of the SIM card in a specified slot. 102 * 103 * <p>The value is recorded in the EFSPN file of the SIM card and is irrelevant to the network 104 * with which the SIM card is currently registered. 105 * 106 * @param slotId Indicates the card slot index number, 107 * ranging from 0 to the maximum card slot index number supported by the device. 108 * @param callback Returns the SPN; returns an empty string if no SIM card is inserted or 109 * no EFSPN file in the SIM card. 110 * @throws {BusinessError} 401 - Parameter error. 111 * @throws {BusinessError} 8300001 - Invalid parameter value. 112 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 113 * @throws {BusinessError} 8300003 - System internal error. 114 * @throws {BusinessError} 8300004 - Do not have sim card. 115 * @throws {BusinessError} 8300999 - Unknown error code. 116 */ 117 function getSimSpn(slotId: number, callback: AsyncCallback<string>): void; 118 function getSimSpn(slotId: number): Promise<string>; 119 120 /** 121 * Obtains the state of the SIM card in a specified slot. 122 * 123 * @param slotId Indicates the card slot index number, 124 * ranging from {@code 0} to the maximum card slot index number supported by the device. 125 * @param callback Returns one of the following SIM card states: 126 * <ul> 127 * <li>{@code SimState#SIM_STATE_UNKNOWN} 128 * <li>{@code SimState#SIM_STATE_NOT_PRESENT} 129 * <li>{@code SimState#SIM_STATE_LOCKED} 130 * <li>{@code SimState#SIM_STATE_NOT_READY} 131 * <li>{@code SimState#SIM_STATE_READY} 132 * <li>{@code SimState#SIM_STATE_LOADED} 133 * </ul> 134 * @throws {BusinessError} 401 - Parameter error. 135 * @throws {BusinessError} 8300001 - Invalid parameter value. 136 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 137 * @throws {BusinessError} 8300003 - System internal error. 138 * @throws {BusinessError} 8300999 - Unknown error code. 139 */ 140 function getSimState(slotId: number, callback: AsyncCallback<SimState>): void; 141 function getSimState(slotId: number): Promise<SimState>; 142 143 /** 144 * Obtains the type of the SIM card installed in a specified slot. 145 * 146 * @param slotId Indicates the ID of the specified slot. 147 * @param callback Returns the SIM card type. 148 * @throws {BusinessError} 401 - Parameter error. 149 * @throws {BusinessError} 8300001 - Invalid parameter value. 150 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 151 * @throws {BusinessError} 8300003 - System internal error. 152 * @throws {BusinessError} 8300004 - Do not have sim card. 153 * @throws {BusinessError} 8300999 - Unknown error code. 154 * @since 7 155 */ 156 function getCardType(slotId: number, callback: AsyncCallback<CardType>): void; 157 function getCardType(slotId: number): Promise<CardType>; 158 159 /** 160 * Obtains the ICCID of the SIM card in a specified slot. 161 * 162 * <p>The ICCID is a unique identifier of a SIM card. It consists of 20 digits 163 * and is recorded in the EFICCID file of the SIM card. 164 * 165 * @param slotId Indicates the card slot index number, 166 * ranging from 0 to the maximum card slot index number supported by the device. 167 * @param callback Returns the ICCID; returns an empty string if no SIM card is inserted. 168 * @permission ohos.permission.GET_TELEPHONY_STATE 169 * @throws {BusinessError} 201 - Permission denied. 170 * @throws {BusinessError} 401 - Parameter error. 171 * @throws {BusinessError} 8300001 - Invalid parameter value. 172 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 173 * @throws {BusinessError} 8300003 - System internal error. 174 * @throws {BusinessError} 8300004 - Do not have sim card. 175 * @throws {BusinessError} 8300999 - Unknown error code. 176 * @systemapi Hide this for inner system use. 177 * @since 7 178 */ 179 function getSimIccId(slotId: number, callback: AsyncCallback<string>): void; 180 function getSimIccId(slotId: number): Promise<string>; 181 182 /** 183 * Obtains the alpha identifier of the voice mailbox of the SIM card in a specified slot. 184 * 185 * @param slotId Indicates the card slot index number, 186 * ranging from {@code 0} to the maximum card slot index number supported by the device. 187 * @param callback Returns the voice mailbox alpha identifier; 188 * returns an empty string if no voice mailbox alpha identifier is written into the SIM card. 189 * @permission ohos.permission.GET_TELEPHONY_STATE 190 * @throws {BusinessError} 201 - Permission denied. 191 * @throws {BusinessError} 401 - Parameter error. 192 * @throws {BusinessError} 8300001 - Invalid parameter value. 193 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 194 * @throws {BusinessError} 8300003 - System internal error. 195 * @throws {BusinessError} 8300004 - Do not have sim card. 196 * @throws {BusinessError} 8300999 - Unknown error code. 197 * @systemapi Hide this for inner system use. 198 * @since 8 199 */ 200 function getVoiceMailIdentifier(slotId: number, callback: AsyncCallback<string>): void; 201 function getVoiceMailIdentifier(slotId: number): Promise<string>; 202 203 /** 204 * Obtains the voice mailbox number of the SIM card in a specified slot. 205 * 206 * @param slotId Indicates the card slot index number, 207 * ranging from {@code 0} to the maximum card slot index number supported by the device. 208 * @param callback Returns the voice mailbox number; 209 * returns an empty string if no voice mailbox number is written into the SIM card. 210 * @permission ohos.permission.GET_TELEPHONY_STATE 211 * @throws {BusinessError} 201 - Permission denied. 212 * @throws {BusinessError} 401 - Parameter error. 213 * @throws {BusinessError} 8300001 - Invalid parameter value. 214 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 215 * @throws {BusinessError} 8300003 - System internal error. 216 * @throws {BusinessError} 8300004 - Do not have sim card. 217 * @throws {BusinessError} 8300999 - Unknown error code. 218 * @systemapi Hide this for inner system use. 219 * @since 8 220 */ 221 function getVoiceMailNumber(slotId: number, callback: AsyncCallback<string>): void; 222 function getVoiceMailNumber(slotId: number): Promise<string>; 223 224 /** 225 * Sets the voice mail information. 226 * 227 * @param slotId Indicates the card slot index number, 228 * ranging from {@code 0} to the maximum card slot index number supported by the device. 229 * @param mailName Indicates the name of voice mail. 230 * @param mailNumber Indicates the number of voice mail. 231 * @permission ohos.permission.SET_TELEPHONY_STATE 232 * @throws {BusinessError} 201 - Permission denied. 233 * @throws {BusinessError} 401 - Parameter error. 234 * @throws {BusinessError} 8300001 - Invalid parameter value. 235 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 236 * @throws {BusinessError} 8300003 - System internal error. 237 * @throws {BusinessError} 8300004 - Do not have sim card. 238 * @throws {BusinessError} 8300999 - Unknown error code. 239 * @throws {BusinessError} 8301002 - SIM card operation error. 240 * @systemapi Hide this for inner system use. 241 * @since 8 242 */ 243 function setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string, callback: AsyncCallback<void>): void; 244 function setVoiceMailInfo(slotId: number, mailName: string, mailNumber: string): Promise<void>; 245 246 /** 247 * Obtains the MSISDN of the SIM card in a specified slot. 248 * The MSISDN is recorded in the EFMSISDN file of the SIM card. 249 * 250 * @param slotId Indicates the card slot index number, 251 * ranging from 0 to the maximum card slot index number supported by the device. 252 * @param callback Returns the MSISDN; returns an empty string if no SIM card is inserted or 253 * no MSISDN is recorded in the EFMSISDN file. 254 * @permission ohos.permission.GET_TELEPHONY_STATE 255 * @throws {BusinessError} 201 - Permission denied. 256 * @throws {BusinessError} 401 - Parameter error. 257 * @throws {BusinessError} 8300001 - Invalid parameter value. 258 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 259 * @throws {BusinessError} 8300003 - System internal error. 260 * @throws {BusinessError} 8300004 - Do not have sim card. 261 * @throws {BusinessError} 8300999 - Unknown error code. 262 * @systemapi Hide this for inner system use. 263 * @since 8 264 */ 265 function getSimTelephoneNumber(slotId: number, callback: AsyncCallback<string>): void; 266 function getSimTelephoneNumber(slotId: number): Promise<string>; 267 268 /** 269 * Obtains the Group Identifier Level 1 (GID1) of the SIM card in a specified slot. 270 * The GID1 is recorded in the EFGID1 file of the SIM card. 271 * 272 * @param slotId Indicates the card slot index number, 273 * ranging from 0 to the maximum card slot index number supported by the device. 274 * @param callback Returns the GID1; returns an empty string if no SIM card is inserted or 275 * no GID1 in the SIM card. 276 * @permission ohos.permission.GET_TELEPHONY_STATE 277 * @throws {BusinessError} 201 - Permission denied. 278 * @throws {BusinessError} 401 - Parameter error. 279 * @throws {BusinessError} 8300001 - Invalid parameter value. 280 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 281 * @throws {BusinessError} 8300003 - System internal error. 282 * @throws {BusinessError} 8300004 - Do not have sim card. 283 * @throws {BusinessError} 8300999 - Unknown error code. 284 * @systemapi Hide this for inner system use. 285 * @since 7 286 */ 287 function getSimGid1(slotId: number, callback: AsyncCallback<string>): void; 288 function getSimGid1(slotId: number): Promise<string>; 289 290 /** 291 * Obtains the maximum number of SIM cards that can be used simultaneously on the device, 292 * that is, the maximum number of SIM card slots. 293 * 294 * @returns Returns the maximum number of SIM card slots. 295 * @since 7 296 */ 297 function getMaxSimCount(): number; 298 299 /** 300 * Get the international mobile subscriber ID. 301 * 302 * @param slotId Indicates the card slot index number, 303 * ranging from 0 to the maximum card slot index number supported by the device. 304 * @param callback Returns the international mobile subscriber ID. 305 * @permission ohos.permission.GET_TELEPHONY_STATE 306 * @throws {BusinessError} 201 - Permission denied. 307 * @throws {BusinessError} 401 - Parameter error. 308 * @throws {BusinessError} 8300001 - Invalid parameter value. 309 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 310 * @throws {BusinessError} 8300003 - System internal error. 311 * @throws {BusinessError} 8300004 - Do not have sim card. 312 * @throws {BusinessError} 8300999 - Unknown error code. 313 * @systemapi Hide this for inner system use. 314 */ 315 function getIMSI(slotId: number, callback: AsyncCallback<string>): void; 316 function getIMSI(slotId: number): Promise<string>; 317 318 /** 319 * Checks whether a SIM card is inserted in a specified slot. 320 * 321 * @param slotId Indicates the card slot index number, 322 * ranging from 0 to the maximum card slot index number supported by the device. 323 * @param callback Returns true if a SIM card is inserted; return false otherwise. 324 * @throws {BusinessError} 401 - Parameter error. 325 * @throws {BusinessError} 8300001 - Invalid parameter value. 326 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 327 * @throws {BusinessError} 8300003 - System internal error. 328 * @throws {BusinessError} 8300999 - Unknown error code. 329 * @since 7 330 */ 331 function hasSimCard(slotId: number, callback: AsyncCallback<boolean>): void; 332 function hasSimCard(slotId: number): Promise<boolean>; 333 334 /** 335 * Get account information of SIM card. 336 * 337 * @param slotId Indicates the card slot index number, 338 * ranging from 0 to the maximum card slot index number supported by the device. 339 * @param callback Returns a {@code IccAccountInfo} object. 340 * @permission ohos.permission.GET_TELEPHONY_STATE 341 * @throws {BusinessError} 201 - Permission denied. 342 * @throws {BusinessError} 401 - Parameter error. 343 * @throws {BusinessError} 8300001 - Invalid parameter value. 344 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 345 * @throws {BusinessError} 8300003 - System internal error. 346 * @throws {BusinessError} 8300004 - Do not have sim card. 347 * @throws {BusinessError} 8300999 - Unknown error code. 348 * @throws {BusinessError} 8301002 - SIM card operation error. 349 * @systemapi Hide this for inner system use. 350 * @since 7 351 */ 352 function getSimAccountInfo(slotId: number, callback: AsyncCallback<IccAccountInfo>): void; 353 function getSimAccountInfo(slotId: number): Promise<IccAccountInfo>; 354 355 /** 356 * Get the list of active SIM card account information. 357 * 358 * @param callback Returns a {@code IccAccountInfo} object. 359 * @permission ohos.permission.GET_TELEPHONY_STATE 360 * @throws {BusinessError} 201 - Permission denied. 361 * @throws {BusinessError} 401 - Parameter error. 362 * @throws {BusinessError} 8300001 - Invalid parameter value. 363 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 364 * @throws {BusinessError} 8300003 - System internal error. 365 * @throws {BusinessError} 8300004 - Do not have sim card. 366 * @throws {BusinessError} 8300999 - Unknown error code. 367 * @systemapi Hide this for inner system use. 368 * @since 8 369 */ 370 function getActiveSimAccountInfoList(callback: AsyncCallback<Array<IccAccountInfo>>): void; 371 function getActiveSimAccountInfoList(): Promise<Array<IccAccountInfo>>; 372 373 /** 374 * Set the card slot ID of the default voice service. 375 * 376 * @param slotId Indicates the card slot index number, 377 * ranging from 0 to the maximum card slot index number supported by the device. 378 * @permission ohos.permission.SET_TELEPHONY_STATE 379 * @throws {BusinessError} 201 - Permission denied. 380 * @throws {BusinessError} 401 - Parameter error. 381 * @throws {BusinessError} 8300001 - Invalid parameter value. 382 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 383 * @throws {BusinessError} 8300003 - System internal error. 384 * @throws {BusinessError} 8300004 - Do not have sim card. 385 * @throws {BusinessError} 8300999 - Unknown error code. 386 * @throws {BusinessError} 8301001 - SIM card is not activated. 387 * @systemapi Hide this for inner system use. 388 * @since 7 389 */ 390 function setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback<void>): void; 391 function setDefaultVoiceSlotId(slotId: number): Promise<void>; 392 393 /** 394 * Activate the SIM card in the specified slot. 395 * 396 * @param slotId Indicates the card slot index number, 397 * ranging from 0 to the maximum card slot index number supported by the device. 398 * @permission ohos.permission.SET_TELEPHONY_STATE 399 * @throws {BusinessError} 201 - Permission denied. 400 * @throws {BusinessError} 401 - Parameter error. 401 * @throws {BusinessError} 8300001 - Invalid parameter value. 402 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 403 * @throws {BusinessError} 8300003 - System internal error. 404 * @throws {BusinessError} 8300004 - Do not have sim card. 405 * @throws {BusinessError} 8300999 - Unknown error code. 406 * @systemapi Hide this for inner system use. 407 * @since 8 408 */ 409 function activateSim(slotId: number, callback: AsyncCallback<void>): void; 410 function activateSim(slotId: number): Promise<void>; 411 412 /** 413 * Disable SIM card in specified slot. 414 * 415 * @param slotId Indicates the card slot index number, 416 * ranging from 0 to the maximum card slot index number supported by the device. 417 * @permission ohos.permission.SET_TELEPHONY_STATE 418 * @throws {BusinessError} 201 - Permission denied. 419 * @throws {BusinessError} 401 - Parameter error. 420 * @throws {BusinessError} 8300001 - Invalid parameter value. 421 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 422 * @throws {BusinessError} 8300003 - System internal error. 423 * @throws {BusinessError} 8300004 - Do not have sim card. 424 * @throws {BusinessError} 8300999 - Unknown error code. 425 * @systemapi Hide this for inner system use. 426 * @since 8 427 */ 428 function deactivateSim(slotId: number, callback: AsyncCallback<void>): void; 429 function deactivateSim(slotId: number): Promise<void>; 430 431 /** 432 * Set the SIM card display name of the specified card slot. 433 * 434 * @param slotId Indicates the card slot index number, 435 * ranging from 0 to the maximum card slot index number supported by the device. 436 * @param name Indicates SIM card name. 437 * @permission ohos.permission.SET_TELEPHONY_STATE 438 * @throws {BusinessError} 201 - Permission denied. 439 * @throws {BusinessError} 401 - Parameter error. 440 * @throws {BusinessError} 8300001 - Invalid parameter value. 441 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 442 * @throws {BusinessError} 8300003 - System internal error. 443 * @throws {BusinessError} 8300004 - Do not have sim card. 444 * @throws {BusinessError} 8300999 - Unknown error code. 445 * @systemapi Hide this for inner system use. 446 * @since 8 447 */ 448 function setShowName(slotId: number, name: string, callback: AsyncCallback<void>): void; 449 function setShowName(slotId: number, name: string): Promise<void>; 450 451 /** 452 * Gets the name of the SIM card in the specified slot. 453 * 454 * @param slotId Indicates the card slot index number, 455 * ranging from 0 to the maximum card slot index number supported by the device. 456 * @param callback Returns SIM card name. 457 * @permission ohos.permission.GET_TELEPHONY_STATE 458 * @throws {BusinessError} 201 - Permission denied. 459 * @throws {BusinessError} 401 - Parameter error. 460 * @throws {BusinessError} 8300001 - Invalid parameter value. 461 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 462 * @throws {BusinessError} 8300003 - System internal error. 463 * @throws {BusinessError} 8300004 - Do not have sim card. 464 * @throws {BusinessError} 8300999 - Unknown error code. 465 * @systemapi Hide this for inner system use. 466 * @since 8 467 */ 468 function getShowName(slotId: number, callback: AsyncCallback<string>): void; 469 function getShowName(slotId: number): Promise<string>; 470 471 /** 472 * Set the SIM card number in the specified slot. 473 * 474 * @param slotId Indicates the card slot index number, 475 * ranging from 0 to the maximum card slot index number supported by the device. 476 * @param number Indicates SIM card number. 477 * @permission ohos.permission.SET_TELEPHONY_STATE 478 * @throws {BusinessError} 201 - Permission denied. 479 * @throws {BusinessError} 401 - Parameter error. 480 * @throws {BusinessError} 8300001 - Invalid parameter value. 481 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 482 * @throws {BusinessError} 8300003 - System internal error. 483 * @throws {BusinessError} 8300004 - Do not have sim card. 484 * @throws {BusinessError} 8300999 - Unknown error code. 485 * @systemapi Hide this for inner system use. 486 * @since 8 487 */ 488 function setShowNumber(slotId: number, number: string, callback: AsyncCallback<void>): void; 489 function setShowNumber(slotId: number, number: string): Promise<void>; 490 491 /** 492 * Get the SIM card number of the specified card slot. 493 * 494 * @param slotId Indicates the card slot index number, 495 * ranging from 0 to the maximum card slot index number supported by the device. 496 * @param callback Returns SIM card number. 497 * @permission ohos.permission.GET_TELEPHONY_STATE 498 * @throws {BusinessError} 201 - Permission denied. 499 * @throws {BusinessError} 401 - Parameter error. 500 * @throws {BusinessError} 8300001 - Invalid parameter value. 501 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 502 * @throws {BusinessError} 8300003 - System internal error. 503 * @throws {BusinessError} 8300004 - Do not have sim card. 504 * @throws {BusinessError} 8300999 - Unknown error code. 505 * @systemapi Hide this for inner system use. 506 * @since 8 507 */ 508 function getShowNumber(slotId: number, callback: AsyncCallback<string>): void; 509 function getShowNumber(slotId: number): Promise<string>; 510 511 /** 512 * Obtains the operatorconfigs of the SIM card in a specified slot. 513 * 514 * @param slotId Indicates the card slot index number, 515 * ranging from 0 to the maximum card slot index number supported by the device. 516 * @returns Returns the operatorconfigs in a specified slot; returns empty OperatorConfig 517 * if no SIM card is inserted 518 * @permission ohos.permission.GET_TELEPHONY_STATE 519 * @throws {BusinessError} 201 - Permission denied. 520 * @throws {BusinessError} 401 - Parameter error. 521 * @throws {BusinessError} 8300001 - Invalid parameter value. 522 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 523 * @throws {BusinessError} 8300003 - System internal error. 524 * @throws {BusinessError} 8300999 - Unknown error code. 525 * @systemapi Hide this for inner system use. 526 * @since 8 527 */ 528 function getOperatorConfigs(slotId: number, callback: AsyncCallback<Array<OperatorConfig>>): void; 529 function getOperatorConfigs(slotId: number): Promise<Array<OperatorConfig>>; 530 531 /** 532 * Unlock the SIM card password of the specified card slot. 533 * 534 * @param slotId Indicates the card slot index number, 535 * ranging from 0 to the maximum card slot index number supported by the device. 536 * @param pin Indicates the password of the SIM card. 537 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 538 * @permission ohos.permission.SET_TELEPHONY_STATE 539 * @throws {BusinessError} 201 - Permission denied. 540 * @throws {BusinessError} 401 - Parameter error. 541 * @throws {BusinessError} 8300001 - Invalid parameter value. 542 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 543 * @throws {BusinessError} 8300003 - System internal error. 544 * @throws {BusinessError} 8300004 - Do not have sim card. 545 * @throws {BusinessError} 8300999 - Unknown error code. 546 * @throws {BusinessError} 8301002 - SIM card operation error. 547 * @systemapi Hide this for inner system use. 548 * @since 7 549 */ 550 function unlockPin(slotId: number, pin: string, callback: AsyncCallback<LockStatusResponse>): void; 551 function unlockPin(slotId: number, pin: string): Promise<LockStatusResponse>; 552 553 /** 554 * Unlock the SIM card password in the specified card slot. 555 * 556 * @param slotId Indicates the card slot index number, 557 * ranging from 0 to the maximum card slot index number supported by the device. 558 * @param newPin Indicates to reset the SIM card password. 559 * @param puk Indicates the unlock password of the SIM card password. 560 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 561 * @permission ohos.permission.SET_TELEPHONY_STATE 562 * @throws {BusinessError} 201 - Permission denied. 563 * @throws {BusinessError} 401 - Parameter error. 564 * @throws {BusinessError} 8300001 - Invalid parameter value. 565 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 566 * @throws {BusinessError} 8300003 - System internal error. 567 * @throws {BusinessError} 8300004 - Do not have sim card. 568 * @throws {BusinessError} 8300999 - Unknown error code. 569 * @throws {BusinessError} 8301002 - SIM card operation error. 570 * @systemapi Hide this for inner system use. 571 * @since 7 572 */ 573 function unlockPuk(slotId: number, newPin: string, puk: string, callback: AsyncCallback<LockStatusResponse>): void; 574 function unlockPuk(slotId: number, newPin: string, puk: string): Promise<LockStatusResponse>; 575 576 /** 577 * Change Pin Password. 578 * 579 * @param slotId Indicates the card slot index number, 580 * ranging from 0 to the maximum card slot index number supported by the device. 581 * @param newPin Indicates a new password. 582 * @param oldPin Indicates old password. 583 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 584 * @permission ohos.permission.SET_TELEPHONY_STATE 585 * @throws {BusinessError} 201 - Permission denied. 586 * @throws {BusinessError} 401 - Parameter error. 587 * @throws {BusinessError} 8300001 - Invalid parameter value. 588 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 589 * @throws {BusinessError} 8300003 - System internal error. 590 * @throws {BusinessError} 8300004 - Do not have sim card. 591 * @throws {BusinessError} 8300999 - Unknown error code. 592 * @throws {BusinessError} 8301002 - SIM card operation error. 593 * @systemapi Hide this for inner system use. 594 * @since 7 595 */ 596 function alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback<LockStatusResponse>): void; 597 function alterPin(slotId: number, newPin: string, oldPin: string): Promise<LockStatusResponse>; 598 599 /** 600 * Set the lock status of the SIM card in the specified slot. 601 * 602 * @param slotId Indicates the card slot index number, 603 * ranging from 0 to the maximum card slot index number supported by the device. 604 * @param options Indicates lock information. 605 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 606 * @permission ohos.permission.SET_TELEPHONY_STATE 607 * @throws {BusinessError} 201 - Permission denied. 608 * @throws {BusinessError} 401 - Parameter error. 609 * @throws {BusinessError} 8300001 - Invalid parameter value. 610 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 611 * @throws {BusinessError} 8300003 - System internal error. 612 * @throws {BusinessError} 8300004 - Do not have sim card. 613 * @throws {BusinessError} 8300999 - Unknown error code. 614 * @throws {BusinessError} 8301002 - SIM card operation error. 615 * @systemapi Hide this for inner system use. 616 * @since 7 617 */ 618 function setLockState(slotId: number, options: LockInfo, callback: AsyncCallback<LockStatusResponse>): void; 619 function setLockState(slotId: number, options: LockInfo): Promise<LockStatusResponse>; 620 621 /** 622 * Unlock the SIM card password of the specified card slot. 623 * 624 * @param slotId Indicates the card slot index number, 625 * ranging from 0 to the maximum card slot index number supported by the device. 626 * @param pin2 Indicates the password of the SIM card. 627 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 628 * @permission ohos.permission.SET_TELEPHONY_STATE 629 * @throws {BusinessError} 201 - Permission denied. 630 * @throws {BusinessError} 401 - Parameter error. 631 * @throws {BusinessError} 8300001 - Invalid parameter value. 632 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 633 * @throws {BusinessError} 8300003 - System internal error. 634 * @throws {BusinessError} 8300004 - Do not have sim card. 635 * @throws {BusinessError} 8300999 - Unknown error code. 636 * @throws {BusinessError} 8301002 - SIM card operation error. 637 * @systemapi Hide this for inner system use. 638 * @since 8 639 */ 640 function unlockPin2(slotId: number, pin2: string, callback: AsyncCallback<LockStatusResponse>): void; 641 function unlockPin2(slotId: number, pin2: string): Promise<LockStatusResponse>; 642 643 /** 644 * Unlock the SIM card password in the specified card slot. 645 * 646 * @param slotId Indicates the card slot index number, 647 * ranging from 0 to the maximum card slot index number supported by the device. 648 * @param newPin2 Indicates to reset the SIM card password. 649 * @param puk2 Indicates the unlock password of the SIM card password. 650 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 651 * @permission ohos.permission.SET_TELEPHONY_STATE 652 * @throws {BusinessError} 201 - Permission denied. 653 * @throws {BusinessError} 401 - Parameter error. 654 * @throws {BusinessError} 8300001 - Invalid parameter value. 655 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 656 * @throws {BusinessError} 8300003 - System internal error. 657 * @throws {BusinessError} 8300004 - Do not have sim card. 658 * @throws {BusinessError} 8300999 - Unknown error code. 659 * @throws {BusinessError} 8301002 - SIM card operation error. 660 * @systemapi Hide this for inner system use. 661 * @since 8 662 */ 663 function unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback<LockStatusResponse>): void; 664 function unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise<LockStatusResponse>; 665 666 /** 667 * Change Pin2 password. 668 * 669 * @param slotId Indicates the card slot index number, 670 * ranging from 0 to the maximum card slot index number supported by the device. 671 * @param newPin2 Indicates a new password. 672 * @param oldPin2 Indicates old password. 673 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 674 * @permission ohos.permission.SET_TELEPHONY_STATE 675 * @throws {BusinessError} 201 - Permission denied. 676 * @throws {BusinessError} 401 - Parameter error. 677 * @throws {BusinessError} 8300001 - Invalid parameter value. 678 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 679 * @throws {BusinessError} 8300003 - System internal error. 680 * @throws {BusinessError} 8300004 - Do not have sim card. 681 * @throws {BusinessError} 8300999 - Unknown error code. 682 * @throws {BusinessError} 8301002 - SIM card operation error. 683 * @systemapi Hide this for inner system use. 684 * @since 8 685 */ 686 function alterPin2(slotId: number, newPin2: string, oldPin2: string, callback: AsyncCallback<LockStatusResponse>): void; 687 function alterPin2(slotId: number, newPin2: string, oldPin2: string): Promise<LockStatusResponse>; 688 689 /** 690 * Query dialing number information on SIM card. 691 * 692 * @param slotId Indicates the card slot index number, 693 * ranging from 0 to the maximum card slot index number supported by the device. 694 * @param type Indicates contact type. 695 * @param callback Return dialing number information. 696 * @permission ohos.permission.READ_CONTACTS 697 * @throws {BusinessError} 201 - Permission denied. 698 * @throws {BusinessError} 401 - Parameter error. 699 * @throws {BusinessError} 8300001 - Invalid parameter value. 700 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 701 * @throws {BusinessError} 8300003 - System internal error. 702 * @throws {BusinessError} 8300004 - Do not have sim card. 703 * @throws {BusinessError} 8300999 - Unknown error code. 704 * @throws {BusinessError} 8301002 - SIM card operation error. 705 * @systemapi Hide this for inner system use. 706 * @since 8 707 */ 708 function queryIccDiallingNumbers(slotId: number, type: ContactType, callback: AsyncCallback<Array<DiallingNumbersInfo>>): void 709 function queryIccDiallingNumbers(slotId: number, type: ContactType): Promise<Array<DiallingNumbersInfo>>; 710 711 /** 712 * Add dialing number information to SIM card. 713 * 714 * @param slotId Indicates the card slot index number, 715 * ranging from 0 to the maximum card slot index number supported by the device. 716 * @param type Indicates contact type. 717 * @param diallingNumbers Indicates dialing number information. 718 * @permission ohos.permission.WRITE_CONTACTS 719 * @throws {BusinessError} 201 - Permission denied. 720 * @throws {BusinessError} 401 - Parameter error. 721 * @throws {BusinessError} 8300001 - Invalid parameter value. 722 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 723 * @throws {BusinessError} 8300003 - System internal error. 724 * @throws {BusinessError} 8300004 - Do not have sim card. 725 * @throws {BusinessError} 8300999 - Unknown error code. 726 * @throws {BusinessError} 8301002 - SIM card operation error. 727 * @systemapi Hide this for inner system use. 728 * @since 8 729 */ 730 function addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void>): void; 731 function addIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void>; 732 733 /** 734 * Delete dialing number information on SIM card. 735 * 736 * @param slotId Indicates the card slot index number, 737 * ranging from 0 to the maximum card slot index number supported by the device. 738 * @param type Indicates contact type. 739 * @param diallingNumbers Indicates dialing number information. 740 * @permission ohos.permission.WRITE_CONTACTS 741 * @throws {BusinessError} 201 - Permission denied. 742 * @throws {BusinessError} 401 - Parameter error. 743 * @throws {BusinessError} 8300001 - Invalid parameter value. 744 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 745 * @throws {BusinessError} 8300003 - System internal error. 746 * @throws {BusinessError} 8300004 - Do not have sim card. 747 * @throws {BusinessError} 8300999 - Unknown error code. 748 * @throws {BusinessError} 8301002 - SIM card operation error. 749 * @systemapi Hide this for inner system use. 750 * @since 8 751 */ 752 function delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void>): void; 753 function delIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void>; 754 755 /** 756 * Update dialing number information on SIM card. 757 * 758 * @param slotId Indicates the card slot index number, 759 * ranging from 0 to the maximum card slot index number supported by the device. 760 * @param type Indicates contact type. 761 * @param diallingNumbers Indicates dialing number information. 762 * @permission ohos.permission.WRITE_CONTACTS 763 * @throws {BusinessError} 201 - Permission denied. 764 * @throws {BusinessError} 401 - Parameter error. 765 * @throws {BusinessError} 8300001 - Invalid parameter value. 766 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 767 * @throws {BusinessError} 8300003 - System internal error. 768 * @throws {BusinessError} 8300004 - Do not have sim card. 769 * @throws {BusinessError} 8300999 - Unknown error code. 770 * @throws {BusinessError} 8301002 - SIM card operation error. 771 * @systemapi Hide this for inner system use. 772 * @since 8 773 */ 774 function updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo, callback: AsyncCallback<void>): void; 775 function updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise<void>; 776 777 /** 778 * Get the lock status of the SIM card in the specified slot. 779 * 780 * @param slotId Indicates the card slot index number, 781 * ranging from 0 to the maximum card slot index number supported by the device. 782 * @param lockType Indicates the lock type. 783 * @param callback Returns sim card lock status. 784 * @permission ohos.permission.GET_TELEPHONY_STATE 785 * @throws {BusinessError} 201 - Permission denied. 786 * @throws {BusinessError} 401 - Parameter error. 787 * @throws {BusinessError} 8300001 - Invalid parameter value. 788 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 789 * @throws {BusinessError} 8300003 - System internal error. 790 * @throws {BusinessError} 8300004 - Do not have sim card. 791 * @throws {BusinessError} 8300999 - Unknown error code. 792 * @throws {BusinessError} 8301002 - SIM card operation error. 793 * @systemapi Hide this for inner system use. 794 * @since 8 795 */ 796 function getLockState(slotId: number, lockType: LockType, callback: AsyncCallback<LockState>): void; 797 function getLockState(slotId: number, lockType: LockType): Promise<LockState>; 798 799 /** 800 * Send envelope command to SIM card. 801 * 802 * @param slotId Indicates the card slot index number, 803 * ranging from 0 to the maximum card slot index number supported by the device. 804 * @param cmd Indicates sending command. 805 * @permission ohos.permission.SET_TELEPHONY_STATE 806 * @throws {BusinessError} 201 - Permission denied. 807 * @throws {BusinessError} 401 - Parameter error. 808 * @throws {BusinessError} 8300001 - Invalid parameter value. 809 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 810 * @throws {BusinessError} 8300003 - System internal error. 811 * @throws {BusinessError} 8300004 - Do not have sim card. 812 * @throws {BusinessError} 8300999 - Unknown error code. 813 * @systemapi Hide this for inner system use. 814 * @since 8 815 */ 816 function sendEnvelopeCmd(slotId: number, cmd: string, callback: AsyncCallback<void>): void; 817 function sendEnvelopeCmd(slotId: number, cmd: string): Promise<void>; 818 819 /** 820 * Send terminal response command to SIM card. 821 * 822 * @param slotId Indicates the card slot index number, 823 * ranging from 0 to the maximum card slot index number supported by the device. 824 * @param cmd Indicates sending command. 825 * @permission ohos.permission.SET_TELEPHONY_STATE 826 * @throws {BusinessError} 201 - Permission denied. 827 * @throws {BusinessError} 401 - Parameter error. 828 * @throws {BusinessError} 8300001 - Invalid parameter value. 829 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 830 * @throws {BusinessError} 8300003 - System internal error. 831 * @throws {BusinessError} 8300004 - Do not have sim card. 832 * @throws {BusinessError} 8300999 - Unknown error code. 833 * @systemapi Hide this for inner system use. 834 * @since 8 835 */ 836 function sendTerminalResponseCmd(slotId: number, cmd: string, callback: AsyncCallback<void>): void; 837 function sendTerminalResponseCmd(slotId: number, cmd: string): Promise<void>; 838 839 /** 840 * Unlock SIM card. 841 * 842 * @param slotId Indicates the card slot index number, 843 * ranging from 0 to the maximum card slot index number supported by the device. 844 * @param lockInfo Indicates customized lock type information. 845 * @param callback Returns the response to obtain the SIM card lock status of the specified card slot. 846 * @permission ohos.permission.SET_TELEPHONY_STATE 847 * @throws {BusinessError} 201 - Permission denied. 848 * @throws {BusinessError} 401 - Parameter error. 849 * @throws {BusinessError} 8300001 - Invalid parameter value. 850 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 851 * @throws {BusinessError} 8300003 - System internal error. 852 * @throws {BusinessError} 8300004 - Do not have sim card. 853 * @throws {BusinessError} 8300999 - Unknown error code. 854 * @throws {BusinessError} 8301002 - SIM card operation error. 855 * @systemapi Hide this for inner system use. 856 * @since 8 857 */ 858 function unlockSimLock(slotId: number, lockInfo: PersoLockInfo, callback: AsyncCallback<LockStatusResponse>): void; 859 function unlockSimLock(slotId: number, lockInfo: PersoLockInfo): Promise<LockStatusResponse>; 860 861 /** 862 * Obtains the operator key of the SIM card in a specified slot. 863 * 864 * @param slotId Indicates the card slot index number, 865 * ranging from 0 to the maximum card slot index number supported by the device. 866 * @param callback Returns the operator key; returns an empty string if no SIM card is inserted or 867 * no operator key matched. 868 * @throws {BusinessError} 401 - Parameter error. 869 * @throws {BusinessError} 801 - Capability not supported. 870 * @throws {BusinessError} 8300001 - Invalid parameter value. 871 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 872 * @throws {BusinessError} 8300003 - System internal error. 873 * @throws {BusinessError} 8300999 - Unknown error code. 874 * @since 9 875 */ 876 function getOpKey(slotId: number, callback: AsyncCallback<string>): void; 877 function getOpKey(slotId: number): Promise<string>; 878 879 /** 880 * Obtains the operator name of the SIM card in a specified slot. 881 * 882 * @param slotId Indicates the card slot index number, 883 * ranging from 0 to the maximum card slot index number supported by the device. 884 * @param callback Returns the operator name; returns an empty string if no SIM card is inserted or 885 * no operator name matched. 886 * @throws {BusinessError} 401 - Parameter error. 887 * @throws {BusinessError} 801 - Capability not supported. 888 * @throws {BusinessError} 8300001 - Invalid parameter value. 889 * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. 890 * @throws {BusinessError} 8300003 - System internal error. 891 * @throws {BusinessError} 8300999 - Unknown error code. 892 * @since 9 893 */ 894 function getOpName(slotId: number, callback: AsyncCallback<string>): void; 895 function getOpName(slotId: number): Promise<string>; 896 897 /** 898 * @systemapi Hide this for inner system use. 899 * @since 8 900 */ 901 export interface OperatorConfig { 902 field: string; 903 value: string; 904 } 905 906 /** 907 * @systemapi Hide this for inner system use. 908 * @since 7 909 */ 910 export interface IccAccountInfo { 911 /** 912 * sim Id for card. 913 */ 914 simId: number; 915 /** 916 * slot id. 917 */ 918 slotIndex: number; 919 /** 920 * mark card is eSim or not. 921 */ 922 isEsim: boolean; 923 /** 924 * active status for card. 925 */ 926 isActive: boolean; 927 /** 928 * iccId for card. 929 */ 930 iccId: string; 931 /** 932 * display name for card. 933 */ 934 showName: string; 935 /** 936 * display number for card. 937 */ 938 showNumber: string; 939 } 940 941 /** 942 * @systemapi Hide this for inner system use. 943 * @since 7 944 */ 945 export interface LockStatusResponse { 946 /** 947 * Current operation result 948 */ 949 result: number; 950 /** 951 * Operations remaining 952 */ 953 remain?: number; 954 } 955 956 /** 957 * @systemapi Hide this for inner system use. 958 * @since 8 959 */ 960 export interface DiallingNumbersInfo { 961 alphaTag: string; 962 number: string; 963 recordNumber?: number; 964 pin2?: string; 965 } 966 967 /** 968 * @systemapi Hide this for inner system use. 969 * @since 8 970 */ 971 export interface LockInfo { 972 lockType: LockType; 973 password: string; 974 state: LockState; 975 } 976 977 /** 978 * @systemapi Hide this for inner system use. 979 * @since 8 980 */ 981 export interface PersoLockInfo { 982 lockType: PersoLockType; 983 password: string; 984 } 985 986 /** 987 * @systemapi Hide this for inner system use. 988 * @since 8 989 */ 990 export enum LockType { 991 PIN_LOCK = 1, 992 FDN_LOCK = 2, 993 } 994 995 /** 996 * @since 7 997 */ 998 export enum CardType { 999 /** Icc card type: unknown type Card. */ 1000 UNKNOWN_CARD = -1, 1001 1002 /** Icc card type: Single sim card type. */ 1003 SINGLE_MODE_SIM_CARD = 10, 1004 1005 /** Icc card type: Single usim card type. */ 1006 SINGLE_MODE_USIM_CARD = 20, 1007 1008 /** Icc card type: Single ruim card type. */ 1009 SINGLE_MODE_RUIM_CARD = 30, 1010 1011 /** Icc card type: Double card C+G. */ 1012 DUAL_MODE_CG_CARD = 40, 1013 1014 /** Icc card type: China Telecom Internal Roaming Card (Dual Mode). */ 1015 CT_NATIONAL_ROAMING_CARD = 41, 1016 1017 /** Icc card type: China Unicom Dual Mode Card. */ 1018 CU_DUAL_MODE_CARD = 42, 1019 1020 /** Icc card type: China Telecom LTE Card (Dual Mode). */ 1021 DUAL_MODE_TELECOM_LTE_CARD = 43, 1022 1023 /** Icc card type: Double card U+G. */ 1024 DUAL_MODE_UG_CARD = 50, 1025 1026 /** 1027 * Icc card type: Single isim card type. 1028 * @since 8 1029 */ 1030 SINGLE_MODE_ISIM_CARD = 60 1031 } 1032 1033 export enum SimState { 1034 /** 1035 * Indicates unknown SIM card state, that is, the accurate status cannot be obtained. 1036 */ 1037 SIM_STATE_UNKNOWN, 1038 1039 /** 1040 * Indicates that the SIM card is in the <b>not present</b> state, that is, no SIM card is inserted 1041 * into the card slot. 1042 */ 1043 SIM_STATE_NOT_PRESENT, 1044 1045 /** 1046 * Indicates that the SIM card is in the <b>locked</b> state, that is, the SIM card is locked by the 1047 * personal identification number (PIN)/PIN unblocking key (PUK) or network. 1048 */ 1049 SIM_STATE_LOCKED, 1050 1051 /** 1052 * Indicates that the SIM card is in the <b>not ready</b> state, that is, the SIM card is in position 1053 * but cannot work properly. 1054 */ 1055 SIM_STATE_NOT_READY, 1056 1057 /** 1058 * Indicates that the SIM card is in the <b>ready</b> state, that is, the SIM card is in position and 1059 * is working properly. 1060 */ 1061 SIM_STATE_READY, 1062 1063 /** 1064 * Indicates that the SIM card is in the <b>loaded</b> state, that is, the SIM card is in position and 1065 * is working properly. 1066 */ 1067 SIM_STATE_LOADED 1068 } 1069 1070 /** 1071 * @systemapi Hide this for inner system use. 1072 * @since 8 1073 */ 1074 export enum LockState { 1075 /**Indicates that the lock state card is in the <b>off</b> state. */ 1076 LOCK_OFF = 0, 1077 1078 /**Indicates that the lock state card is in the <b>on</b> state. */ 1079 LOCK_ON = 1, 1080 } 1081 1082 /** 1083 * @systemapi Hide this for inner system use. 1084 * @since 8 1085 */ 1086 export enum ContactType { 1087 GENERAL_CONTACT = 1, 1088 FIXED_DIALING = 2, 1089 } 1090 1091 /** 1092 * @systemapi Hide this for inner system use. 1093 * @since 8 1094 */ 1095 export enum PersoLockType { 1096 PN_PIN_LOCK, //Network Personalization (refer 3GPP TS 22.022 [33]) 1097 PN_PUK_LOCK, 1098 PU_PIN_LOCK, //Network Subset Personalization (refer 3GPP TS 22.022 [33]) 1099 PU_PUK_LOCK, 1100 PP_PIN_LOCK, //Service Provider Personalization (refer 3GPP TS 22.022 [33]) 1101 PP_PUK_LOCK, 1102 PC_PIN_LOCK, //Corporate Personalization (refer 3GPP TS 22.022 [33]) 1103 PC_PUK_LOCK, 1104 SIM_PIN_LOCK, //SIM/USIM Personalization (refer 3GPP TS 22.022 [33]) 1105 SIM_PUK_LOCK, 1106 } 1107 1108 /** 1109 * @systemapi Hide this for inner system use. 1110 * @since 9 1111 */ 1112 export enum OperatorConfigKey { 1113 /** 1114 * Indicates the voice mail number. 1115 */ 1116 KEY_VOICE_MAIL_NUMBER_STRING = "voice_mail_number_string", 1117 /** 1118 * Indicates the status of ims switch. 1119 */ 1120 KEY_IMS_SWITCH_ON_BY_DEFAULT_BOOL = "ims_switch_on_by_default_bool", 1121 /** 1122 * Indicates whether the ims switch status is hidden. 1123 */ 1124 KEY_HIDE_IMS_SWITCH_BOOL = "hide_ims_switch_bool", 1125 /** 1126 * Indicates whether volte mode is supported. 1127 */ 1128 KEY_VOLTE_SUPPORTED_BOOL = "volte_supported_bool", 1129 /** 1130 * Indicates the list supported by nr mode. 1131 */ 1132 KEY_NR_MODE_SUPPORTED_LIST_INT_ARRAY = "nr_mode_supported_list_int_array", 1133 /** 1134 * Indicates whether VOLTE supports configuration. 1135 */ 1136 KEY_VOLTE_PROVISIONING_SUPPORTED_BOOL = "volte_provisioning_supported_bool", 1137 /** 1138 * Indicates whether SS service supports UT. 1139 */ 1140 KEY_SS_OVER_UT_SUPPORTED_BOOL = "ss_over_ut_supported_bool", 1141 /** 1142 * Indicates whether the IMS requires GBA. 1143 */ 1144 KEY_IMS_GBA_REQUIRED_BOOL = "ims_gba_required_bool", 1145 /** 1146 * Indicates whether UT configuration is supported. 1147 */ 1148 KEY_UT_PROVISIONING_SUPPORTED_BOOL = "ut_provisioning_supported_bool", 1149 /** 1150 * Indicates the ims emergency preference. 1151 */ 1152 KEY_IMS_PREFER_FOR_EMERGENCY_BOOL = "ims_prefer_for_emergency_bool", 1153 /** 1154 * Indicates call waiting service. 1155 */ 1156 KEY_CALL_WAITING_SERVICE_CLASS_INT = "call_waiting_service_class_int", 1157 /** 1158 * Indicates call forwarding visibility. 1159 */ 1160 KEY_CALL_TRANSFER_VISIBILITY_BOOL = "call_transfer_visibility_bool", 1161 /** 1162 * Indicates the list of ims call end reasons. 1163 */ 1164 KEY_IMS_CALL_DISCONNECT_REASON_INFO_MAPPING_STRING_ARRAY = "ims_call_disconnect_reason_info_mapping_string_array", 1165 /** 1166 * Indicates the forced Volte switch on state. 1167 */ 1168 KEY_FORCE_VOLTE_SWITCH_ON_BOOL = "force_volte_switch_on_bool", 1169 /** 1170 * Indicates whether the operator name is displayed. 1171 */ 1172 KEY_ENABLE_OPERATOR_NAME_CUST_BOOL = "enable_operator_name_cust_bool", 1173 /** 1174 * Indicates the name of the operator. 1175 */ 1176 KEY_OPERATOR_NAME_CUST_STRING = "operator_name_cust_string", 1177 /** 1178 * Indicates the spn display rule. 1179 */ 1180 KEY_SPN_DISPLAY_CONDITION_CUST_INT = "spn_display_condition_cust_int", 1181 /** 1182 * Indicates the PLMN name. 1183 */ 1184 KEY_PNN_CUST_STRING_ARRAY = "pnn_cust_string_array", 1185 /** 1186 * Indicates operator PLMN information. 1187 */ 1188 KEY_OPL_CUST_STRING_ARRAY = "opl_cust_string_array", 1189 /** 1190 * Indicates the emergency call list. 1191 */ 1192 KEY_EMERGENCY_CALL_STRING_ARRAY = "emergency_call_string_array", 1193 } 1194} 1195 1196export default sim; 1197