1# @ohos.telephony.radio (Network Search) 2 3The **radio** module provides basic network search management functions. You can obtain the radio access technology (RAT) used in the CS and PS domains, network status, current network selection mode, ISO country code of the registered network, ID of the slot in which the primary card is located, list of signal strengths of the registered network, carrier name, and IMEI, MEID, and unique device ID of the SIM card in the specified slot. Besides, you can check whether the current device supports 5G\(NR\) and whether the radio service is enabled on the primary SIM card. 4 5>**NOTE** 6> 7>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8 9 10## Modules to Import 11 12``` 13import radio from '@ohos.telephony.radio'; 14``` 15 16## radio.getRadioTech 17 18getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void 19 20Obtains the RAT used in the CS and PS domains for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 21 22**Required permission**: ohos.permission.GET_NETWORK_INFO 23 24**System capability**: SystemCapability.Telephony.CoreService 25 26**Parameters** 27 28| Name | Type | Mandatory| Description | 29| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 30| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 31| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | Yes | Callback used to return the result. | 32 33**Error codes** 34 35For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 36 37| ID| Error Message | 38| -------- | -------------------------------------------- | 39| 201 | Permission denied. | 40| 401 | Parameter error. | 41| 8300001 | Invalid parameter value. | 42| 8300002 | Operation failed. Cannot connect to service. | 43| 8300003 | System internal error. | 44| 8300999 | Unknown error code. | 45 46**Example** 47 48```js 49let slotId = 0; 50radio.getRadioTech(slotId, (err, data) => { 51 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 52}); 53``` 54 55 56## radio.getRadioTech 57 58getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\> 59 60Obtains the RAT used in the CS and PS domains for the SIM card in the specified slot. This API uses a promise to return the result. 61 62**Required permission**: ohos.permission.GET_NETWORK_INFO 63 64**System capability**: SystemCapability.Telephony.CoreService 65 66**Parameters** 67 68| Name| Type | Mandatory| Description | 69| ------ | ------ | ---- | -------------------------------------- | 70| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 71 72**Return value** 73 74| Type | Description | 75| ------------------------------------------------------------ | ----------------------------------------------- | 76| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.| 77 78**Error codes** 79 80For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 81 82| ID| Error Message | 83| -------- | -------------------------------------------- | 84| 201 | Permission denied. | 85| 401 | Parameter error. | 86| 8300001 | Invalid parameter value. | 87| 8300002 | Operation failed. Cannot connect to service. | 88| 8300003 | System internal error. | 89| 8300999 | Unknown error code. | 90 91**Example** 92 93```js 94let slotId = 0; 95let promise = radio.getRadioTech(slotId); 96promise.then(data => { 97 console.log(`getRadioTech success, data->${JSON.stringify(data)}`); 98}).catch(err => { 99 console.log(`getRadioTech failed, err->${JSON.stringify(err)}`); 100}); 101``` 102 103 104## radio.getNetworkState 105 106getNetworkState\(callback: AsyncCallback<NetworkState\>\): void 107 108Obtains the network status. This API uses an asynchronous callback to return the result. 109 110**Required permission**: ohos.permission.GET_NETWORK_INFO 111 112**System capability**: SystemCapability.Telephony.CoreService 113 114**Parameters** 115 116| Name | Type | Mandatory| Description | 117| -------- | ---------------------------------------------- | ---- | ---------- | 118| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result.| 119 120**Error codes** 121 122For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 123 124| ID| Error Message | 125| -------- | -------------------------------------------- | 126| 201 | Permission denied. | 127| 401 | Parameter error. | 128| 8300001 | Invalid parameter value. | 129| 8300002 | Operation failed. Cannot connect to service. | 130| 8300003 | System internal error. | 131| 8300999 | Unknown error code. | 132 133**Example** 134 135```js 136radio.getNetworkState((err, data) => { 137 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 138}); 139``` 140 141 142## radio.getNetworkState 143 144getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void 145 146Obtains the network status. This API uses an asynchronous callback to return the result. 147 148**Required permission**: ohos.permission.GET_NETWORK_INFO 149 150**System capability**: SystemCapability.Telephony.CoreService 151 152**Parameters** 153 154| Name | Type | Mandatory| Description | 155| -------- | ---------------------------------------------- | ---- | -------------------------------------- | 156| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 157| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes | Callback used to return the result. | 158 159**Error codes** 160 161For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 162 163| ID| Error Message | 164| -------- | -------------------------------------------- | 165| 201 | Permission denied. | 166| 401 | Parameter error. | 167| 8300001 | Invalid parameter value. | 168| 8300002 | Operation failed. Cannot connect to service. | 169| 8300003 | System internal error. | 170| 8300999 | Unknown error code. | 171 172**Example** 173 174```js 175let slotId = 0; 176radio.getNetworkState(slotId, (err, data) => { 177 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 178}); 179``` 180 181 182## radio.getNetworkState 183 184getNetworkState\(slotId?: number\): Promise<NetworkState\> 185 186Obtains the network status. This API uses a promise to return the result. 187 188**Required permission**: ohos.permission.GET_NETWORK_INFO 189 190**System capability**: SystemCapability.Telephony.CoreService 191 192**Parameters** 193 194| Name| Type | Mandatory| Description | 195| ------ | ------ | ---- | -------------------------------------- | 196| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 197 198**Return value** 199 200| Type | Description | 201| ---------------------------------------- | --------------------------- | 202| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.| 203 204**Error codes** 205 206For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 207 208| ID| Error Message | 209| -------- | -------------------------------------------- | 210| 201 | Permission denied. | 211| 401 | Parameter error. | 212| 8300001 | Invalid parameter value. | 213| 8300002 | Operation failed. Cannot connect to service. | 214| 8300003 | System internal error. | 215| 8300999 | Unknown error code. | 216 217**Example** 218 219```js 220let slotId = 0; 221let promise = radio.getNetworkState(slotId); 222promise.then(data => { 223 console.log(`getNetworkState success, promise: data->${JSON.stringify(data)}`); 224}).catch(err => { 225 console.log(`getNetworkState failed, promise: err->${JSON.stringify(err)}`); 226}); 227``` 228 229 230## radio.getNetworkSelectionMode 231 232getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectionMode\>\): void 233 234Obtains the network selection mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 235 236**System capability**: SystemCapability.Telephony.CoreService 237 238**Parameters** 239 240| Name | Type | Mandatory| Description | 241| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 242| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 243| callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionmode)\> | Yes | Callback used to return the result. | 244 245**Error codes** 246 247For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 248 249| ID| Error Message | 250| -------- | -------------------------------------------- | 251| 401 | Parameter error. | 252| 8300001 | Invalid parameter value. | 253| 8300002 | Operation failed. Cannot connect to service. | 254| 8300003 | System internal error. | 255| 8300999 | Unknown error code. | 256 257**Example** 258 259```js 260let slotId = 0; 261radio.getNetworkSelectionMode(slotId, (err, data) => { 262 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 263}); 264``` 265 266 267## radio.getNetworkSelectionMode 268 269getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\> 270 271Obtains the network selection mode of the SIM card in the specified slot. This API uses a promise to return the result. 272 273**System capability**: SystemCapability.Telephony.CoreService 274 275**Parameters** 276 277| Name| Type | Mandatory| Description | 278| ------ | ------ | ---- | -------------------------------------- | 279| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 280 281**Return value** 282 283| Type | Description | 284| -------------------------------------------------------- | ------------------------------- | 285| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.| 286 287**Error codes** 288 289For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 290 291| ID| Error Message | 292| -------- | -------------------------------------------- | 293| 401 | Parameter error. | 294| 8300001 | Invalid parameter value. | 295| 8300002 | Operation failed. Cannot connect to service. | 296| 8300003 | System internal error. | 297| 8300999 | Unknown error code. | 298 299**Example** 300 301```js 302let slotId = 0; 303let promise = radio.getNetworkSelectionMode(slotId); 304promise.then(data => { 305 console.log(`getNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`); 306}).catch(err => { 307 console.log(`getNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`); 308}); 309``` 310 311 312## radio.getISOCountryCodeForNetwork<sup>7+</sup> 313 314getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): void 315 316Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This API uses an asynchronous callback to return the result. 317 318**System capability**: SystemCapability.Telephony.CoreService 319 320**Parameters** 321 322| Name | Type | Mandatory| Description | 323| -------- | ----------------------- | ---- | ---------------------------------------- | 324| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 325| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is an ISO country code, for example, **CN** (China).| 326 327**Error codes** 328 329For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 330 331| ID| Error Message | 332| -------- | -------------------------------------------- | 333| 401 | Parameter error. | 334| 8300001 | Invalid parameter value. | 335| 8300002 | Operation failed. Cannot connect to service. | 336| 8300003 | System internal error. | 337| 8300999 | Unknown error code. | 338 339**Example** 340 341```js 342let slotId = 0; 343radio.getISOCountryCodeForNetwork(slotId, (err, data) => { 344 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 345}); 346``` 347 348 349## radio.getISOCountryCodeForNetwork<sup>7+</sup> 350 351getISOCountryCodeForNetwork\(slotId: number\): Promise<string\> 352 353Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This API uses a promise to return the result. 354 355**System capability**: SystemCapability.Telephony.CoreService 356 357**Parameters** 358 359| Name| Type | Mandatory| Description | 360| ------ | ------ | ---- | -------------------------------------- | 361| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 362 363**Return value** 364 365| Type | Description | 366| ----------------- | ------------------------------------------------------------ | 367| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).| 368 369**Error codes** 370 371For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 372 373| ID| Error Message | 374| -------- | -------------------------------------------- | 375| 401 | Parameter error. | 376| 8300001 | Invalid parameter value. | 377| 8300002 | Operation failed. Cannot connect to service. | 378| 8300003 | System internal error. | 379| 8300999 | Unknown error code. | 380 381**Example** 382 383```js 384let slotId = 0; 385let promise = radio.getISOCountryCodeForNetwork(slotId); 386promise.then(data => { 387 console.log(`getISOCountryCodeForNetwork success, promise: data->${JSON.stringify(data)}`); 388}).catch(err => { 389 console.log(`getISOCountryCodeForNetwork failed, promise: err->${JSON.stringify(err)}`); 390}); 391``` 392 393 394## radio.getPrimarySlotId<sup>7+</sup> 395 396getPrimarySlotId\(callback: AsyncCallback\<number\>\): void 397 398Obtains the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result. 399 400**System capability**: SystemCapability.Telephony.CoreService 401 402**Parameters** 403 404| Name | Type | Mandatory| Description | 405| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 406| callback | AsyncCallback\<number\> | Yes | Callback invoked to return the result.| 407 408**Error codes** 409 410For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 411 412| ID| Error Message | 413| -------- | -------------------------------------------- | 414| 8300001 | Invalid parameter value. | 415| 8300002 | Operation failed. Cannot connect to service. | 416| 8300003 | System internal error. | 417| 8300999 | Unknown error code. | 418 419**Example** 420 421```js 422radio.getPrimarySlotId((err, data) => { 423 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 424}); 425``` 426 427 428## radio.getPrimarySlotId<sup>7+</sup> 429 430getPrimarySlotId\(\): Promise\<number\> 431 432Obtains the ID of the slot in which the primary card is located. This API uses a promise to return the result. 433 434**System capability**: SystemCapability.Telephony.CoreService 435 436**Return value** 437 438| Type | Description | 439| ----------------------------------------------------------- | ------------------------------------------------------------ | 440| Promise\<number\> | Promise used to return the result.| 441 442**Error codes** 443 444For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 445 446| ID| Error Message | 447| -------- | -------------------------------------------- | 448| 8300001 | Invalid parameter value. | 449| 8300002 | Operation failed. Cannot connect to service. | 450| 8300003 | System internal error. | 451| 8300999 | Unknown error code. | 452 453**Example** 454 455```js 456let promise = radio.getPrimarySlotId(); 457promise.then(data => { 458 console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`); 459}).catch(err => { 460 console.error(`getPrimarySlotId failed, promise: err->${JSON.stringify(err)}`); 461}); 462``` 463 464 465## radio.getSignalInformation<sup>7+</sup> 466 467getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInformation\>\>\): void 468 469Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This API uses an asynchronous callback to return the result. 470 471**System capability**: SystemCapability.Telephony.CoreService 472 473**Parameters** 474 475| Name | Type | Mandatory| Description | 476| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | 477| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 478| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.| 479 480**Error codes** 481 482For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 483 484| ID| Error Message | 485| -------- | -------------------------------------------- | 486| 401 | Parameter error. | 487| 8300001 | Invalid parameter value. | 488| 8300002 | Operation failed. Cannot connect to service. | 489| 8300003 | System internal error. | 490| 8300999 | Unknown error code. | 491 492**Example** 493 494```js 495let slotId = 0; 496radio.getSignalInformation(slotId, (err, data) => { 497 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 498}); 499``` 500 501 502## radio.getSignalInformation<sup>7+</sup> 503 504getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\> 505 506Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This API uses a promise to return the result. 507 508**System capability**: SystemCapability.Telephony.CoreService 509 510**Parameters** 511 512| Name| Type | Mandatory| Description | 513| ------ | ------ | ---- | -------------------------------------- | 514| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 515 516**Return value** 517 518| Type | Description | 519| ----------------------------------------------------------- | ------------------------------------------------------------ | 520| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.| 521 522**Error codes** 523 524For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 525 526| ID| Error Message | 527| -------- | -------------------------------------------- | 528| 401 | Parameter error. | 529| 8300001 | Invalid parameter value. | 530| 8300002 | Operation failed. Cannot connect to service. | 531| 8300003 | System internal error. | 532| 8300999 | Unknown error code. | 533 534**Example** 535 536```js 537let slotId = 0; 538let promise = radio.getSignalInformation(slotId); 539promise.then(data => { 540 console.log(`getSignalInformation success, promise: data->${JSON.stringify(data)}`); 541}).catch(err => { 542 console.error(`getSignalInformation failed, promise: err->${JSON.stringify(err)}`); 543}); 544``` 545 546## radio.isNrSupported<sup>(deprecated)</sup> 547 548isNrSupported\(\): boolean 549 550Checks whether the current device supports 5G \(NR\). 551 552> **NOTE** 553> 554> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9) instead. 555 556**System capability**: SystemCapability.Telephony.CoreService 557 558**Return value** 559 560| Type | Description | 561| ------- | -------------------------------- | 562| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).| 563 564**Example** 565 566```js 567let result = radio.isNrSupported(); 568console.log("Result: "+ result); 569``` 570 571## radio.isNrSupported<sup>(deprecated)</sup> 572 573isNrSupported\(slotId: number\): boolean 574 575Checks whether the current device supports 5G \(NR\). 576 577> **NOTE** 578> 579> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9-1) instead. 580 581**System capability**: SystemCapability.Telephony.CoreService 582 583**Parameters** 584 585| Name| Type | Mandatory| Description | 586| ------ | ------ | ---- | -------------------------------------- | 587| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 588 589**Return value** 590 591| Type | Description | 592| ------------------ | ------------------------------------------------------------ | 593| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).| 594 595**Example** 596 597```js 598let slotId = 0; 599let result = radio.isNrSupported(slotId); 600console.log("Result: "+ result); 601``` 602 603 604## radio.isNRSupported<sup>9+</sup> 605 606isNRSupported\(\): boolean 607 608Checks whether the current device supports 5G \(NR\). 609 610**System capability**: SystemCapability.Telephony.CoreService 611 612**Return value** 613 614| Type | Description | 615| ------- | -------------------------------- | 616| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).| 617 618**Example** 619 620```js 621let result = radio.isNRSupported(); 622console.log("Result: "+ result); 623``` 624 625 626## radio.isNRSupported<sup>9+</sup> 627 628isNRSupported\(slotId: number\): boolean 629 630Checks whether the current device supports 5G \(NR\). 631 632**System capability**: SystemCapability.Telephony.CoreService 633 634**Parameters** 635 636| Name| Type | Mandatory| Description | 637| ------ | ------ | ---- | -------------------------------------- | 638| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 639 640**Return value** 641 642| Type | Description | 643| ------------------ | ------------------------------------------------------------ | 644| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).| 645 646**Example** 647 648```js 649let slotId = 0; 650let result = radio.isNRSupported(slotId); 651console.log("Result: "+ result); 652``` 653 654 655## radio.isRadioOn<sup>7+</sup> 656 657isRadioOn\(callback: AsyncCallback<boolean\>\): void 658 659Checks whether the radio service is enabled on the primary SIM card. This API uses an asynchronous callback to return the result. 660 661**Required permission**: ohos.permission.GET_NETWORK_INFO 662 663**System capability**: SystemCapability.Telephony.CoreService 664 665**Parameters** 666 667| Name | Type | Mandatory| Description | 668| -------- | ------------------------ | ---- | ------------------------------------------------------- | 669| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| 670 671**Error codes** 672 673For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 674 675| ID| Error Message | 676| -------- | -------------------------------------------- | 677| 201 | Permission denied. | 678| 401 | Parameter error. | 679| 8300001 | Invalid parameter value. | 680| 8300002 | Operation failed. Cannot connect to service. | 681| 8300003 | System internal error. | 682| 8300999 | Unknown error code. | 683 684**Example** 685 686```js 687radio.isRadioOn((err, data) => { 688 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 689}); 690``` 691 692 693## radio.isRadioOn<sup>7+</sup> 694 695isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void 696 697Checks whether the radio service is enabled on the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 698 699**Required permission**: ohos.permission.GET_NETWORK_INFO 700 701**System capability**: SystemCapability.Telephony.CoreService 702 703**Parameters** 704 705| Name | Type | Mandatory| Description | 706| -------- | ------------------------ | ---- | ------------------------------------------------------- | 707| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 708| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| 709 710**Error codes** 711 712For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 713 714| ID| Error Message | 715| -------- | -------------------------------------------- | 716| 201 | Permission denied. | 717| 401 | Parameter error. | 718| 8300001 | Invalid parameter value. | 719| 8300002 | Operation failed. Cannot connect to service. | 720| 8300003 | System internal error. | 721| 8300999 | Unknown error code. | 722 723**Example** 724 725```js 726let slotId = 0; 727radio.isRadioOn(slotId, (err, data) => { 728 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 729}); 730``` 731 732 733## radio.isRadioOn<sup>7+</sup> 734 735isRadioOn\(slotId?: number\): Promise<boolean\> 736 737Checks whether the radio service is enabled on the SIM card in the specified slot. This API uses a promise to return the result. 738 739**Required permission**: ohos.permission.GET_NETWORK_INFO 740 741**System capability**: SystemCapability.Telephony.CoreService 742 743**Parameters** 744 745| Name| Type | Mandatory| Description | 746| ------ | ------ | ---- | -------------------------------------- | 747| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2<br>If the slot ID is not specified, this API is defaulted to check whether the radio service is enabled on the primary SIM card.| 748 749**Return value** 750 751| Type | Description | 752| ------------------ | ------------------------------------------------------------ | 753| Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.| 754 755**Error codes** 756 757For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 758 759| ID| Error Message | 760| -------- | -------------------------------------------- | 761| 201 | Permission denied. | 762| 401 | Parameter error. | 763| 8300001 | Invalid parameter value. | 764| 8300002 | Operation failed. Cannot connect to service. | 765| 8300003 | System internal error. | 766| 8300999 | Unknown error code. | 767 768**Example** 769 770```js 771let slotId = 0; 772let promise = radio.isRadioOn(slotId); 773promise.then(data => { 774 console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`); 775}).catch(err => { 776 console.error(`isRadioOn failed, promise: err->${JSON.stringify(err)}`); 777}); 778``` 779 780 781## radio.getOperatorName<sup>7+</sup> 782 783getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void 784 785Obtains the carrier name for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 786 787**System capability**: SystemCapability.Telephony.CoreService 788 789**Parameters** 790 791| Name | Type | Mandatory| Description | 792| -------- | ----------------------- | ---- | ------------------------------------------ | 793| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 794| callback | AsyncCallback\<string\> | Yes | Callback used to return the result, which is the carrier name, for example, China Mobile.| 795 796**Error codes** 797 798For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 799 800| ID| Error Message | 801| -------- | -------------------------------------------- | 802| 401 | Parameter error. | 803| 8300001 | Invalid parameter value. | 804| 8300002 | Operation failed. Cannot connect to service. | 805| 8300003 | System internal error. | 806| 8300999 | Unknown error code. | 807 808**Example** 809 810```js 811let slotId = 0; 812radio.getOperatorName(slotId, (err, data) => { 813 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 814}); 815``` 816 817 818## radio.getOperatorName<sup>7+</sup> 819 820getOperatorName\(slotId: number\): Promise<string\> 821 822Obtains the carrier name for the SIM card in the specified slot. This API uses a promise to return the result. 823 824**System capability**: SystemCapability.Telephony.CoreService 825 826**Parameters** 827 828| Name| Type | Mandatory| Description | 829| ------ | ------ | ---- | -------------------------------------- | 830| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 831 832**Return value** 833 834| Type | Description | 835| ----------------- | ------------------------------------------------------------ | 836| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile. | 837 838**Error codes** 839 840For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 841 842| ID| Error Message | 843| -------- | -------------------------------------------- | 844| 401 | Parameter error. | 845| 8300001 | Invalid parameter value. | 846| 8300002 | Operation failed. Cannot connect to service. | 847| 8300003 | System internal error. | 848| 8300999 | Unknown error code. | 849 850**Example** 851 852```js 853let slotId = 0; 854let promise = radio.getOperatorName(slotId); 855promise.then(data => { 856 console.log(`getOperatorName success, promise: data->${JSON.stringify(data)}`); 857}).catch(err => { 858 console.log(`getOperatorName failed, promise: err->${JSON.stringify(err)}`); 859}); 860``` 861 862## radio.setPrimarySlotId<sup>8+</sup> 863 864setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void 865 866Sets the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result. 867 868**System API**: This is a system API. 869 870**Required permission**: ohos.permission.SET_TELEPHONY_STATE 871 872**System capability**: SystemCapability.Telephony.CoreService 873 874**Parameters** 875 876| Name | Type | Mandatory| Description | 877| -------- | --------------------- | ---- | -------------------------------------- | 878| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 879| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | 880 881**Error codes** 882 883For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 884 885| ID| Error Message | 886| -------- | -------------------------------------------- | 887| 201 | Permission denied. | 888| 401 | Parameter error. | 889| 8300001 | Invalid parameter value. | 890| 8300002 | Operation failed. Cannot connect to service. | 891| 8300003 | System internal error. | 892| 8300004 | Do not have sim card. | 893| 8300999 | Unknown error code. | 894 895**Example** 896 897```js 898let slotId = 0; 899radio.setPrimarySlotId(slotId, (err) => { 900 console.log(`callback: err->${JSON.stringify(err)}`); 901}); 902``` 903 904 905## radio.setPrimarySlotId<sup>8+</sup> 906 907setPrimarySlotId\(slotId: number\): Promise\<void\> 908 909Sets the ID of the slot in which the primary card is located. This API uses a promise to return the result. 910 911**System API**: This is a system API. 912 913**Required permission**: ohos.permission.SET_TELEPHONY_STATE 914 915**System capability**: SystemCapability.Telephony.CoreService 916 917**Parameters** 918 919| Name| Type | Mandatory| Description | 920| ------ | ------ | ---- | -------------------------------------- | 921| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 922 923**Return value** 924 925| Type | Description | 926| --------------- | ------------------------------- | 927| Promise\<void\> | Promise used to return the result.| 928 929**Error codes** 930 931For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 932 933| ID| Error Message | 934| -------- | -------------------------------------------- | 935| 201 | Permission denied. | 936| 401 | Parameter error. | 937| 8300001 | Invalid parameter value. | 938| 8300002 | Operation failed. Cannot connect to service. | 939| 8300003 | System internal error. | 940| 8300004 | Do not have sim card. | 941| 8300999 | Unknown error code. | 942 943**Example** 944 945```js 946let slotId = 0; 947let promise = radio.setPrimarySlotId(slotId); 948promise.then(() => { 949 console.log(`setPrimarySlotId success.`); 950}).catch((err) => { 951 console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`); 952}); 953``` 954 955## radio.getIMEI<sup>8+</sup> 956 957getIMEI(callback: AsyncCallback<string\>): void 958 959Obtains the IMEI of the SIM card in a card slot. This API uses an asynchronous callback to return the result. 960 961**System API**: This is a system API. 962 963**Required permission**: ohos.permission.GET_TELEPHONY_STATE 964 965**System capability**: SystemCapability.Telephony.CoreService 966 967**Parameters** 968 969| Name | Type | Mandatory| Description | 970| -------- | ----------------------- | ---- | ------------------------------------------ | 971| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.| 972 973**Error codes** 974 975For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 976 977| ID| Error Message | 978| -------- | -------------------------------------------- | 979| 201 | Permission denied. | 980| 401 | Parameter error. | 981| 8300001 | Invalid parameter value. | 982| 8300002 | Operation failed. Cannot connect to service. | 983| 8300003 | System internal error. | 984| 8300999 | Unknown error code. | 985 986**Example** 987 988```js 989radio.getIMEI((err, data) => { 990 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 991}); 992``` 993 994 995## radio.getIMEI<sup>8+</sup> 996 997getIMEI(slotId: number, callback: AsyncCallback<string\>): void 998 999Obtains the IMEI of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result. 1000 1001**System API**: This is a system API. 1002 1003**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1004 1005**System capability**: SystemCapability.Telephony.CoreService 1006 1007**Parameters** 1008 1009| Name | Type | Mandatory| Description | 1010| -------- | ----------------------- | ---- | ------------------------------------------ | 1011| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 | 1012| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. If the IMEI does not exist, an empty string is returned.| 1013 1014**Error codes** 1015 1016For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1017 1018| ID| Error Message | 1019| -------- | -------------------------------------------- | 1020| 201 | Permission denied. | 1021| 401 | Parameter error. | 1022| 8300001 | Invalid parameter value. | 1023| 8300002 | Operation failed. Cannot connect to service. | 1024| 8300003 | System internal error. | 1025| 8300999 | Unknown error code. | 1026 1027**Example** 1028 1029```js 1030let slotId = 0; 1031radio.getIMEI(slotId, (err, data) => { 1032 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1033}); 1034``` 1035 1036 1037## radio.getIMEI<sup>8+</sup> 1038 1039getIMEI(slotId?: number): Promise<string\> 1040 1041Obtains the IMEI of the SIM card in the specified card slot. This API uses a promise to return the result. 1042 1043**System API**: This is a system API. 1044 1045**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1046 1047**System capability**: SystemCapability.Telephony.CoreService 1048 1049**Parameters** 1050 1051| Name| Type | Mandatory| Description | 1052| ------ | ------ | ---- | -------------------------------------- | 1053| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1054 1055**Return value** 1056 1057| Type | Description | 1058| ----------------- | ------------------------------------------ | 1059| Promise\<string\> | Promise used to return the result. If the IMEI does not exist, an empty string is returned.| 1060 1061**Error codes** 1062 1063For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1064 1065| ID| Error Message | 1066| -------- | -------------------------------------------- | 1067| 201 | Permission denied. | 1068| 401 | Parameter error. | 1069| 8300001 | Invalid parameter value. | 1070| 8300002 | Operation failed. Cannot connect to service. | 1071| 8300003 | System internal error. | 1072| 8300999 | Unknown error code. | 1073 1074**Example** 1075 1076```js 1077let slotId = 0; 1078let promise = radio.getIMEI(slotId); 1079promise.then(data => { 1080 console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`); 1081}).catch(err => { 1082 console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`); 1083}); 1084``` 1085 1086## radio.getMEID<sup>8+</sup> 1087 1088getMEID(callback: AsyncCallback<string\>): void 1089 1090Obtains the MEID of the SIM card in a card slot. This API uses an asynchronous callback to return the result. 1091 1092**System API**: This is a system API. 1093 1094**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1095 1096**System capability**: SystemCapability.Telephony.CoreService 1097 1098**Parameters** 1099 1100| Name | Type | Mandatory| Description | 1101| -------- | ----------------------- | ---- | ---------- | 1102| callback | AsyncCallback\<string\> | Yes | Callback used to return the result.| 1103 1104**Error codes** 1105 1106For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1107 1108| ID| Error Message | 1109| -------- | -------------------------------------------- | 1110| 201 | Permission denied. | 1111| 401 | Parameter error. | 1112| 8300001 | Invalid parameter value. | 1113| 8300002 | Operation failed. Cannot connect to service. | 1114| 8300003 | System internal error. | 1115| 8300999 | Unknown error code. | 1116 1117**Example** 1118 1119```js 1120radio.getMEID((err, data) => { 1121 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1122}); 1123``` 1124 1125 1126## radio.getMEID<sup>8+</sup> 1127 1128getMEID(slotId: number, callback: AsyncCallback<string\>): void 1129 1130Obtains the MEID of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result. 1131 1132**System API**: This is a system API. 1133 1134**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1135 1136**System capability**: SystemCapability.Telephony.CoreService 1137 1138**Parameters** 1139 1140| Name | Type | Mandatory| Description | 1141| -------- | ----------------------- | ---- | -------------------------------------- | 1142| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1143| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | 1144 1145**Error codes** 1146 1147For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1148 1149| ID| Error Message | 1150| -------- | -------------------------------------------- | 1151| 201 | Permission denied. | 1152| 401 | Parameter error. | 1153| 8300001 | Invalid parameter value. | 1154| 8300002 | Operation failed. Cannot connect to service. | 1155| 8300003 | System internal error. | 1156| 8300999 | Unknown error code. | 1157 1158**Example** 1159 1160```js 1161let slotId = 0; 1162radio.getMEID(slotId, (err, data) => { 1163 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1164}); 1165``` 1166 1167 1168## radio.getMEID<sup>8+</sup> 1169 1170getMEID(slotId?: number): Promise<string\> 1171 1172Obtains the MEID of the SIM card in the specified card slot. This API uses a promise to return the result. 1173 1174**System API**: This is a system API. 1175 1176**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1177 1178**System capability**: SystemCapability.Telephony.CoreService 1179 1180**Parameters** 1181 1182| Name| Type | Mandatory| Description | 1183| ------ | ------ | ---- | -------------------------------------- | 1184| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1185 1186**Return value** 1187 1188| Type | Description | 1189| ----------------- | --------------------------------------- | 1190| Promise\<string\> | Promise used to return the result.| 1191 1192**Error codes** 1193 1194For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1195 1196| ID| Error Message | 1197| -------- | -------------------------------------------- | 1198| 201 | Permission denied. | 1199| 401 | Parameter error. | 1200| 8300001 | Invalid parameter value. | 1201| 8300002 | Operation failed. Cannot connect to service. | 1202| 8300003 | System internal error. | 1203| 8300999 | Unknown error code. | 1204 1205**Example** 1206 1207```js 1208let slotId = 0; 1209let promise = radio.getMEID(slotId); 1210promise.then(data => { 1211 console.log(`getMEID success, promise: data->${JSON.stringify(data)}`); 1212}).catch(err => { 1213 console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`); 1214}); 1215``` 1216 1217## radio.getUniqueDeviceId<sup>8+</sup> 1218 1219getUniqueDeviceId(callback: AsyncCallback<string\>): void 1220 1221Obtains the unique device ID of the SIM card in a card slot. This API uses an asynchronous callback to return the result. 1222 1223**System API**: This is a system API. 1224 1225**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1226 1227**System capability**: SystemCapability.Telephony.CoreService 1228 1229**Parameters** 1230 1231| Name | Type | Mandatory| Description | 1232| -------- | ----------------------- | ---- | ---------- | 1233| callback | AsyncCallback\<string\> | Yes | Callback used to return the result.| 1234 1235**Error codes** 1236 1237For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1238 1239| ID| Error Message | 1240| -------- | -------------------------------------------- | 1241| 201 | Permission denied. | 1242| 401 | Parameter error. | 1243| 8300001 | Invalid parameter value. | 1244| 8300002 | Operation failed. Cannot connect to service. | 1245| 8300003 | System internal error. | 1246| 8300999 | Unknown error code. | 1247 1248**Example** 1249 1250```js 1251radio.getUniqueDeviceId((err, data) => { 1252 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1253}); 1254``` 1255 1256 1257## radio.getUniqueDeviceId<sup>8+</sup> 1258 1259getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void 1260 1261Obtains the unique device ID of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result. 1262 1263**System API**: This is a system API. 1264 1265**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1266 1267**System capability**: SystemCapability.Telephony.CoreService 1268 1269**Parameters** 1270 1271| Name | Type | Mandatory| Description | 1272| -------- | ----------------------- | ---- | -------------------------------------- | 1273| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1274| callback | AsyncCallback\<string\> | Yes | Callback used to return the result. | 1275 1276**Error codes** 1277 1278For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1279 1280| ID| Error Message | 1281| -------- | -------------------------------------------- | 1282| 201 | Permission denied. | 1283| 401 | Parameter error. | 1284| 8300001 | Invalid parameter value. | 1285| 8300002 | Operation failed. Cannot connect to service. | 1286| 8300003 | System internal error. | 1287| 8300999 | Unknown error code. | 1288 1289**Example** 1290 1291```js 1292let slotId = 0; 1293radio.getUniqueDeviceId(slotId, (err, data) => { 1294 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1295}); 1296``` 1297 1298 1299## radio.getUniqueDeviceId<sup>8+</sup> 1300 1301getUniqueDeviceId(slotId?: number): Promise<string\> 1302 1303Obtains the unique device ID of the SIM card in the specified card slot. This API uses a promise to return the result. 1304 1305**System API**: This is a system API. 1306 1307**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1308 1309**System capability**: SystemCapability.Telephony.CoreService 1310 1311**Parameters** 1312 1313| Name| Type | Mandatory| Description | 1314| ------ | ------ | ---- | -------------------------------------- | 1315| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1316 1317**Return value** 1318 1319| Type | Description | 1320| ----------------- | --------------------------------------------- | 1321| Promise\<string\> | Promise used to return the result.| 1322 1323**Error codes** 1324 1325For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1326 1327| ID| Error Message | 1328| -------- | -------------------------------------------- | 1329| 201 | Permission denied. | 1330| 401 | Parameter error. | 1331| 8300001 | Invalid parameter value. | 1332| 8300002 | Operation failed. Cannot connect to service. | 1333| 8300003 | System internal error. | 1334| 8300999 | Unknown error code. | 1335 1336**Example** 1337 1338```js 1339let slotId = 0; 1340let promise = radio.getUniqueDeviceId(slotId); 1341promise.then(data => { 1342 console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`); 1343}).catch(err => { 1344 console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`); 1345}); 1346``` 1347 1348## radio.sendUpdateCellLocationRequest<sup>8+</sup> 1349 1350sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void 1351 1352Sends a cell location update request. This API uses an asynchronous callback to return the result. 1353 1354**System API**: This is a system API. 1355 1356**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1357 1358**System capability**: SystemCapability.Telephony.CoreService 1359 1360**Parameters** 1361 1362| Name | Type | Mandatory| Description | 1363| -------- | --------------------- | ---- | ---------- | 1364| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| 1365 1366**Error codes** 1367 1368For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1369 1370| ID| Error Message | 1371| -------- | -------------------------------------------- | 1372| 201 | Permission denied. | 1373| 401 | Parameter error. | 1374| 8300001 | Invalid parameter value. | 1375| 8300002 | Operation failed. Cannot connect to service. | 1376| 8300003 | System internal error. | 1377| 8300999 | Unknown error code. | 1378 1379**Example** 1380 1381```js 1382radio.sendUpdateCellLocationRequest((err) => { 1383 console.log(`callback: err->${JSON.stringify(err)}`); 1384}); 1385``` 1386 1387## radio.sendUpdateCellLocationRequest<sup>8+</sup> 1388 1389sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): void 1390 1391Sends a cell location update request for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1392 1393**System API**: This is a system API. 1394 1395**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1396 1397**System capability**: SystemCapability.Telephony.CoreService 1398 1399**Parameters** 1400 1401| Name | Type | Mandatory| Description | 1402| -------- | --------------------- | ---- | ---------- | 1403| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1404| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| 1405 1406**Error codes** 1407 1408For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1409 1410| ID| Error Message | 1411| -------- | -------------------------------------------- | 1412| 201 | Permission denied. | 1413| 401 | Parameter error. | 1414| 8300001 | Invalid parameter value. | 1415| 8300002 | Operation failed. Cannot connect to service. | 1416| 8300003 | System internal error. | 1417| 8300999 | Unknown error code. | 1418 1419**Example** 1420 1421```js 1422let slotId = 0; 1423radio.sendUpdateCellLocationRequest(slotId, (err) => { 1424 console.log(`callback: err->${JSON.stringify(err)}`); 1425}); 1426``` 1427 1428## radio.sendUpdateCellLocationRequest<sup>8+</sup> 1429 1430sendUpdateCellLocationRequest\(slotId?: number): Promise<void\> 1431 1432Sends a cell location update request for the SIM card in the specified slot. This API uses a promise to return the result. 1433 1434**System API**: This is a system API. 1435 1436**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1437 1438**System capability**: SystemCapability.Telephony.CoreService 1439 1440**Parameters** 1441 1442| Name| Type | Mandatory| Description | 1443| ------ | ------ | ---- | -------------------------------------- | 1444| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1445 1446**Return value** 1447 1448| Type | Description | 1449| --------------- | ----------------------- | 1450| Promise\<void\> | Promise used to return the result.| 1451 1452**Error codes** 1453 1454For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1455 1456| ID| Error Message | 1457| -------- | -------------------------------------------- | 1458| 201 | Permission denied. | 1459| 401 | Parameter error. | 1460| 8300001 | Invalid parameter value. | 1461| 8300002 | Operation failed. Cannot connect to service. | 1462| 8300003 | System internal error. | 1463| 8300999 | Unknown error code. | 1464 1465**Example** 1466 1467```js 1468let slotId = 0; 1469radio.sendUpdateCellLocationRequest(slotId).then(() => { 1470 console.log(`sendUpdateCellLocationRequest success.`); 1471}).catch((err) => { 1472 console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`); 1473}); 1474``` 1475 1476## radio.getCellInformation<sup>8+</sup> 1477 1478getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void 1479 1480Obtains cell information. This API uses an asynchronous callback to return the result. 1481 1482**System API**: This is a system API. 1483 1484**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1485 1486**System capability**: SystemCapability.Telephony.CoreService 1487 1488**Parameters** 1489 1490| Name | Type | Mandatory| Description | 1491| -------- | ------------------------------------------------------------ | ---- | ------------------------ | 1492| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result.| 1493 1494**Error codes** 1495 1496For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1497 1498| ID| Error Message | 1499| -------- | -------------------------------------------- | 1500| 201 | Permission denied. | 1501| 401 | Parameter error. | 1502| 8300001 | Invalid parameter value. | 1503| 8300002 | Operation failed. Cannot connect to service. | 1504| 8300003 | System internal error. | 1505| 8300999 | Unknown error code. | 1506 1507**Example** 1508 1509```js 1510radio.getCellInformation((err, data) => { 1511 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1512}); 1513``` 1514 1515 1516## radio.getCellInformation<sup>8+</sup> 1517 1518getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation\>\>): void 1519 1520Obtains cell information for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1521 1522**System API**: This is a system API. 1523 1524**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1525 1526**System capability**: SystemCapability.Telephony.CoreService 1527 1528**Parameters** 1529 1530| Name | Type | Mandatory| Description | 1531| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1532| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1533| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes | Callback used to return the result. | 1534 1535**Error codes** 1536 1537For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1538 1539| ID| Error Message | 1540| -------- | -------------------------------------------- | 1541| 201 | Permission denied. | 1542| 401 | Parameter error. | 1543| 8300001 | Invalid parameter value. | 1544| 8300002 | Operation failed. Cannot connect to service. | 1545| 8300003 | System internal error. | 1546| 8300999 | Unknown error code. | 1547 1548**Example** 1549 1550```js 1551let slotId = 0; 1552radio.getCellInformation(slotId, (err, data) => { 1553 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1554}); 1555``` 1556 1557 1558## radio.getCellInformation<sup>8+</sup> 1559 1560getCellInformation(slotId?: number): Promise<Array<CellInformation\>\> 1561 1562Obtains cell information for the SIM card in the specified slot. This API uses a promise to return the result. 1563 1564**System API**: This is a system API. 1565 1566**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION 1567 1568**System capability**: SystemCapability.Telephony.CoreService 1569 1570**Parameters** 1571 1572| Name| Type | Mandatory| Description | 1573| ------ | ------ | ---- | -------------------------------------- | 1574| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1575 1576**Return value** 1577 1578| Type | Description | 1579| ------------------------------------------------------- | ----------------------- | 1580| Promise\<Array<[CellInformation](#cellinformation8)\>\> | Promise used to return the result.| 1581 1582**Error codes** 1583 1584For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1585 1586| ID| Error Message | 1587| -------- | -------------------------------------------- | 1588| 201 | Permission denied. | 1589| 401 | Parameter error. | 1590| 8300001 | Invalid parameter value. | 1591| 8300002 | Operation failed. Cannot connect to service. | 1592| 8300003 | System internal error. | 1593| 8300999 | Unknown error code. | 1594 1595**Example** 1596 1597```js 1598let slotId = 0; 1599let promise = radio.getCellInformation(slotId); 1600promise.then(data => { 1601 console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`); 1602}).catch(err => { 1603 console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`); 1604}); 1605``` 1606 1607## radio.setNetworkSelectionMode 1608 1609setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback<void\>\): void 1610 1611Sets the network selection mode. This API uses an asynchronous callback to return the result. 1612 1613**System API**: This is a system API. 1614 1615**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1616 1617**System capability**: SystemCapability.Telephony.CoreService 1618 1619**Parameters** 1620 1621| Name | Type | Mandatory| Description | 1622| -------- | ----------------------------------------------------------- | ---- | ------------------ | 1623| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes | Network selection mode.| 1624| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | 1625 1626**Error codes** 1627 1628For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1629 1630| ID| Error Message | 1631| -------- | -------------------------------------------- | 1632| 201 | Permission denied. | 1633| 401 | Parameter error. | 1634| 8300001 | Invalid parameter value. | 1635| 8300002 | Operation failed. Cannot connect to service. | 1636| 8300003 | System internal error. | 1637| 8300999 | Unknown error code. | 1638 1639**Example** 1640 1641```js 1642let networkInformation={ 1643 operatorName: "China Mobile", 1644 operatorNumeric: "898600", 1645 state: radio.NetworkInformationState.NETWORK_AVAILABLE, 1646 radioTech: "CS" 1647} 1648let networkSelectionModeOptions={ 1649 slotId: 0, 1650 selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC, 1651 networkInformation: networkInformation, 1652 resumeSelection: true 1653} 1654radio.setNetworkSelectionMode(networkSelectionModeOptions, (err) => { 1655 console.log(`callback: err->${JSON.stringify(err)}`); 1656}); 1657``` 1658 1659## radio.setNetworkSelectionMode 1660 1661setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\> 1662 1663Sets the network selection mode. This API uses a promise to return the result. 1664 1665**System API**: This is a system API. 1666 1667**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1668 1669**System capability**: SystemCapability.Telephony.CoreService 1670 1671**Parameters** 1672 1673| Name | Type | Mandatory| Description | 1674| ------- | ----------------------------------------------------------- | ---- | ------------------ | 1675| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes | Network selection mode.| 1676 1677**Return value** 1678 1679| Type | Description | 1680| --------------- | ----------------------- | 1681| Promise\<void\> | Promise used to return the result.| 1682 1683**Error codes** 1684 1685For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1686 1687| ID| Error Message | 1688| -------- | -------------------------------------------- | 1689| 201 | Permission denied. | 1690| 401 | Parameter error. | 1691| 8300001 | Invalid parameter value. | 1692| 8300002 | Operation failed. Cannot connect to service. | 1693| 8300003 | System internal error. | 1694| 8300999 | Unknown error code. | 1695 1696**Example** 1697 1698```js 1699let networkInformation={ 1700 operatorName: "China Mobile", 1701 operatorNumeric: "898600", 1702 state: radio.NetworkInformationState.NETWORK_AVAILABLE, 1703 radioTech: "CS" 1704} 1705let networkSelectionModeOptions={ 1706 slotId: 0, 1707 selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC, 1708 networkInformation: networkInformation, 1709 resumeSelection: true 1710} 1711let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions); 1712promise.then(() => { 1713 console.log(`setNetworkSelectionMode success.`); 1714}).catch((err) => { 1715 console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`); 1716}); 1717``` 1718 1719## radio.getNetworkSearchInformation 1720 1721getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSearchResult\>\): void 1722 1723Obtains network search information for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1724 1725**System API**: This is a system API. 1726 1727**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1728 1729**System capability**: SystemCapability.Telephony.CoreService 1730 1731**Parameters** 1732 1733| Name | Type | Mandatory| Description | 1734| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- | 1735| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1736| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | Yes | Callback used to return the result. | 1737 1738**Error codes** 1739 1740For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1741 1742| ID| Error Message | 1743| -------- | -------------------------------------------- | 1744| 201 | Permission denied. | 1745| 401 | Parameter error. | 1746| 8300001 | Invalid parameter value. | 1747| 8300002 | Operation failed. Cannot connect to service. | 1748| 8300003 | System internal error. | 1749| 8300999 | Unknown error code. | 1750 1751**Example** 1752 1753```js 1754radio.getNetworkSearchInformation(0, (err, data) => { 1755 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1756}); 1757``` 1758 1759## radio.getNetworkSearchInformation 1760 1761getNetworkSearchInformation\(slotId: number\): Promise<NetworkSearchResult\> 1762 1763Obtains network search information for the SIM card in the specified slot. This API uses a promise to return the result. 1764 1765**System API**: This is a system API. 1766 1767**Required permission**: ohos.permission.GET_TELEPHONY_STATE 1768 1769**System capability**: SystemCapability.Telephony.CoreService 1770 1771**Parameters** 1772 1773| Name| Type | Mandatory| Description | 1774| ------ | ------ | ---- | -------------------------------------- | 1775| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1776 1777**Return value** 1778 1779| Type | Description | 1780| ------------------------------------------------------ | ----------------------- | 1781| Promise\<[NetworkSearchResult](#networksearchresult)\> | Promise used to return the result.| 1782 1783**Error codes** 1784 1785For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1786 1787| ID| Error Message | 1788| -------- | -------------------------------------------- | 1789| 201 | Permission denied. | 1790| 401 | Parameter error. | 1791| 8300001 | Invalid parameter value. | 1792| 8300002 | Operation failed. Cannot connect to service. | 1793| 8300003 | System internal error. | 1794| 8300999 | Unknown error code. | 1795 1796**Example** 1797 1798```js 1799let promise = radio.getNetworkSearchInformation(0); 1800promise.then(data => { 1801 console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`); 1802}).catch(err => { 1803 console.log(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`); 1804}); 1805``` 1806 1807## radio.getNrOptionMode<sup>8+</sup> 1808 1809getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void 1810 1811Obtains the NR option mode. This API uses an asynchronous callback to return the result. 1812 1813**System API**: This is a system API. 1814 1815**System capability**: SystemCapability.Telephony.CoreService 1816 1817**Parameters** 1818 1819| Name | Type | Mandatory| Description | 1820| -------- | ----------------------------------------------- | ---- | ---------- | 1821| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result.| 1822 1823**Error codes** 1824 1825For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1826 1827| ID| Error Message | 1828| -------- | -------------------------------------------- | 1829| 401 | Parameter error. | 1830| 8300001 | Invalid parameter value. | 1831| 8300002 | Operation failed. Cannot connect to service. | 1832| 8300003 | System internal error. | 1833| 8300999 | Unknown error code. | 1834 1835**Example** 1836 1837```js 1838radio.getNrOptionMode((err, data) => { 1839 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1840}); 1841``` 1842 1843 1844## radio.getNrOptionMode<sup>8+</sup> 1845 1846getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void 1847 1848Obtains the NR option mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1849 1850**System API**: This is a system API. 1851 1852**System capability**: SystemCapability.Telephony.CoreService 1853 1854**Parameters** 1855 1856| Name | Type | Mandatory| Description | 1857| -------- | ----------------------------------------------- | ---- | -------------------------------------- | 1858| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1859| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes | Callback used to return the result. | 1860 1861**Error codes** 1862 1863For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1864 1865| ID| Error Message | 1866| -------- | -------------------------------------------- | 1867| 401 | Parameter error. | 1868| 8300001 | Invalid parameter value. | 1869| 8300002 | Operation failed. Cannot connect to service. | 1870| 8300003 | System internal error. | 1871| 8300999 | Unknown error code. | 1872 1873**Example** 1874 1875```js 1876let slotId = 0; 1877radio.getNrOptionMode(slotId, (err, data) => { 1878 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 1879}); 1880``` 1881 1882 1883## radio.getNrOptionMode<sup>8+</sup> 1884 1885getNrOptionMode(slotId?: number): Promise<NrOptionMode\> 1886 1887Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result. 1888 1889**System API**: This is a system API. 1890 1891**System capability**: SystemCapability.Telephony.CoreService 1892 1893**Parameters** 1894 1895| Name| Type | Mandatory| Description | 1896| ------ | ------ | ---- | -------------------------------------- | 1897| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1898 1899**Return value** 1900 1901| Type | Description | 1902| ----------------------------------------- | ----------------------- | 1903| Promise\<[NrOptionMode](#nroptionmode8)\> | Promise used to return the result.| 1904 1905**Error codes** 1906 1907For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1908 1909| ID| Error Message | 1910| -------- | -------------------------------------------- | 1911| 401 | Parameter error. | 1912| 8300001 | Invalid parameter value. | 1913| 8300002 | Operation failed. Cannot connect to service. | 1914| 8300003 | System internal error. | 1915| 8300999 | Unknown error code. | 1916 1917**Example** 1918 1919```js 1920let slotId = 0; 1921let promise = radio.getNrOptionMode(slotId); 1922promise.then(data => { 1923 console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`); 1924}).catch(err => { 1925 console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`); 1926}); 1927``` 1928 1929## radio.turnOnRadio<sup>7+</sup> 1930 1931turnOnRadio(callback: AsyncCallback<void\>): void 1932 1933Turns on the radio function. This API uses an asynchronous callback to return the result. 1934 1935**System API**: This is a system API. 1936 1937**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1938 1939**System capability**: SystemCapability.Telephony.CoreService 1940 1941**Parameters** 1942 1943| Name | Type | Mandatory| Description | 1944| -------- | --------------------- | ---- | ---------- | 1945| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| 1946 1947**Error codes** 1948 1949For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1950 1951| ID| Error Message | 1952| -------- | -------------------------------------------- | 1953| 201 | Permission denied. | 1954| 401 | Parameter error. | 1955| 8300001 | Invalid parameter value. | 1956| 8300002 | Operation failed. Cannot connect to service. | 1957| 8300003 | System internal error. | 1958| 8300999 | Unknown error code. | 1959 1960**Example** 1961 1962```js 1963radio.turnOnRadio((err) => { 1964 console.log(`callback: err->${JSON.stringify(err)}`); 1965}); 1966``` 1967 1968 1969## radio.turnOnRadio<sup>7+</sup> 1970 1971turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void 1972 1973Turns on the radio function for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 1974 1975**System API**: This is a system API. 1976 1977**Required permission**: ohos.permission.SET_TELEPHONY_STATE 1978 1979**System capability**: SystemCapability.Telephony.CoreService 1980 1981**Parameters** 1982 1983| Name | Type | Mandatory| Description | 1984| -------- | --------------------- | ---- | -------------------------------------- | 1985| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 1986| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | 1987 1988**Error codes** 1989 1990For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 1991 1992| ID| Error Message | 1993| -------- | -------------------------------------------- | 1994| 201 | Permission denied. | 1995| 401 | Parameter error. | 1996| 8300001 | Invalid parameter value. | 1997| 8300002 | Operation failed. Cannot connect to service. | 1998| 8300003 | System internal error. | 1999| 8300999 | Unknown error code. | 2000 2001**Example** 2002 2003```js 2004let slotId = 0; 2005radio.turnOnRadio(slotId, (err) => { 2006 console.log(`callback: err->${JSON.stringify(err)}`); 2007}); 2008``` 2009 2010 2011## radio.turnOnRadio<sup>7+</sup> 2012 2013turnOnRadio(slotId?: number): Promise<void\> 2014 2015Turns on the radio function for the SIM card in the specified slot. This API uses a promise to return the result. 2016 2017**System API**: This is a system API. 2018 2019**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2020 2021**System capability**: SystemCapability.Telephony.CoreService 2022 2023**Parameters** 2024 2025| Name| Type | Mandatory| Description | 2026| ------ | ------ | ---- | -------------------------------------- | 2027| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2028 2029**Return value** 2030 2031| Type | Description | 2032| --------------- | ----------------------- | 2033| Promise\<void\> | Promise used to return the result.| 2034 2035**Error codes** 2036 2037For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2038 2039| ID| Error Message | 2040| -------- | -------------------------------------------- | 2041| 201 | Permission denied. | 2042| 401 | Parameter error. | 2043| 8300001 | Invalid parameter value. | 2044| 8300002 | Operation failed. Cannot connect to service. | 2045| 8300003 | System internal error. | 2046| 8300999 | Unknown error code. | 2047 2048**Example** 2049 2050```js 2051let slotId = 0; 2052radio.turnOnRadio(slotId).then(() => { 2053 console.log(`turnOnRadio success.`); 2054}).catch((err) => { 2055 console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`); 2056}); 2057``` 2058 2059## radio.turnOffRadio<sup>7+</sup> 2060 2061turnOffRadio(callback: AsyncCallback<void\>): void 2062 2063Turns off the radio function. This API uses an asynchronous callback to return the result. 2064 2065**System API**: This is a system API. 2066 2067**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2068 2069**System capability**: SystemCapability.Telephony.CoreService 2070 2071**Parameters** 2072 2073| Name | Type | Mandatory| Description | 2074| -------- | --------------------- | ---- | ---------- | 2075| callback | AsyncCallback\<void\> | Yes | Callback used to return the result.| 2076 2077**Error codes** 2078 2079For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2080 2081| ID| Error Message | 2082| -------- | -------------------------------------------- | 2083| 201 | Permission denied. | 2084| 401 | Parameter error. | 2085| 8300001 | Invalid parameter value. | 2086| 8300002 | Operation failed. Cannot connect to service. | 2087| 8300003 | System internal error. | 2088| 8300999 | Unknown error code. | 2089 2090**Example** 2091 2092```js 2093radio.turnOffRadio((err) => { 2094 console.log(`callback: err->${JSON.stringify(err)}`); 2095}); 2096``` 2097 2098 2099## radio.turnOffRadio<sup>7+</sup> 2100 2101turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void 2102 2103Turns off the radio function for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2104 2105**System API**: This is a system API. 2106 2107**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2108 2109**System capability**: SystemCapability.Telephony.CoreService 2110 2111**Parameters** 2112 2113| Name | Type | Mandatory| Description | 2114| -------- | --------------------- | ---- | -------------------------------------- | 2115| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2116| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | 2117 2118**Error codes** 2119 2120For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2121 2122| ID| Error Message | 2123| -------- | -------------------------------------------- | 2124| 201 | Permission denied. | 2125| 401 | Parameter error. | 2126| 8300001 | Invalid parameter value. | 2127| 8300002 | Operation failed. Cannot connect to service. | 2128| 8300003 | System internal error. | 2129| 8300999 | Unknown error code. | 2130 2131**Example** 2132 2133```js 2134let slotId = 0; 2135radio.turnOffRadio(slotId, (err) => { 2136 console.log(`callback: err->${JSON.stringify(err)}`); 2137}); 2138``` 2139 2140 2141## radio.turnOffRadio<sup>7+</sup> 2142 2143turnOffRadio(slotId?: number): Promise<void\> 2144 2145Turns off the radio function for the SIM card in the specified slot. This API uses a promise to return the result. 2146 2147**System API**: This is a system API. 2148 2149**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2150 2151**System capability**: SystemCapability.Telephony.CoreService 2152 2153**Parameters** 2154 2155| Name| Type | Mandatory| Description | 2156| ------ | ------ | ---- | -------------------------------------- | 2157| slotId | number | No | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2158 2159**Return value** 2160 2161| Type | Description | 2162| --------------- | ----------------------- | 2163| Promise\<void\> | Promise used to return the result.| 2164 2165**Error codes** 2166 2167For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2168 2169| ID| Error Message | 2170| -------- | -------------------------------------------- | 2171| 201 | Permission denied. | 2172| 401 | Parameter error. | 2173| 8300001 | Invalid parameter value. | 2174| 8300002 | Operation failed. Cannot connect to service. | 2175| 8300003 | System internal error. | 2176| 8300999 | Unknown error code. | 2177 2178**Example** 2179 2180```js 2181let slotId = 0; 2182radio.turnOffRadio(slotId).then(() => { 2183 console.log(`turnOffRadio success.`); 2184}).catch((err) => { 2185 console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`); 2186}); 2187``` 2188 2189## radio.setPreferredNetwork<sup>8+</sup> 2190 2191setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void\>\): void 2192 2193Sets the preferred network for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2194 2195**System API**: This is a system API. 2196 2197**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2198 2199**System capability**: SystemCapability.Telephony.CoreService 2200 2201**Parameters** 2202 2203| Name | Type | Mandatory| Description | 2204| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | 2205| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2206| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes | Preferred network mode. | 2207| callback | AsyncCallback\<void\> | Yes | Callback used to return the result. | 2208 2209**Error codes** 2210 2211For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2212 2213| ID| Error Message | 2214| -------- | -------------------------------------------- | 2215| 201 | Permission denied. | 2216| 401 | Parameter error. | 2217| 8300001 | Invalid parameter value. | 2218| 8300002 | Operation failed. Cannot connect to service. | 2219| 8300003 | System internal error. | 2220| 8300999 | Unknown error code. | 2221 2222**Example** 2223 2224```js 2225let slotId = 0; 2226radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM, (err) => { 2227 console.log(`callback: err->${JSON.stringify(err)}`); 2228}); 2229``` 2230 2231## radio.setPreferredNetwork<sup>8+</sup> 2232 2233setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void\> 2234 2235Sets the preferred network for the SIM card in the specified slot. This API uses a promise to return the result. 2236 2237**System API**: This is a system API. 2238 2239**Required permission**: ohos.permission.SET_TELEPHONY_STATE 2240 2241**System capability**: SystemCapability.Telephony.CoreService 2242 2243**Parameters** 2244 2245| Name | Type | Mandatory| Description | 2246| ----------- | ---------------------------------------------- | ---- | -------------------------------------- | 2247| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2248| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes | Preferred network mode. | 2249 2250**Return value** 2251 2252| Type | Description | 2253| --------------- | ----------------------- | 2254| Promise\<void\> | Promise used to return the result.| 2255 2256**Error codes** 2257 2258For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2259 2260| ID| Error Message | 2261| -------- | -------------------------------------------- | 2262| 201 | Permission denied. | 2263| 401 | Parameter error. | 2264| 8300001 | Invalid parameter value. | 2265| 8300002 | Operation failed. Cannot connect to service. | 2266| 8300003 | System internal error. | 2267| 8300999 | Unknown error code. | 2268 2269**Example** 2270 2271```js 2272let slotId = 0; 2273radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM).then(() => { 2274 console.log(`setPreferredNetwork success.`); 2275}).catch((err) => { 2276 console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`); 2277}); 2278``` 2279 2280## radio.getPreferredNetwork<sup>8+</sup> 2281 2282getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMode\>\): void 2283 2284Obtains the preferred network for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2285 2286**System API**: This is a system API. 2287 2288**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2289 2290**System capability**: SystemCapability.Telephony.CoreService 2291 2292**Parameters** 2293 2294| Name | Type | Mandatory| Description | 2295| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- | 2296| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2297| callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | Yes | Callback used to return the result. | 2298 2299**Error codes** 2300 2301For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2302 2303| ID| Error Message | 2304| -------- | -------------------------------------------- | 2305| 201 | Permission denied. | 2306| 401 | Parameter error. | 2307| 8300001 | Invalid parameter value. | 2308| 8300002 | Operation failed. Cannot connect to service. | 2309| 8300003 | System internal error. | 2310| 8300999 | Unknown error code. | 2311 2312**Example** 2313 2314```js 2315radio.getPreferredNetwork(0, (err, data) => { 2316 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2317}); 2318``` 2319 2320## radio.getPreferredNetwork<sup>8+</sup> 2321 2322getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\> 2323 2324Obtains the preferred network for the SIM card in the specified slot. This API uses a promise to return the result. 2325 2326**System API**: This is a system API. 2327 2328**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2329 2330**System capability**: SystemCapability.Telephony.CoreService 2331 2332**Parameters** 2333 2334| Name| Type | Mandatory| Description | 2335| ------ | ------ | ---- | -------------------------------------- | 2336| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2337 2338**Return value** 2339 2340| Type | Description | 2341| --------------- | ----------------------- | 2342| Promise\<void\> | Promise used to return the result.| 2343 2344**Error codes** 2345 2346For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2347 2348| ID| Error Message | 2349| -------- | -------------------------------------------- | 2350| 201 | Permission denied. | 2351| 401 | Parameter error. | 2352| 8300001 | Invalid parameter value. | 2353| 8300002 | Operation failed. Cannot connect to service. | 2354| 8300003 | System internal error. | 2355| 8300999 | Unknown error code. | 2356 2357**Example** 2358 2359```js 2360let promise = radio.getPreferredNetwork(0); 2361promise.then(data => { 2362 console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`); 2363}).catch(err => { 2364 console.log(`getPreferredNetwork failed, promise: err->${JSON.stringify(err)}`); 2365}); 2366``` 2367 2368## radio.getImsRegInfo<sup>9+</sup> 2369 2370getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo\>): void 2371 2372Obtains the IMS registration status of the specified IMS service type for the SIM card in the specified slot. This API uses an asynchronous callback to return the result. 2373 2374**System API**: This is a system API. 2375 2376**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2377 2378**System capability**: SystemCapability.Telephony.CoreService 2379 2380**Parameters** 2381 2382| Name | Type | Mandatory| Description | 2383| -------- | ------------------------------------------ | ---- | -------------------------------------- | 2384| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2385| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | 2386| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes | Callback used to return the result. | 2387 2388**Error codes** 2389 2390For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2391 2392| ID| Error Message | 2393| -------- | -------------------------------------------- | 2394| 201 | Permission denied. | 2395| 401 | Parameter error. | 2396| 8300001 | Invalid parameter value. | 2397| 8300002 | Operation failed. Cannot connect to service. | 2398| 8300003 | System internal error. | 2399| 8300999 | Unknown error code. | 2400 2401**Example** 2402 2403```js 2404radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => { 2405 console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); 2406}); 2407``` 2408 2409## radio.getImsRegInfo<sup>9+</sup> 2410 2411getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\> 2412 2413Obtains the IMS registration status of the specified IMS service type for the SIM card in the specified slot. This API uses a promise to return the result. 2414 2415**System API**: This is a system API. 2416 2417**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2418 2419**System capability**: SystemCapability.Telephony.CoreService 2420 2421**Parameters** 2422 2423| Name | Type | Mandatory| Description | 2424| ------- | ---------------------------------- | ---- | -------------------------------------- | 2425| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2426| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | 2427 2428**Return value** 2429 2430| Type | Description | 2431| ------------------------------------- | ----------------------- | 2432| Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.| 2433 2434**Error codes** 2435 2436For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2437 2438| ID| Error Message | 2439| -------- | -------------------------------------------- | 2440| 201 | Permission denied. | 2441| 401 | Parameter error. | 2442| 8300001 | Invalid parameter value. | 2443| 8300002 | Operation failed. Cannot connect to service. | 2444| 8300003 | System internal error. | 2445| 8300999 | Unknown error code. | 2446 2447**Example** 2448 2449```js 2450let promise = radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO); 2451promise.then(data => { 2452 console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`); 2453}).catch(err => { 2454 console.log(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`); 2455}); 2456``` 2457 2458## radio.on('imsRegStateChange')<sup>9+</sup> 2459 2460on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback<ImsRegInfo\>): void 2461 2462Enables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result. 2463 2464**System API**: This is a system API. 2465 2466**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2467 2468**System capability**: SystemCapability.Telephony.CoreService 2469 2470**Parameters** 2471 2472| Name | Type | Mandatory| Description | 2473| -------- | ------------------------------------ | ---- | -------------------------------------- | 2474| type | string | Yes | IMS registration status changes. | 2475| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2476| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | 2477| callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes | Callback used to return the result. | 2478 2479**Error codes** 2480 2481For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2482 2483| ID| Error Message | 2484| -------- | -------------------------------------------- | 2485| 201 | Permission denied. | 2486| 401 | Parameter error. | 2487| 8300001 | Invalid parameter value. | 2488| 8300002 | Operation failed. Cannot connect to service. | 2489| 8300003 | System internal error. | 2490| 8300999 | Unknown error code. | 2491 2492**Example** 2493 2494```js 2495radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => { 2496 console.log(`callback: data->${JSON.stringify(data)}`); 2497}); 2498``` 2499 2500## radio.off('imsRegStateChange')<sup>9+</sup> 2501 2502off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback<ImsRegInfo\>): void 2503 2504Disables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result. 2505 2506**System API**: This is a system API. 2507 2508**Required permission**: ohos.permission.GET_TELEPHONY_STATE 2509 2510**System capability**: SystemCapability.Telephony.CoreService 2511 2512**Parameters** 2513 2514| Name | Type | Mandatory| Description | 2515| -------- | ------------------------------------ | ---- | -------------------------------------- | 2516| type | string | Yes | IMS registration status changes. | 2517| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2518| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. | 2519| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No | Callback used to return the result. | 2520 2521**Error codes** 2522 2523For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md). 2524 2525| ID| Error Message | 2526| -------- | -------------------------------------------- | 2527| 201 | Permission denied. | 2528| 401 | Parameter error. | 2529| 8300001 | Invalid parameter value. | 2530| 8300002 | Operation failed. Cannot connect to service. | 2531| 8300003 | System internal error. | 2532| 8300999 | Unknown error code. | 2533 2534**Example** 2535 2536```js 2537radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => { 2538 console.log(`callback: data->${JSON.stringify(data)}`); 2539}); 2540``` 2541 2542## RadioTechnology 2543 2544 Enumerates radio access technologies. 2545 2546**System capability**: SystemCapability.Telephony.CoreService 2547 2548| Name | Value | Description | 2549| ------------------------- | ---- | ------------------------------------------------------------ | 2550| RADIO_TECHNOLOGY_UNKNOWN | 0 | Unknown RAT | 2551| RADIO_TECHNOLOGY_GSM | 1 | Global System for Mobile Communication (GSM) | 2552| RADIO_TECHNOLOGY_1XRTT | 2 | Single-Carrier Radio Transmission Technology (1XRTT)| 2553| RADIO_TECHNOLOGY_WCDMA | 3 | Wideband Code Division Multiple Access (WCDMA)| 2554| RADIO_TECHNOLOGY_HSPA | 4 | High Speed Packet Access (HSPA) | 2555| RADIO_TECHNOLOGY_HSPAP | 5 | Evolved High Speed Packet Access (HSPA+) | 2556| RADIO_TECHNOLOGY_TD_SCDMA | 6 | Time Division Synchronous Code Division Multiple Access (TD-SCDMA)| 2557| RADIO_TECHNOLOGY_EVDO | 7 | Evolution-Data Optimized (EVDO) | 2558| RADIO_TECHNOLOGY_EHRPD | 8 | Evolved High Rate Package Data (EHRPD) | 2559| RADIO_TECHNOLOGY_LTE | 9 | Long Term Evolution (LTE) | 2560| RADIO_TECHNOLOGY_LTE_CA | 10 | Long Term Evolution_Carrier Aggregation (LTE_CA)| 2561| RADIO_TECHNOLOGY_IWLAN | 11 | Industrial Wireless LAN (IWLAN) | 2562| RADIO_TECHNOLOGY_NR | 12 | New Radio (NR) | 2563 2564 2565## SignalInformation 2566 2567Defines the signal strength. 2568 2569**System capability**: SystemCapability.Telephony.CoreService 2570 2571| Name | Type | Mandatory| Description | 2572| --------------- | --------------------------- | ---- | ------------------ | 2573| signalType | [NetworkType](#networktype) | Yes | Signal strength type.| 2574| signalLevel | number | Yes | Signal strength level.| 2575| dBm<sup>9+</sup>| number | Yes | Signal strength, in dBm. | 2576 2577## NetworkType 2578 2579Enumerates network types. 2580 2581**System capability**: SystemCapability.Telephony.CoreService 2582 2583| Name | Value | Description | 2584| -------------------- | ---- | ------------------------------------------------------------ | 2585| NETWORK_TYPE_UNKNOWN | 0 | Unknown network. | 2586| NETWORK_TYPE_GSM | 1 | GSM network. | 2587| NETWORK_TYPE_CDMA | 2 | CDMA network. | 2588| NETWORK_TYPE_WCDMA | 3 | WCDMA network. | 2589| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network.| 2590| NETWORK_TYPE_LTE | 5 | LTE network. | 2591| NETWORK_TYPE_NR | 6 | 5G NR network. | 2592 2593## NetworkState 2594 2595Defines the network status. 2596 2597**System capability**: SystemCapability.Telephony.CoreService 2598 2599| Name | Type | Mandatory| Description | 2600| -------------------- | ----------------------------------- | ---- | ------------------------------------------------------------ | 2601| longOperatorName | string | Yes | Long carrier name of the registered network. | 2602| shortOperatorName | string | Yes | Short carrier name of the registered network. | 2603| plmnNumeric | string | Yes | PLMN code of the registered network. | 2604| isRoaming | boolean | Yes | Whether the user is roaming. | 2605| regState | [RegState](#regstate) | Yes | Network registration status of the device. | 2606| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) | Yes | RAT of the device. | 2607| nsaState | [NsaState](#nsastate) | Yes | NSA network registration status of the device. | 2608| isCaActive | boolean | Yes | CA status. | 2609| isEmergency | boolean | Yes | Whether only emergency calls are allowed. | 2610 2611 2612## RegState 2613 2614Defines the network status. 2615 2616**System capability**: SystemCapability.Telephony.CoreService 2617 2618| Name | Value | Description | 2619| ----------------------------- | ---- | -------------------------- | 2620| REG_STATE_NO_SERVICE | 0 | The device cannot use any services, including data, SMS, and call services. | 2621| REG_STATE_IN_SERVICE | 1 | The device can use services properly, including data, SMS, and call services. | 2622| REG_STATE_EMERGENCY_CALL_ONLY | 2 | The device can use only the emergency call service.| 2623| REG_STATE_POWER_OFF | 3 | The device cannot communicate with the network because the cellular radio service is disabled or the modem is powered off. | 2624 2625 2626## NsaState 2627 2628Enumerates NSA network states. 2629 2630**System capability**: SystemCapability.Telephony.CoreService 2631 2632| Name | Value | Description | 2633| -------------------------- | ---- | ---------------------------------------------------------- | 2634| NSA_STATE_NOT_SUPPORT | 1 | The device is in idle or connected state in an LTE cell that does not support NSA. | 2635| NSA_STATE_NO_DETECT | 2 | The device is in the idle state in an LTE cell that supports NSA but not NR coverage detection.| 2636| NSA_STATE_CONNECTED_DETECT | 3 | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection. | 2637| NSA_STATE_IDLE_DETECT | 4 | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection. | 2638| NSA_STATE_DUAL_CONNECTED | 5 | The device is connected to the LTE/NR network in an LTE cell that supports NSA. | 2639| NSA_STATE_SA_ATTACHED | 6 | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core. | 2640 2641 2642## NetworkSelectionMode 2643 2644Enumerates network selection modes. 2645 2646**System capability**: SystemCapability.Telephony.CoreService 2647 2648| Name | Value | Description | 2649| --------------------------- | ---- | -------------- | 2650| NETWORK_SELECTION_UNKNOWN | 0 | Unknown network selection mode.| 2651| NETWORK_SELECTION_AUTOMATIC | 1 | Automatic network selection mode.| 2652| NETWORK_SELECTION_MANUAL | 2 | Manual network selection mode.| 2653 2654## PreferredNetworkMode<sup>8+</sup> 2655 2656Enumerates preferred network modes. 2657 2658**System API**: This is a system API. 2659 2660**System capability**: SystemCapability.Telephony.CoreService 2661 2662| Name | Value | Description | 2663| --------------------------------------------------------- | ---- | --------------------------------------------- | 2664| PREFERRED_NETWORK_MODE_GSM | 1 | GSM network mode. | 2665| PREFERRED_NETWORK_MODE_WCDMA | 2 | WCDMA network mode. | 2666| PREFERRED_NETWORK_MODE_LTE | 3 | LTE network mode. | 2667| PREFERRED_NETWORK_MODE_LTE_WCDMA | 4 | LTE+WCDMA network mode. | 2668| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM | 5 | LTE+WCDMA+GSM network mode. | 2669| PREFERRED_NETWORK_MODE_WCDMA_GSM | 6 | WCDMA+GSM network mode. | 2670| PREFERRED_NETWORK_MODE_CDMA | 7 | CDMA network mode. | 2671| PREFERRED_NETWORK_MODE_EVDO | 8 | EVDO network mode. | 2672| PREFERRED_NETWORK_MODE_EVDO_CDMA | 9 | EVDO+CDMA network mode. | 2673| PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA | 10 | WCDMA+GSM+EVDO+CDMA network mode. | 2674| PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA | 11 | LTE+EVDO+CDMA network mode. | 2675| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA | 12 | LTE+WCDMA+GSM+EVDO+CDMA network mode. | 2676| PREFERRED_NETWORK_MODE_TDSCDMA | 13 | TD-SCDMA network mode. | 2677| PREFERRED_NETWORK_MODE_TDSCDMA_GSM | 14 | TD-SCDMA+GSM network mode. | 2678| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA | 15 | TD-SCDMA+WCDMA network mode. | 2679| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM | 16 | TD-SCDMA+WCDMA+GSM network mode. | 2680| PREFERRED_NETWORK_MODE_LTE_TDSCDMA | 17 | LTE+TD-SCDMA network mode. | 2681| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM | 18 | LTE+TD-SCDMA+GSM network mode. | 2682| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA | 19 | LTE+TD-SCDMA+WCDMA network mode. | 2683| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM | 20 | LTE+TD-SCDMA+WCDMA+GSM network mode. | 2684| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 21 | TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode. | 2685| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 22 | LTE+TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.| 2686| PREFERRED_NETWORK_MODE_NR | 31 | NR network mode. | 2687| PREFERRED_NETWORK_MODE_NR_LTE | 32 | NR+LTE network mode. | 2688| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA | 33 | NR+LTE+WCDMA network mode. | 2689| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM | 34 | NR+LTE+WCDMA+GSM network mode. | 2690| PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA | 35 | NR+LTE+EVDO+CDMA network mode. | 2691| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA | 36 | NR+LTE+WCDMA+GSM+EVDO+CDMA network mode. | 2692| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA | 37 | NR+LTE+TD-SCDMA network mode. | 2693| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM | 38 | NR+LTE+TD-SCDMA+GSM network mode. | 2694| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA | 39 | NR+LTE+TD-SCDMA+WCDMA network mode. | 2695| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM | 40 | NR+LTE+TD-SCDMA+WCDMA+GSM network mode. | 2696| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 41 | NR+LTE+TD-SCDMA+WCDMA+GSM network mode. | 2697| PREFERRED_NETWORK_MODE_MAX_VALUE | 99 | Maximum value of the preferred network mode. | 2698 2699## CellInformation<sup>8+</sup> 2700 2701Defines the cell information. 2702 2703**System API**: This is a system API. 2704 2705**System capability**: SystemCapability.Telephony.CoreService 2706 2707| Name | Type | Mandatory| Description | 2708| ----------------- | --------------------------------------- | ---- | ------------------------------------------------------------ | 2709| networkType | [NetworkType](#networktype) | Yes | Network type of the cell. | 2710| isCamped | boolean | Yes | Cell status. | 2711| timeStamp | number | Yes | Timestamp when cell information is obtained. | 2712| signalInformation | [SignalInformation](#signalinformation) | Yes | Signal information. | 2713| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | Yes | CDMA cell information\|GSM cell information\|LTE cell information\|NR cell information\|TD-SCDMA cell information| 2714 2715## CdmaCellInformation<sup>8+</sup> 2716 2717Defines the CDMA cell information. 2718 2719**System API**: This is a system API. 2720 2721**System capability**: SystemCapability.Telephony.CoreService 2722 2723| Name | Type | Mandatory| Description | 2724| --------- | ------ | ---- | ------------ | 2725| baseId | number | Yes | Base station ID. | 2726| latitude | number | Yes | Longitude. | 2727| longitude | number | Yes | Latitude. | 2728| nid | number | Yes | Network ID.| 2729| sid | number | Yes | System ID.| 2730 2731## GsmCellInformation<sup>8+</sup> 2732 2733Defines the GSM cell information. 2734 2735**System API**: This is a system API. 2736 2737**System capability**: SystemCapability.Telephony.CoreService 2738 2739| Name | Type | Mandatory| Description | 2740| ------ | ------ | ---- | -------------------- | 2741| lac | number | Yes | Location area code. | 2742| cellId | number | Yes | Cell ID. | 2743| arfcn | number | Yes | Absolute radio frequency channel number.| 2744| bsic | number | Yes | Base station ID. | 2745| mcc | string | Yes | Mobile country code. | 2746| mnc | string | Yes | Mobile network code. | 2747 2748## LteCellInformation<sup>8+</sup> 2749 2750LTE cell information. 2751 2752**System API**: This is a system API. 2753 2754**System capability**: SystemCapability.Telephony.CoreService 2755 2756| Name | Type | Mandatory| Description | 2757| ------------- | ------- | ---- | ----------------------- | 2758| cgi | number | Yes | Cell global identification. | 2759| pci | number | Yes | Physical cell ID. | 2760| tac | number | Yes | Tracking area code. | 2761| earfcn | number | Yes | Absolute radio frequency channel number. | 2762| bandwidth | number | Yes | Bandwidth. | 2763| mcc | string | Yes | Mobile country code. | 2764| mnc | string | Yes | Mobile network code. | 2765| isSupportEndc | boolean | Yes | Support for New Radio_Dual Connectivity.| 2766 2767## NrCellInformation<sup>8+</sup> 2768 2769Defines the 5G NR cell information. 2770 2771**System API**: This is a system API. 2772 2773**System capability**: SystemCapability.Telephony.CoreService 2774 2775| Name | Type | Mandatory| Description | 2776| ------- | ------ | ---- | ---------------- | 2777| nrArfcn | number | Yes | 5G frequency number. | 2778| pci | number | Yes | Physical cell ID. | 2779| tac | number | Yes | Tracking area code. | 2780| nci | number | Yes | 5G network cell ID.| 2781| mcc | string | Yes | Mobile country code. | 2782| mnc | string | Yes | Mobile network code. | 2783 2784## TdscdmaCellInformation<sup>8+</sup> 2785 2786Defines the TD-SCDMA cell information. 2787 2788**System API**: This is a system API. 2789 2790**System capability**: SystemCapability.Telephony.CoreService 2791 2792| Name | Type | Mandatory| Description | 2793| ------ | ------ | ---- | ------------ | 2794| lac | number | Yes | Location area code.| 2795| cellId | number | Yes | Cell ID. | 2796| cpid | number | Yes | Cell parameter ID.| 2797| uarfcn | number | Yes | Absolute radio frequency number.| 2798| mcc | string | Yes | Mobile country code.| 2799| mnc | string | Yes | Mobile network code. | 2800 2801## WcdmaCellInformation<sup>8+</sup> 2802 2803Defines the WCDMA cell information. 2804 2805**System API**: This is a system API. 2806 2807**System capability**: SystemCapability.Telephony.CoreService 2808 2809| Name | Type | Mandatory| Description | 2810| ------ | ------ | ---- | ------------ | 2811| lac | number | Yes | Location area code.| 2812| cellId | number | Yes | Cell ID. | 2813| psc | number | Yes | Primary scrambling code. | 2814| uarfcn | number | Yes | Absolute radio frequency number.| 2815| mcc | string | Yes | Mobile country code.| 2816| mnc | string | Yes | Mobile network code. | 2817 2818## NrOptionMode<sup>8+</sup> 2819 2820Enumerates NR selection modes. 2821 2822**System API**: This is a system API. 2823 2824**System capability**: SystemCapability.Telephony.CoreService 2825 2826| Name | Value | Description | 2827| -------------------- | ---- | ---------------------------------- | 2828| NR_OPTION_UNKNOWN | 0 | Unknown NR selection mode. | 2829| NR_OPTION_NSA_ONLY | 1 | NR selection mode in 5G non-standalone networking. | 2830| NR_OPTION_SA_ONLY | 2 | NR selection mode in 5G non-standalone networking. | 2831| NR_OPTION_NSA_AND_SA | 3 | NR selection mode in non-standalone and standalone networking.| 2832 2833## NetworkSearchResult 2834 2835Defines the network search result. 2836 2837**System API**: This is a system API. 2838 2839**System capability**: SystemCapability.Telephony.CoreService 2840 2841| Name | Type | Mandatory| Description | 2842| ---------------------- | ------------------------------------------------- | ---- | -------------- | 2843| isNetworkSearchSuccess | boolean | Yes | Successful network search.| 2844| networkSearchResult | Array<[NetworkInformation](#networkinformation)\> | Yes | Network search result.| 2845 2846## NetworkInformation 2847 2848Defines the network information. 2849 2850**System API**: This is a system API. 2851 2852**System capability**: SystemCapability.Telephony.CoreService 2853 2854| Name | Type | Mandatory| Description | 2855| --------------- | --------------------------------------------------- | ---- | -------------- | 2856| operatorName | string | Yes | Carrier name.| 2857| operatorNumeric | string | Yes | Carrier number. | 2858| state | [NetworkInformationState](#networkinformationstate) | Yes | Network information status.| 2859| radioTech | string | Yes | Radio access technology. | 2860 2861## NetworkInformationState 2862 2863Enumerates network information states. 2864 2865**System API**: This is a system API. 2866 2867**System capability**: SystemCapability.Telephony.CoreService 2868 2869| Name | Value | Description | 2870| ----------------- | ---- | ---------------- | 2871| NETWORK_UNKNOWN | 0 | Unknown state. | 2872| NETWORK_AVAILABLE | 1 | Available for registration.| 2873| NETWORK_CURRENT | 2 | Registered state.| 2874| NETWORK_FORBIDDEN | 3 | Unavailable for registration. | 2875 2876## NetworkSelectionModeOptions 2877 2878Defines the network selection mode. 2879 2880**System API**: This is a system API. 2881 2882**System capability**: SystemCapability.Telephony.CoreService 2883 2884| Name | Type | Mandatory| Description | 2885| ------------------ | --------------------------------------------- | ---- | -------------------------------------- | 2886| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2| 2887| selectMode | [NetworkSelectionMode](#networkselectionmode) | Yes | Network selection mode. | 2888| networkInformation | [NetworkInformation](#networkinformation) | Yes | Network information. | 2889| resumeSelection | boolean | Yes | Whether to resume selection. | 2890 2891## ImsRegState<sup>9+</sup> 2892 2893Enumerates IMS registration states. 2894 2895**System API**: This is a system API. 2896 2897**System capability**: SystemCapability.Telephony.CoreService 2898 2899| Name | Value | Description | 2900| ---------------- | ---- | -------- | 2901| IMS_UNREGISTERED | 0 | Not registered.| 2902| IMS_REGISTERED | 1 | Registered.| 2903 2904## ImsRegTech<sup>9+</sup> 2905 2906Enumerates IMS registration technologies. 2907 2908**System API**: This is a system API. 2909 2910**System capability**: SystemCapability.Telephony.CoreService 2911 2912| Name | Value | Description | 2913| ----------------------- | ---- | --------------- | 2914| REGISTRATION_TECH_NONE | 0 | None. | 2915| REGISTRATION_TECH_LTE | 1 | LTE. | 2916| REGISTRATION_TECH_IWLAN | 2 | I-WLAN.| 2917| REGISTRATION_TECH_NR | 3 | NR. | 2918 2919## ImsRegInfo<sup>9+</sup> 2920 2921Defines the IMS registration information. 2922 2923**System API**: This is a system API. 2924 2925**System capability**: SystemCapability.Telephony.CoreService 2926 2927| Name | Type | Mandatory| Description | 2928| ----------- | ---------------------------- | ---- | ------------- | 2929| imsRegState | [ImsRegState](#imsregstate9) | Yes | IMS registration state.| 2930| imsRegTech | [ImsRegTech](#imsregtech9) | Yes | IMS registration technology.| 2931 2932## ImsServiceType<sup>9+</sup> 2933 2934Enumerates IMS service types. 2935 2936**System API**: This is a system API. 2937 2938**System capability**: SystemCapability.Telephony.CoreService 2939 2940| Name | Value | Description | 2941| ---------- | ---- | ---------- | 2942| TYPE_VOICE | 0 | Voice service.| 2943| TYPE_VIDEO | 1 | Video service.| 2944| TYPE_UT | 2 | UT service. | 2945| TYPE_SMS | 3 | SMS service.| 2946