js-apis-radio.md 110.6 KB
Newer Older
S
shawn_he 已提交
1
# @ohos.telephony.radio (Network Search)
S
shawn_he 已提交
2

S
shawn_he 已提交
3
The **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.
S
shawn_he 已提交
4

S
shawn_he 已提交
5
>**NOTE**
S
shawn_he 已提交
6
>
Z
zengyawen 已提交
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.
S
shawn_he 已提交
8 9 10 11


## Modules to Import

S
shawn_he 已提交
12
```
S
shawn_he 已提交
13 14 15
import radio from '@ohos.telephony.radio'
```

S
shawn_he 已提交
16
## radio.getRadioTech
S
shawn_he 已提交
17 18 19

getRadioTech\(slotId: number, callback: AsyncCallback<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>\): void

S
shawn_he 已提交
20
Obtains 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.
S
shawn_he 已提交
21

S
shawn_he 已提交
22 23 24
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
25

S
shawn_he 已提交
26
**Parameters**
S
shawn_he 已提交
27

S
shawn_he 已提交
28
| Name  | Type                                                        | Mandatory| Description                                  |
S
shawn_he 已提交
29
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
S
shawn_he 已提交
30
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
31
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech:[RadioTechnology](#radiotechnology)}\> | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
32

S
shawn_he 已提交
33 34 35 36 37 38 39 40 41 42 43
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
44
**Example**
S
shawn_he 已提交
45

S
shawn_he 已提交
46
```js
S
shawn_he 已提交
47 48 49 50 51
let slotId = 0;
radio.getRadioTech(slotId, (err, data) =>{ 
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
52 53


S
shawn_he 已提交
54
## radio.getRadioTech
S
shawn_he 已提交
55 56 57

getRadioTech\(slotId: number\): Promise<\{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology\}\>

S
shawn_he 已提交
58
Obtains 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.
S
shawn_he 已提交
59

S
shawn_he 已提交
60 61 62
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
63

S
shawn_he 已提交
64
**Parameters**
S
shawn_he 已提交
65

S
shawn_he 已提交
66
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
67
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
68
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
69

S
shawn_he 已提交
70
**Return value**
S
shawn_he 已提交
71

S
shawn_he 已提交
72
| Type                                                        | Description                                           |
S
shawn_he 已提交
73
| ------------------------------------------------------------ | ----------------------------------------------- |
S
shawn_he 已提交
74
| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.|
S
shawn_he 已提交
75

S
shawn_he 已提交
76 77 78 79 80 81 82 83 84 85 86
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
87
**Example**
S
shawn_he 已提交
88

S
shawn_he 已提交
89
```js
S
shawn_he 已提交
90 91 92 93 94
let slotId = 0;
let promise = radio.getRadioTech(slotId);
promise.then(data => {
    console.log(`getRadioTech success, data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
95
    console.log(`getRadioTech failed, err->${JSON.stringify(err)}`);
S
shawn_he 已提交
96 97
});
```
S
shawn_he 已提交
98 99


S
shawn_he 已提交
100
## radio.getNetworkState
S
shawn_he 已提交
101 102 103

getNetworkState\(callback: AsyncCallback<NetworkState\>\): void

S
shawn_he 已提交
104
Obtains the network status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
105

S
shawn_he 已提交
106 107 108
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
109

S
shawn_he 已提交
110
**Parameters**
S
shawn_he 已提交
111

S
shawn_he 已提交
112
| Name  | Type                                          | Mandatory| Description      |
S
shawn_he 已提交
113
| -------- | ---------------------------------------------- | ---- | ---------- |
S
shawn_he 已提交
114
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
115

S
shawn_he 已提交
116 117 118 119 120 121 122 123 124 125 126
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
127
**Example**
S
shawn_he 已提交
128

S
shawn_he 已提交
129
```js
S
shawn_he 已提交
130 131 132 133
radio.getNetworkState((err, data) =>{
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
134 135


S
shawn_he 已提交
136
## radio.getNetworkState
S
shawn_he 已提交
137 138 139

getNetworkState\(slotId: number, callback: AsyncCallback<NetworkState\>\): void

S
shawn_he 已提交
140
Obtains the network status. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
141

S
shawn_he 已提交
142 143 144
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
145

S
shawn_he 已提交
146
**Parameters**
S
shawn_he 已提交
147

S
shawn_he 已提交
148
| Name  | Type                                          | Mandatory| Description                                  |
S
shawn_he 已提交
149
| -------- | ---------------------------------------------- | ---- | -------------------------------------- |
S
shawn_he 已提交
150
| slotId   | number                                         | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
151
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
152

S
shawn_he 已提交
153 154 155 156 157 158 159 160 161 162 163
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
164
**Example**
S
shawn_he 已提交
165

S
shawn_he 已提交
166
```js
S
shawn_he 已提交
167 168 169 170 171
let slotId = 0;
radio.getNetworkState(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
172 173


S
shawn_he 已提交
174
## radio.getNetworkState
S
shawn_he 已提交
175 176 177

getNetworkState\(slotId?: number\): Promise<NetworkState\>

S
shawn_he 已提交
178
Obtains the network status. This API uses a promise to return the result.
S
shawn_he 已提交
179

S
shawn_he 已提交
180 181 182
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
183

S
shawn_he 已提交
184
**Parameters**
S
shawn_he 已提交
185

S
shawn_he 已提交
186
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
187
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
188
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
189

S
shawn_he 已提交
190
**Return value**
S
shawn_he 已提交
191

S
shawn_he 已提交
192
| Type                                    | Description                       |
S
shawn_he 已提交
193
| ---------------------------------------- | --------------------------- |
S
shawn_he 已提交
194
| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.|
S
shawn_he 已提交
195

S
shawn_he 已提交
196 197 198 199 200 201 202 203 204 205 206
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
207
**Example**
S
shawn_he 已提交
208

S
shawn_he 已提交
209
```js
S
shawn_he 已提交
210 211 212 213 214
let slotId = 0;
let promise = radio.getNetworkState(slotId);
promise.then(data => {
    console.log(`getNetworkState success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
215
    console.log(`getNetworkState failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
216 217
});
```
S
shawn_he 已提交
218 219


S
shawn_he 已提交
220
## radio.getNetworkSelectionMode
S
shawn_he 已提交
221 222 223

getNetworkSelectionMode\(slotId: number, callback: AsyncCallback<NetworkSelectionMode\>\): void

S
shawn_he 已提交
224
Obtains the network selection mode of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
225

S
shawn_he 已提交
226 227
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
228
**Parameters**
S
shawn_he 已提交
229

S
shawn_he 已提交
230
| Name  | Type                                                        | Mandatory| Description                                  |
S
shawn_he 已提交
231
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
S
shawn_he 已提交
232
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
233
| callback | AsyncCallback\<[NetworkSelectionMode](#networkselectionmode)\> | Yes  | Callback used to return the result.                            |
S
shawn_he 已提交
234

S
shawn_he 已提交
235 236 237 238 239 240 241 242 243 244
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
245
**Example**
S
shawn_he 已提交
246

S
shawn_he 已提交
247
```js
S
shawn_he 已提交
248 249 250 251 252
let slotId = 0;
radio.getNetworkSelectionMode(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
253 254


S
shawn_he 已提交
255
## radio.getNetworkSelectionMode
S
shawn_he 已提交
256 257 258

getNetworkSelectionMode\(slotId: number\): Promise<NetworkSelectionMode\>

S
shawn_he 已提交
259
Obtains the network selection mode of the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
260

S
shawn_he 已提交
261 262
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
263
**Parameters**
S
shawn_he 已提交
264

S
shawn_he 已提交
265
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
266
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
267
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
268

S
shawn_he 已提交
269
**Return value**
S
shawn_he 已提交
270

S
shawn_he 已提交
271
| Type                                                    | Description                           |
S
shawn_he 已提交
272
| -------------------------------------------------------- | ------------------------------- |
S
shawn_he 已提交
273
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.|
S
shawn_he 已提交
274

S
shawn_he 已提交
275 276 277 278 279 280 281 282 283 284
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
285
**Example**
S
shawn_he 已提交
286

S
shawn_he 已提交
287
```js
S
shawn_he 已提交
288 289 290 291 292
let slotId = 0;
let promise = radio.getNetworkSelectionMode(slotId);
promise.then(data => {
    console.log(`getNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
293
    console.log(`getNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
294 295
});
```
S
shawn_he 已提交
296 297


S
shawn_he 已提交
298
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
299 300 301

getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback<string\>\): void

S
shawn_he 已提交
302
Obtains 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.
S
shawn_he 已提交
303

S
shawn_he 已提交
304 305
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
306
**Parameters**
S
shawn_he 已提交
307

S
shawn_he 已提交
308
| Name  | Type                   | Mandatory| Description                                    |
S
shawn_he 已提交
309
| -------- | ----------------------- | ---- | ---------------------------------------- |
S
shawn_he 已提交
310
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2  |
S
shawn_he 已提交
311
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result, which is an ISO country code, for example, **CN** (China).|
S
shawn_he 已提交
312

S
shawn_he 已提交
313 314 315 316 317 318 319 320 321 322
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
323
**Example**
S
shawn_he 已提交
324

S
shawn_he 已提交
325
```js
S
shawn_he 已提交
326 327 328 329 330
let slotId = 0;
radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
331 332


S
shawn_he 已提交
333
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
334 335 336

getISOCountryCodeForNetwork\(slotId: number\): Promise<string\>

S
shawn_he 已提交
337
Obtains 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.
S
shawn_he 已提交
338

S
shawn_he 已提交
339 340
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
341
**Parameters**
S
shawn_he 已提交
342

S
shawn_he 已提交
343
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
344
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
345
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
346

S
shawn_he 已提交
347
**Return value**
S
shawn_he 已提交
348

S
shawn_he 已提交
349
| Type             | Description                                                        |
S
shawn_he 已提交
350 351
| ----------------- | ------------------------------------------------------------ |
| Promise\<string\> | Promise used to return the result, which is an ISO country code, for example, **CN** (China).|
S
shawn_he 已提交
352

S
shawn_he 已提交
353 354 355 356 357 358 359 360 361 362
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
363
**Example**
S
shawn_he 已提交
364

S
shawn_he 已提交
365
```js
S
shawn_he 已提交
366 367 368 369 370
let slotId = 0;
let promise = radio.getISOCountryCodeForNetwork(slotId);
promise.then(data => {
    console.log(`getISOCountryCodeForNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
371
    console.log(`getISOCountryCodeForNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
372 373
});
```
S
shawn_he 已提交
374 375


S
shawn_he 已提交
376 377 378 379 380 381 382 383 384 385 386 387
## radio.getPrimarySlotId<sup>7+</sup>

getPrimarySlotId\(callback: AsyncCallback\<number\>\): void

Obtains the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result.

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                                        | Mandatory| Description                                                        |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
388 389 390 391 392 393 394 395 396 397 398
| callback | AsyncCallback\<number\> | Yes  | Callback invoked to return the result.|

**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300004  | Do not have sim card.                        |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
399 400 401

**Example**

S
shawn_he 已提交
402
```js
S
shawn_he 已提交
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
radio.getPrimarySlotId((err, data) => {
   console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getPrimarySlotId<sup>7+</sup>

getPrimarySlotId\(\): Promise\<number\>

Obtains the ID of the slot in which the primary card is located. This API uses a promise to return the result.

**System capability**: SystemCapability.Telephony.CoreService

**Return value**

| Type                                                       | Description                                                        |
| ----------------------------------------------------------- | ------------------------------------------------------------ |
| Promise\<number\> | Promise used to return the result.|

S
shawn_he 已提交
423 424 425 426 427 428 429 430 431 432
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300004  | Do not have sim card.                        |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
433 434
**Example**

S
shawn_he 已提交
435
```js
S
shawn_he 已提交
436 437 438 439
let promise = radio.getPrimarySlotId();
promise.then(data => {
    console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
440
    console.error(`getPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
441 442 443 444 445
});
```


## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
446 447 448

getSignalInformation\(slotId: number, callback: AsyncCallback<Array<SignalInformation\>\>\): void

S
shawn_he 已提交
449
Obtains 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.
S
shawn_he 已提交
450

S
shawn_he 已提交
451 452
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
453
**Parameters**
S
shawn_he 已提交
454

S
shawn_he 已提交
455
| Name  | Type                                                        | Mandatory| Description                                                        |
S
shawn_he 已提交
456
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
457
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                      |
S
shawn_he 已提交
458
| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes  | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
S
shawn_he 已提交
459

S
shawn_he 已提交
460 461 462 463 464 465 466 467 468 469
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
470
**Example**
S
shawn_he 已提交
471

S
shawn_he 已提交
472
```js
S
shawn_he 已提交
473 474 475 476 477
let slotId = 0;
radio.getSignalInformation(slotId, (err, data) => {
   console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
478 479


S
shawn_he 已提交
480
## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
481 482 483

getSignalInformation\(slotId: number\): Promise<Array<SignalInformation\>\>

S
shawn_he 已提交
484
Obtains 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.
S
shawn_he 已提交
485

S
shawn_he 已提交
486 487
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
488
**Parameters**
S
shawn_he 已提交
489

S
shawn_he 已提交
490
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
491
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
492
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
493

S
shawn_he 已提交
494
**Return value**
S
shawn_he 已提交
495

S
shawn_he 已提交
496
| Type                                                       | Description                                                        |
S
shawn_he 已提交
497
| ----------------------------------------------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
498
| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
S
shawn_he 已提交
499

S
shawn_he 已提交
500 501 502 503 504 505 506 507 508 509
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
510
**Example**
S
shawn_he 已提交
511

S
shawn_he 已提交
512
```js
S
shawn_he 已提交
513 514 515 516 517
let slotId = 0;
let promise = radio.getSignalInformation(slotId);
promise.then(data => {
    console.log(`getSignalInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
518
    console.error(`getSignalInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
519 520
});
```
S
shawn_he 已提交
521

S
shawn_he 已提交
522
## radio.isNrSupported<sup>(deprecated)</sup>
S
shawn_he 已提交
523 524 525 526 527

isNrSupported\(\): boolean

Checks whether the current device supports 5G \(NR\).

S
shawn_he 已提交
528 529 530 531
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9) instead.

S
shawn_he 已提交
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
**System capability**: SystemCapability.Telephony.CoreService

**Return value**

| Type   | Description                            |
| ------- | -------------------------------- |
| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).|

**Example**

```js
let result = radio.isNrSupported();
console.log("Result: "+ result);
```

S
shawn_he 已提交
547
## radio.isNrSupported<sup>(deprecated)</sup>
S
shawn_he 已提交
548 549 550

isNrSupported\(slotId: number\): boolean

S
shawn_he 已提交
551 552 553 554 555
Checks whether the current device supports 5G \(NR\).

> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9-1) instead.
S
shawn_he 已提交
556 557 558 559 560 561 562

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
563
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
564 565 566 567 568 569 570 571 572

**Return value**

| Type              | Description                                                        |
| ------------------ | ------------------------------------------------------------ |
| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).|

**Example**

S
shawn_he 已提交
573
```js
S
shawn_he 已提交
574 575
let slotId = 0;
let result = radio.isNrSupported(slotId);
S
shawn_he 已提交
576
console.log("Result: "+ result);
S
shawn_he 已提交
577 578 579
```


S
shawn_he 已提交
580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
## radio.isNRSupported<sup>9+</sup>

isNRSupported\(\): boolean

Checks whether the current device supports 5G \(NR\).

**System capability**: SystemCapability.Telephony.CoreService

**Return value**

| Type   | Description                            |
| ------- | -------------------------------- |
| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).|

**Example**

```js
let result = radio.isNRSupported();
console.log("Result: "+ result);
```


## radio.isNRSupported<sup>9+</sup>

isNRSupported\(slotId: number\): boolean

Checks whether the current device supports 5G \(NR\).

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type              | Description                                                        |
| ------------------ | ------------------------------------------------------------ |
| boolean | - **true**: The current device supports 5G \(NR\).<br>- **false**: The current device does not support 5G \(NR\).|

**Example**

```js
let slotId = 0;
let result = radio.isNRSupported(slotId);
console.log("Result: "+ result);
```


S
shawn_he 已提交
631
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
632 633 634

isRadioOn\(callback: AsyncCallback<boolean\>\): void

S
shawn_he 已提交
635
Checks whether the radio service is enabled on the primary SIM card. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
636 637

**Required permission**: ohos.permission.GET_NETWORK_INFO
S
shawn_he 已提交
638

S
shawn_he 已提交
639
**System capability**: SystemCapability.Telephony.CoreService
S
shawn_he 已提交
640

S
shawn_he 已提交
641
**Parameters**
S
shawn_he 已提交
642

S
shawn_he 已提交
643
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
644
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
645
| callback | AsyncCallback\<boolean\> | Yes  | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
S
shawn_he 已提交
646

S
shawn_he 已提交
647 648 649 650 651 652 653 654 655 656 657
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
658
**Example**
S
shawn_he 已提交
659

S
shawn_he 已提交
660
```js
S
shawn_he 已提交
661 662 663 664
radio.isRadioOn((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
665 666


S
shawn_he 已提交
667
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
668 669 670

isRadioOn\(slotId: number, callback: AsyncCallback<boolean\>\): void

S
shawn_he 已提交
671
Checks whether the radio service is enabled on the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
672 673 674 675 676 677 678

**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

S
shawn_he 已提交
679
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
680
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
681
| slotId   | number                   | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                 |
S
shawn_he 已提交
682
| callback | AsyncCallback\<boolean\> | Yes  | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
S
shawn_he 已提交
683

S
shawn_he 已提交
684 685 686 687 688 689 690 691 692 693 694
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
695 696
**Example**

S
shawn_he 已提交
697
```js
S
shawn_he 已提交
698 699 700 701 702 703 704
let slotId = 0;
radio.isRadioOn(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
705
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
706

S
shawn_he 已提交
707
isRadioOn\(slotId?: number\): Promise<boolean\>
S
shawn_he 已提交
708

S
shawn_he 已提交
709
Checks whether the radio service is enabled on the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
710

S
shawn_he 已提交
711 712 713 714 715 716
**Required permission**: ohos.permission.GET_NETWORK_INFO

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

S
shawn_he 已提交
717
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
718
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
719
| 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.|
S
shawn_he 已提交
720

S
shawn_he 已提交
721
**Return value**
S
shawn_he 已提交
722

S
shawn_he 已提交
723
| Type              | Description                                                        |
S
shawn_he 已提交
724
| ------------------ | ------------------------------------------------------------ |
S
shawn_he 已提交
725
| Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
S
shawn_he 已提交
726

S
shawn_he 已提交
727 728 729 730 731 732 733 734 735 736 737
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
738
**Example**
S
shawn_he 已提交
739

S
shawn_he 已提交
740
```js
S
shawn_he 已提交
741 742
let slotId = 0;
let promise = radio.isRadioOn(slotId);
S
shawn_he 已提交
743 744 745
promise.then(data => {
    console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
746
    console.error(`isRadioOn failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
747 748
});
```
S
shawn_he 已提交
749 750


S
shawn_he 已提交
751
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
752 753 754

getOperatorName\(slotId: number, callback: AsyncCallback<string\>\): void

S
shawn_he 已提交
755
Obtains the carrier name for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
756 757 758 759 760

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

S
shawn_he 已提交
761
| Name  | Type                   | Mandatory| Description                                      |
S
shawn_he 已提交
762
| -------- | ----------------------- | ---- | ------------------------------------------ |
S
shawn_he 已提交
763
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
S
shawn_he 已提交
764
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result, which is the carrier name, for example, China Mobile.|
S
shawn_he 已提交
765

S
shawn_he 已提交
766 767 768 769 770 771 772 773 774 775
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
776 777
**Example**

S
shawn_he 已提交
778
```js
S
shawn_he 已提交
779 780 781 782 783 784 785
let slotId = 0;
radio.getOperatorName(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
786
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
787 788 789

getOperatorName\(slotId: number\): Promise<string\>

S
shawn_he 已提交
790
Obtains the carrier name for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
791 792 793 794 795

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

S
shawn_he 已提交
796
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
797
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
798
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
799 800 801

**Return value**

S
shawn_he 已提交
802
| Type             | Description                                                        |
S
shawn_he 已提交
803
| ----------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
804
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile.               |
S
shawn_he 已提交
805

S
shawn_he 已提交
806 807 808 809 810 811 812 813 814 815
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
816 817
**Example**

S
shawn_he 已提交
818
```js
S
shawn_he 已提交
819 820 821 822 823
let slotId = 0;
let promise = radio.getOperatorName(slotId);
promise.then(data => {
    console.log(`getOperatorName success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
824
    console.log(`getOperatorName failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
825 826 827
});
```

S
shawn_he 已提交
828 829 830 831 832 833
## radio.setPrimarySlotId<sup>8+</sup>

setPrimarySlotId(slotId: number, callback: AsyncCallback<void\>): void

Sets the ID of the slot in which the primary card is located. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
834
**System API**: This is a system API.
S
shawn_he 已提交
835 836 837 838 839 840 841 842 843 844

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description                                  |
| -------- | --------------------- | ---- | -------------------------------------- |
| slotId   | number                | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
845 846 847 848 849 850 851 852 853 854 855 856 857
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.                            |

**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300004  | Do not have sim card.                        |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874

**Example**

```js
let slotId = 0;
radio.setPrimarySlotId(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.setPrimarySlotId<sup>8+</sup>

setPrimarySlotId\(slotId: number\): Promise\<void\>

Sets the ID of the slot in which the primary card is located. This API uses a promise to return the result.

S
shawn_he 已提交
875
**System API**: This is a system API.
S
shawn_he 已提交
876 877 878 879 880 881 882 883 884 885 886 887 888 889 890

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type           | Description                           |
| --------------- | ------------------------------- |
S
shawn_he 已提交
891
| Promise\<void\> | Promise used to return the result.|
S
shawn_he 已提交
892

S
shawn_he 已提交
893 894 895 896 897 898 899 900 901 902 903 904
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300004  | Do not have sim card.                        |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
905 906 907 908 909 910 911 912
**Example**

```js
let slotId = 0;
let promise = radio.setPrimarySlotId(slotId);
promise.then(data => {
    console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
913
    console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
914 915 916 917 918 919 920 921 922
});
```

## radio.getIMEI<sup>8+</sup>

getIMEI(callback: AsyncCallback<string\>): void

Obtains the IMEI of the SIM card in a card slot. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
923
**System API**: This is a system API.
S
shawn_he 已提交
924 925 926 927 928 929 930 931 932 933 934

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description                                      |
| -------- | ----------------------- | ---- | ------------------------------------------ |
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result. If the IMEI does not exist, an empty string is returned.|

S
shawn_he 已提交
935 936 937 938 939 940 941 942 943 944 945
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
946 947 948 949 950 951 952 953 954 955 956 957 958
**Example**

```js
radio.getIMEI((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getIMEI<sup>8+</sup>

getIMEI(slotId: number, callback: AsyncCallback<string\>): void

S
shawn_he 已提交
959
Obtains the IMEI of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
960

S
shawn_he 已提交
961
**System API**: This is a system API.
S
shawn_he 已提交
962 963 964 965 966 967 968 969 970 971 972 973

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description                                      |
| -------- | ----------------------- | ---- | ------------------------------------------ |
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result. If the IMEI does not exist, an empty string is returned.|

S
shawn_he 已提交
974 975 976 977 978 979 980 981 982 983 984
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
985 986 987 988 989 990 991 992 993 994 995 996 997 998
**Example**

```js
let slotId = 0;
radio.getIMEI(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getIMEI<sup>8+</sup>

getIMEI(slotId?: number): Promise<string\>

S
shawn_he 已提交
999
Obtains the IMEI of the SIM card in the specified card slot. This API uses a promise to return the result.
S
shawn_he 已提交
1000

S
shawn_he 已提交
1001
**System API**: This is a system API.
S
shawn_he 已提交
1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type             | Description                                      |
| ----------------- | ------------------------------------------ |
| Promise\<string\> | Promise used to return the result. If the IMEI does not exist, an empty string is returned.|

S
shawn_he 已提交
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1030 1031 1032 1033 1034 1035 1036 1037
**Example**

```js
let slotId = 0;
let promise = radio.getIMEI(slotId);
promise.then(data => {
    console.log(`getIMEI success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1038
    console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1039 1040 1041 1042 1043 1044 1045 1046 1047
});
```

## radio.getMEID<sup>8+</sup>

getMEID(callback: AsyncCallback<string\>): void

Obtains the MEID of the SIM card in a card slot. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1048
**System API**: This is a system API.
S
shawn_he 已提交
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description      |
| -------- | ----------------------- | ---- | ---------- |
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083
**Example**

```js
radio.getMEID((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getMEID<sup>8+</sup>

getMEID(slotId: number, callback: AsyncCallback<string\>): void

S
shawn_he 已提交
1084
Obtains the MEID of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1085

S
shawn_he 已提交
1086
**System API**: This is a system API.
S
shawn_he 已提交
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description                                  |
| -------- | ----------------------- | ---- | -------------------------------------- |
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
**Example**

```js
let slotId = 0;
radio.getMEID(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getMEID<sup>8+</sup>

getMEID(slotId?: number): Promise<string\>

S
shawn_he 已提交
1124
Obtains the MEID of the SIM card in the specified card slot. This API uses a promise to return the result.
S
shawn_he 已提交
1125

S
shawn_he 已提交
1126
**System API**: This is a system API.
S
shawn_he 已提交
1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type             | Description                                   |
| ----------------- | --------------------------------------- |
| Promise\<string\> | Promise used to return the result.|

S
shawn_he 已提交
1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1155 1156 1157 1158 1159 1160 1161 1162
**Example**

```js
let slotId = 0;
let promise = radio.getMEID(slotId);
promise.then(data => {
    console.log(`getMEID success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1163
    console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1164 1165 1166 1167 1168 1169 1170 1171 1172
});
```

## radio.getUniqueDeviceId<sup>8+</sup>

getUniqueDeviceId(callback: AsyncCallback<string\>): void

Obtains the unique device ID of the SIM card in a card slot. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1173
**System API**: This is a system API.
S
shawn_he 已提交
1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description      |
| -------- | ----------------------- | ---- | ---------- |
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208
**Example**

```js
radio.getUniqueDeviceId((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getUniqueDeviceId<sup>8+</sup>

getUniqueDeviceId(slotId: number, callback: AsyncCallback<string\>): void

S
shawn_he 已提交
1209
Obtains the unique device ID of the SIM card in the specified card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1210

S
shawn_he 已提交
1211
**System API**: This is a system API.
S
shawn_he 已提交
1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                   | Mandatory| Description                                  |
| -------- | ----------------------- | ---- | -------------------------------------- |
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248
**Example**

```js
let slotId = 0;
radio.getUniqueDeviceId(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getUniqueDeviceId<sup>8+</sup>

getUniqueDeviceId(slotId?: number): Promise<string\>

S
shawn_he 已提交
1249
Obtains the unique device ID of the SIM card in the specified card slot. This API uses a promise to return the result.
S
shawn_he 已提交
1250

S
shawn_he 已提交
1251
**System API**: This is a system API.
S
shawn_he 已提交
1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type             | Description                                         |
| ----------------- | --------------------------------------------- |
| Promise\<string\> | Promise used to return the result.|

S
shawn_he 已提交
1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1280 1281 1282 1283 1284 1285 1286 1287
**Example**

```js
let slotId = 0;
let promise = radio.getUniqueDeviceId(slotId);
promise.then(data => {
    console.log(`getUniqueDeviceId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1288
    console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1289 1290
});
```
S
shawn_he 已提交
1291

S
shawn_he 已提交
1292 1293 1294 1295 1296 1297
## radio.sendUpdateCellLocationRequest<sup>8+</sup>

sendUpdateCellLocationRequest\(callback: AsyncCallback<void\>\): void

Sends a cell location update request. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1298
**System API**: This is a system API.
S
shawn_he 已提交
1299

S
shawn_he 已提交
1300
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1301

S
shawn_he 已提交
1302 1303 1304 1305 1306 1307 1308 1309
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description      |
| -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331
**Example**

```js
radio.sendUpdateCellLocationRequest((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.sendUpdateCellLocationRequest<sup>8+</sup>

sendUpdateCellLocationRequest\(slotId: number, callback: AsyncCallback<void\>\): void
S
shawn_he 已提交
1332

S
shawn_he 已提交
1333
Sends a cell location update request for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1334

S
shawn_he 已提交
1335
**System API**: This is a system API.
S
shawn_he 已提交
1336

S
shawn_he 已提交
1337
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1338

S
shawn_he 已提交
1339 1340 1341 1342 1343 1344
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description      |
| -------- | --------------------- | ---- | ---------- |
S
shawn_he 已提交
1345
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
1346 1347
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1359 1360 1361
**Example**

```js
S
shawn_he 已提交
1362 1363
let slotId = 0;
radio.sendUpdateCellLocationRequest(slotId, (err, data) => {
S
shawn_he 已提交
1364 1365 1366 1367 1368 1369
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.sendUpdateCellLocationRequest<sup>8+</sup>

S
shawn_he 已提交
1370
sendUpdateCellLocationRequest\(slotId?: number): Promise<void\>
S
shawn_he 已提交
1371

S
shawn_he 已提交
1372
Sends a cell location update request for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1373

S
shawn_he 已提交
1374
**System API**: This is a system API.
S
shawn_he 已提交
1375

S
shawn_he 已提交
1376
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1377

S
shawn_he 已提交
1378 1379
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
1380 1381 1382 1383 1384 1385
**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

S
shawn_he 已提交
1386 1387 1388 1389 1390 1391
**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1403 1404 1405
**Example**

```js
S
shawn_he 已提交
1406 1407
let slotId = 0;
let promise = radio.sendUpdateCellLocationRequest(slotId);
S
shawn_he 已提交
1408 1409 1410
promise.then(data => {
    console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1411
    console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1412 1413 1414 1415 1416 1417 1418 1419 1420
});
```

## radio.getCellInformation<sup>8+</sup>

getCellInformation(callback: AsyncCallback<Array<CellInformation\>>): void

Obtains cell information. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1421
**System API**: This is a system API.
S
shawn_he 已提交
1422

D
dingxiaochen 已提交
1423
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1424 1425 1426 1427 1428 1429 1430 1431 1432

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                                        | Mandatory| Description                    |
| -------- | ------------------------------------------------------------ | ---- | ------------------------ |
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456
**Example**

```js
radio.getCellInformation((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getCellInformation<sup>8+</sup>

getCellInformation(slotId: number, callback: AsyncCallback<Array<CellInformation\>\>): void

S
shawn_he 已提交
1457
Obtains cell information for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1458

S
shawn_he 已提交
1459
**System API**: This is a system API.
S
shawn_he 已提交
1460

D
dingxiaochen 已提交
1461
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                                        | Mandatory| Description                                  |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<Array<[CellInformation](#cellinformation8)\>\> | Yes  | Callback used to return the result.              |

S
shawn_he 已提交
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496
**Example**

```js
let slotId = 0;
radio.getCellInformation(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getCellInformation<sup>8+</sup>

getCellInformation(slotId?: number): Promise<Array<CellInformation\>\>

S
shawn_he 已提交
1497
Obtains cell information for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1498

S
shawn_he 已提交
1499
**System API**: This is a system API.
S
shawn_he 已提交
1500

D
dingxiaochen 已提交
1501
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type                                                   | Description                   |
| ------------------------------------------------------- | ----------------------- |
| Promise\<Array<[CellInformation](#cellinformation8)\>\> | Promise used to return the result.|

S
shawn_he 已提交
1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1528 1529 1530 1531 1532 1533 1534 1535
**Example**

```js
let slotId = 0;
let promise = radio.getCellInformation(slotId);
promise.then(data => {
    console.log(`getCellInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1536
    console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1537 1538 1539 1540 1541 1542 1543 1544 1545
});
```

## radio.setNetworkSelectionMode

setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback<void\>\): void

Sets the network selection mode. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1546
**System API**: This is a system API.
S
shawn_he 已提交
1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                                       | Mandatory| Description              |
| -------- | ----------------------------------------------------------- | ---- | ------------------ |
| options  | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes  | Network selection mode.|
| callback | AsyncCallback\<void\>                                       | Yes  | Callback used to return the result.        |

S
shawn_he 已提交
1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1570 1571 1572 1573 1574 1575
**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1576
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1577 1578 1579
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1580 1581
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595
    networkInformation: networkInformation,
    resumeSelection: true
}
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.setNetworkSelectionMode

setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise<void\>

Sets the network selection mode. This API uses a promise to return the result.

S
shawn_he 已提交
1596
**System API**: This is a system API.
S
shawn_he 已提交
1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name | Type                                                       | Mandatory| Description              |
| ------- | ----------------------------------------------------------- | ---- | ------------------ |
| options | [NetworkSelectionModeOptions](#networkselectionmodeoptions) | Yes  | Network selection mode.|

**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1625 1626 1627 1628 1629 1630
**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1631
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1632 1633 1634
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1635 1636
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1637 1638 1639 1640 1641 1642 1643
    networkInformation: networkInformation,
    resumeSelection: true
}
let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
promise.then(data => {
    console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1644
    console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1645 1646 1647 1648 1649 1650 1651
});
```

## radio.getNetworkSearchInformation

getNetworkSearchInformation\(slotId: number, callback: AsyncCallback<NetworkSearchResult\>\): void

S
shawn_he 已提交
1652
Obtains network search information for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1653

S
shawn_he 已提交
1654
**System API**: This is a system API.
S
shawn_he 已提交
1655 1656 1657 1658 1659 1660 1661 1662 1663 1664

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                                        | Mandatory| Description                                  |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------- |
| slotId   | number                                                       | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676
| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | Yes  | Callback used to return the result.          |

**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687

**Example**

```js
radio.getNetworkSearchInformation(0, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.getNetworkSearchInformation

S
shawn_he 已提交
1688
getNetworkSearchInformation\(slotId: number\): Promise<NetworkSearchResult\>
S
shawn_he 已提交
1689

S
shawn_he 已提交
1690
Obtains network search information for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1691

S
shawn_he 已提交
1692
**System API**: This is a system API.
S
shawn_he 已提交
1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type                                                  | Description                   |
| ------------------------------------------------------ | ----------------------- |
| Promise\<[NetworkSearchResult](#networksearchresult)\> | Promise used to return the result.|

S
shawn_he 已提交
1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1721 1722 1723 1724 1725 1726 1727
**Example**

```js
let promise = radio.getNetworkSearchInformation(0);
promise.then(data => {
    console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1728
    console.log(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1729 1730 1731 1732 1733 1734 1735 1736 1737
});
```

## radio.getNrOptionMode<sup>8+</sup>

getNrOptionMode(callback: AsyncCallback<NrOptionMode\>): void

Obtains the NR option mode. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1738
**System API**: This is a system API.
S
shawn_he 已提交
1739 1740 1741 1742 1743 1744 1745 1746 1747

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                           | Mandatory| Description      |
| -------- | ----------------------------------------------- | ---- | ---------- |
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770
**Example**

```js
radio.getNrOptionMode((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getNrOptionMode<sup>8+</sup>

getNrOptionMode(slotId: number, callback: AsyncCallback<NrOptionMode\>): void

S
shawn_he 已提交
1771
Obtains the NR option mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1772

S
shawn_he 已提交
1773
**System API**: This is a system API.
S
shawn_he 已提交
1774 1775 1776 1777 1778 1779 1780 1781 1782 1783

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                           | Mandatory| Description                                  |
| -------- | ----------------------------------------------- | ---- | -------------------------------------- |
| slotId   | number                                          | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<[NrOptionMode](#nroptionmode8)\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
1784 1785 1786 1787 1788 1789 1790 1791 1792 1793
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807
**Example**

```js
let slotId = 0;
radio.getNrOptionMode(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.getNrOptionMode<sup>8+</sup>

getNrOptionMode(slotId?: number): Promise<NrOptionMode\>

S
shawn_he 已提交
1808
Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1809

S
shawn_he 已提交
1810
**System API**: This is a system API.
S
shawn_he 已提交
1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type                                     | Description                   |
| ----------------------------------------- | ----------------------- |
| Promise\<[NrOptionMode](#nroptionmode8)\> | Promise used to return the result.|

S
shawn_he 已提交
1826 1827 1828 1829 1830 1831 1832 1833 1834 1835
**Error codes**

| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1836 1837 1838 1839 1840 1841 1842 1843
**Example**

```js
let slotId = 0;
let promise = radio.getNrOptionMode(slotId);
promise.then(data => {
    console.log(`getNrOptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1844
    console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1845 1846 1847 1848 1849 1850 1851 1852 1853
});
```

## radio.turnOnRadio<sup>7+</sup>

turnOnRadio(callback: AsyncCallback<void\>): void

Turns on the radio function. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1854
**System API**: This is a system API.
S
shawn_he 已提交
1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description      |
| -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891
**Example**

```js
radio.turnOnRadio((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.turnOnRadio<sup>7+</sup>

turnOnRadio(slotId: number, callback: AsyncCallback<void\>): void

Turns on the radio function for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1892
**System API**: This is a system API.
S
shawn_he 已提交
1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description                                  |
| -------- | --------------------- | ---- | -------------------------------------- |
| slotId   | number                | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
**Example**

```js
let slotId = 0;
radio.turnOnRadio(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.turnOnRadio<sup>7+</sup>

turnOnRadio(slotId?: number): Promise<void\>

Turns on the radio function for the SIM card in the specified slot. This API uses a promise to return the result.

S
shawn_he 已提交
1932
**System API**: This is a system API.
S
shawn_he 已提交
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
1961 1962 1963 1964 1965 1966 1967 1968
**Example**

```js
let slotId = 0;
let promise = radio.turnOnRadio(slotId);
promise.then(data => {
    console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1969
    console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1970 1971 1972 1973 1974 1975 1976 1977 1978
});
```

## radio.turnOffRadio<sup>7+</sup>

turnOffRadio(callback: AsyncCallback<void\>): void

Turns off the radio function. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
1979
**System API**: This is a system API.
S
shawn_he 已提交
1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description      |
| -------- | --------------------- | ---- | ---------- |
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.|

S
shawn_he 已提交
1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
**Example**

```js
radio.turnOffRadio((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.turnOffRadio<sup>7+</sup>

turnOffRadio(slotId: number, callback: AsyncCallback<void\>): void

Turns off the radio function for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

S
shawn_he 已提交
2017
**System API**: This is a system API.
S
shawn_he 已提交
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                 | Mandatory| Description                                  |
| -------- | --------------------- | ---- | -------------------------------------- |
| slotId   | number                | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056
**Example**

```js
let slotId = 0;
radio.turnOffRadio(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


## radio.turnOffRadio<sup>7+</sup>

turnOffRadio(slotId?: number): Promise<void\>

Turns off the radio function for the SIM card in the specified slot. This API uses a promise to return the result.

S
shawn_he 已提交
2057
**System API**: This is a system API.
S
shawn_he 已提交
2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2086 2087 2088 2089 2090 2091 2092 2093
**Example**

```js
let slotId = 0;
let promise = radio.turnOffRadio(slotId);
promise.then(data => {
    console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
2094
    console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2095 2096 2097 2098 2099 2100 2101
});
```

## radio.setPreferredNetwork<sup>8+</sup>

setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback<void\>\): void

S
shawn_he 已提交
2102
Sets the preferred network for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2103

S
shawn_he 已提交
2104
**System API**: This is a system API.
S
shawn_he 已提交
2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name     | Type                                          | Mandatory| Description                                  |
| ----------- | ---------------------------------------------- | ---- | -------------------------------------- |
| slotId      | number                                         | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes  | Preferred network mode.                      |
| callback    | AsyncCallback\<void\>                          | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140
**Example**

```js
radio.setPreferredNetwork(0, 1, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.setPreferredNetwork<sup>8+</sup>

setPreferredNetwork(slotId: number, networkMode: PreferredNetworkMode): Promise<void\>

S
shawn_he 已提交
2141
Sets the preferred network for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
2142

S
shawn_he 已提交
2143
**System API**: This is a system API.
S
shawn_he 已提交
2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161

**Required permission**: ohos.permission.SET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name     | Type                                          | Mandatory| Description                                  |
| ----------- | ---------------------------------------------- | ---- | -------------------------------------- |
| slotId      | number                                         | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| networkMode | [PreferredNetworkMode](#preferrednetworkmode8) | Yes  | Preferred network mode.                      |

**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2173 2174 2175 2176 2177 2178 2179
**Example**

```js
let promise = radio.setPreferredNetwork(0, 1);
promise.then(data => {
    console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
2180
    console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2181 2182 2183 2184 2185 2186 2187
});
```

## radio.getPreferredNetwork<sup>8+</sup>

getPreferredNetwork\(slotId: number, callback: AsyncCallback<PreferredNetworkMode\>\): void

S
shawn_he 已提交
2188
Obtains the preferred network for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2189

S
shawn_he 已提交
2190
**System API**: This is a system API.
S
shawn_he 已提交
2191 2192 2193 2194 2195 2196 2197

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

S
shawn_he 已提交
2198 2199 2200
| Name  |                              Type                              | Mandatory| Description                                  |
| -------- | --------------------------------------------------------------- | ---- | -------------------------------------- |
| slotId   | number                                                          | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
2201 2202
| callback | AsyncCallback\<[PreferredNetworkMode](#preferrednetworkmode8)\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2214 2215 2216 2217 2218 2219 2220 2221 2222 2223
**Example**

```js
radio.getPreferredNetwork(0, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.getPreferredNetwork<sup>8+</sup>

S
shawn_he 已提交
2224
getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\>
S
shawn_he 已提交
2225

S
shawn_he 已提交
2226
Obtains the preferred network for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
2227

S
shawn_he 已提交
2228
**System API**: This is a system API.
S
shawn_he 已提交
2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|

**Return value**

| Type           | Description                   |
| --------------- | ----------------------- |
| Promise\<void\> | Promise used to return the result.|

S
shawn_he 已提交
2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2257 2258 2259 2260 2261 2262 2263
**Example**

```js
let promise = radio.getPreferredNetwork(0);
promise.then(data => {
    console.log(`getPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
2264
    console.log(`getPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2265 2266 2267
});
```

S
shawn_he 已提交
2268 2269 2270 2271
## radio.getImsRegInfo<sup>9+</sup>

getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo\>): void

S
shawn_he 已提交
2272
Obtains 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.
S
shawn_he 已提交
2273

S
shawn_he 已提交
2274
**System API**: This is a system API.
S
shawn_he 已提交
2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                      | Mandatory| Description                                  |
| -------- | ------------------------------------------ | ---- | -------------------------------------- |
| slotId   | number                                     | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType  | [ImsServiceType](#imsservicetype9)         | Yes  | IMS service type.                         |
| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2299 2300 2301
**Example**

```js
S
shawn_he 已提交
2302
radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
S
shawn_he 已提交
2303 2304 2305 2306 2307 2308 2309 2310
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.getImsRegInfo<sup>9+</sup>

getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>

S
shawn_he 已提交
2311
Obtains 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.
S
shawn_he 已提交
2312

S
shawn_he 已提交
2313
**System API**: This is a system API.
S
shawn_he 已提交
2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name | Type                              | Mandatory| Description                                  |
| ------- | ---------------------------------- | ---- | -------------------------------------- |
| slotId  | number                             | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType | [ImsServiceType](#imsservicetype9) | Yes  | IMS service type.                         |

**Return value**

| Type                                 | Description                   |
| ------------------------------------- | ----------------------- |
| Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.|

S
shawn_he 已提交
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2343 2344 2345
**Example**

```js
S
shawn_he 已提交
2346
let promise = radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO);
S
shawn_he 已提交
2347 2348 2349
promise.then(data => {
    console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
2350
    console.log(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2351 2352 2353 2354 2355 2356 2357
});
```

## radio.on('imsRegStateChange')<sup>9+</sup>

on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback<ImsRegInfo\>): void

S
shawn_he 已提交
2358
Enables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2359

S
shawn_he 已提交
2360
**System API**: This is a system API.
S
shawn_he 已提交
2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                | Mandatory| Description                                  |
| -------- | ------------------------------------ | ---- | -------------------------------------- |
| type     | string                               | Yes  | IMS registration status changes.               |
| slotId   | number                               | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType  | [ImsServiceType](#imsservicetype9)   | Yes  | IMS service type.                         |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes  | Callback used to return the result.                            |

S
shawn_he 已提交
2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2386 2387 2388
**Example**

```js
S
shawn_he 已提交
2389 2390
radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2391 2392 2393 2394 2395 2396 2397
});
```

## radio.off('imsRegStateChange')<sup>9+</sup>

off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback<ImsRegInfo\>): void

S
shawn_he 已提交
2398
Disables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2399

S
shawn_he 已提交
2400
**System API**: This is a system API.
S
shawn_he 已提交
2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414

**Required permission**: ohos.permission.GET_TELEPHONY_STATE

**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

| Name  | Type                                | Mandatory| Description                                  |
| -------- | ------------------------------------ | ---- | -------------------------------------- |
| type     | string                               | Yes  | IMS registration status changes.    |
| slotId   | number                               | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType  | [ImsServiceType](#imsservicetype9)   | Yes  | IMS service type.                         |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No  | Callback used to return the result.                            |

S
shawn_he 已提交
2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425
**Error codes**

| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
| 401      | Parameter error.                             |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
2426 2427 2428
**Example**

```js
S
shawn_he 已提交
2429 2430
radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2431 2432 2433
});
```

S
shawn_he 已提交
2434
## RadioTechnology
S
shawn_he 已提交
2435

S
shawn_he 已提交
2436
 Enumerates radio access technologies.
S
shawn_he 已提交
2437

S
shawn_he 已提交
2438 2439 2440
**System capability**: SystemCapability.Telephony.CoreService

| Name                     | Value  | Description                                                        |
S
shawn_he 已提交
2441
| ------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457
| RADIO_TECHNOLOGY_UNKNOWN  | 0    | Unknown RAT                                   |
| RADIO_TECHNOLOGY_GSM      | 1    | Global System for Mobile Communication (GSM) |
| RADIO_TECHNOLOGY_1XRTT    | 2    | Single-Carrier Radio Transmission Technology (1XRTT)|
| RADIO_TECHNOLOGY_WCDMA    | 3    | Wideband Code Division Multiple Access (WCDMA)|
| RADIO_TECHNOLOGY_HSPA     | 4    | High Speed Packet Access (HSPA)              |
| RADIO_TECHNOLOGY_HSPAP    | 5    | Evolved High Speed Packet Access (HSPA+)    |
| RADIO_TECHNOLOGY_TD_SCDMA | 6    | Time Division Synchronous Code Division Multiple Access (TD-SCDMA)|
| RADIO_TECHNOLOGY_EVDO     | 7    | Evolution-Data Optimized (EVDO)                  |
| RADIO_TECHNOLOGY_EHRPD    | 8    | Evolved High Rate Package Data (EHRPD)       |
| RADIO_TECHNOLOGY_LTE      | 9    | Long Term Evolution (LTE)                    |
| RADIO_TECHNOLOGY_LTE_CA   | 10   | Long Term Evolution_Carrier Aggregation (LTE_CA)|
| RADIO_TECHNOLOGY_IWLAN    | 11   | Industrial Wireless LAN (IWLAN)              |
| RADIO_TECHNOLOGY_NR       | 12   | New Radio (NR)                               |


## SignalInformation
S
shawn_he 已提交
2458 2459 2460

Defines the signal strength.

S
shawn_he 已提交
2461 2462
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2463 2464 2465 2466 2467
|      Name      |           Type             | Mandatory|      Description         |
| --------------- | --------------------------- | ---- | ------------------ |
| signalType      | [NetworkType](#networktype) | Yes  | Signal strength type.|
| signalLevel     | number                      | Yes  | Signal strength level.|
| dBm<sup>9+</sup>| number                      | Yes  | Network signal strength.    |
S
shawn_he 已提交
2468

S
shawn_he 已提交
2469
## NetworkType
S
shawn_he 已提交
2470

S
shawn_he 已提交
2471
Enumerates network types.
S
shawn_he 已提交
2472

S
shawn_he 已提交
2473 2474 2475
**System capability**: SystemCapability.Telephony.CoreService

| Name                | Value  | Description                                                        |
S
shawn_he 已提交
2476
| -------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
2477 2478 2479 2480 2481 2482 2483
| NETWORK_TYPE_UNKNOWN | 0    | Unknown network.                                              |
| NETWORK_TYPE_GSM     | 1    | GSM network.   |
| NETWORK_TYPE_CDMA    | 2    | CDMA network.           |
| NETWORK_TYPE_WCDMA   | 3    | WCDMA network. |
| NETWORK_TYPE_TDSCDMA | 4    | TD-SCDMA network.|
| NETWORK_TYPE_LTE     | 5    | LTE network.                      |
| NETWORK_TYPE_NR      | 6    | 5G NR network.                              |
S
shawn_he 已提交
2484

S
shawn_he 已提交
2485
## NetworkState
S
shawn_he 已提交
2486

S
shawn_he 已提交
2487
Defines the network status.
S
shawn_he 已提交
2488

S
shawn_he 已提交
2489 2490
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501
|       Name          |                 Type               | Mandatory|                          Description                               |
| -------------------- | ----------------------------------- | ---- | ------------------------------------------------------------ |
| longOperatorName     | string                              |  Yes | Long carrier name of the registered network.                                    |
| shortOperatorName    | string                              |  Yes | Short carrier name of the registered network.                                    |
| plmnNumeric          | string                              |  Yes | PLMN code of the registered network.                                          |
| isRoaming            | boolean                             |  Yes | Whether the user is roaming.                                          |
| regState             | [RegState](#regstate)               |  Yes | Network registration status of the device.                                        |
| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) |  Yes | RAT of the device.                                        |
| nsaState             | [NsaState](#nsastate)               |  Yes | NSA network registration status of the device.                                     |
| isCaActive           | boolean                             |  Yes | CA status.                                                  |
| isEmergency          | boolean                             |  Yes | Whether only emergency calls are allowed.                              |
S
shawn_he 已提交
2502 2503


S
shawn_he 已提交
2504
## RegState
S
shawn_he 已提交
2505

S
shawn_he 已提交
2506
Defines the network status.
S
shawn_he 已提交
2507

S
shawn_he 已提交
2508 2509 2510 2511
**System capability**: SystemCapability.Telephony.CoreService

| Name                         | Value  | Description                      |
| ----------------------------- | ---- | -------------------------- |
S
shawn_he 已提交
2512 2513
| REG_STATE_NO_SERVICE          | 0    | The device cannot use any services, including data, SMS, and call services.    |
| REG_STATE_IN_SERVICE          | 1    | The device can use services properly, including data, SMS, and call services.    |
S
shawn_he 已提交
2514
| REG_STATE_EMERGENCY_CALL_ONLY | 2    | The device can use only the emergency call service.|
S
shawn_he 已提交
2515
| 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.     |
S
shawn_he 已提交
2516 2517


S
shawn_he 已提交
2518
## NsaState
S
shawn_he 已提交
2519 2520 2521

Enumerates NSA network states.

S
shawn_he 已提交
2522 2523 2524 2525 2526 2527 2528 2529 2530 2531
**System capability**: SystemCapability.Telephony.CoreService

| Name                      | Value  | Description                                                      |
| -------------------------- | ---- | ---------------------------------------------------------- |
| NSA_STATE_NOT_SUPPORT      | 1    | The device is in idle or connected state in an LTE cell that does not support NSA.        |
| NSA_STATE_NO_DETECT        | 2    | The device is in the idle state in an LTE cell that supports NSA but not NR coverage detection.|
| NSA_STATE_CONNECTED_DETECT | 3    | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection.         |
| NSA_STATE_IDLE_DETECT      | 4    | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection.          |
| NSA_STATE_DUAL_CONNECTED   | 5    | The device is connected to the LTE/NR network in an LTE cell that supports NSA.              |
| NSA_STATE_SA_ATTACHED      | 6    | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core.     |
S
shawn_he 已提交
2532 2533


S
shawn_he 已提交
2534
## NetworkSelectionMode
S
shawn_he 已提交
2535 2536 2537

Enumerates network selection modes.

S
shawn_he 已提交
2538 2539 2540 2541 2542 2543 2544
**System capability**: SystemCapability.Telephony.CoreService

| Name                       | Value  | Description          |
| --------------------------- | ---- | -------------- |
| NETWORK_SELECTION_UNKNOWN   | 0    | Unknown network selection mode.|
| NETWORK_SELECTION_AUTOMATIC | 1    | Automatic network selection mode.|
| NETWORK_SELECTION_MANUAL    | 2    | Manual network selection mode.|
S
shawn_he 已提交
2545 2546 2547 2548 2549

## PreferredNetworkMode<sup>8+</sup>

Enumerates preferred network modes.

S
shawn_he 已提交
2550
**System API**: This is a system API.
S
shawn_he 已提交
2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587

**System capability**: SystemCapability.Telephony.CoreService

| Name                                                     | Value  | Description                                         |
| --------------------------------------------------------- | ---- | --------------------------------------------- |
| PREFERRED_NETWORK_MODE_GSM                                | 1    | GSM network mode.                            |
| PREFERRED_NETWORK_MODE_WCDMA                              | 2    | WCDMA network mode.                          |
| PREFERRED_NETWORK_MODE_LTE                                | 3    | LTE network mode.                            |
| PREFERRED_NETWORK_MODE_LTE_WCDMA                          | 4    | LTE+WCDMA network mode.                      |
| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM                      | 5    | LTE+WCDMA+GSM network mode.                  |
| PREFERRED_NETWORK_MODE_WCDMA_GSM                          | 6    | WCDMA+GSM network mode.                      |
| PREFERRED_NETWORK_MODE_CDMA                               | 7    | CDMA network mode.                           |
| PREFERRED_NETWORK_MODE_EVDO                               | 8    | EVDO network mode.                           |
| PREFERRED_NETWORK_MODE_EVDO_CDMA                          | 9    | EVDO+CDMA network mode.                      |
| PREFERRED_NETWORK_MODE_WCDMA_GSM_EVDO_CDMA                | 10   | WCDMA+GSM+EVDO+CDMA network mode.            |
| PREFERRED_NETWORK_MODE_LTE_EVDO_CDMA                      | 11   | LTE+EVDO+CDMA network mode.                  |
| PREFERRED_NETWORK_MODE_LTE_WCDMA_GSM_EVDO_CDMA            | 12   | LTE+WCDMA+GSM+EVDO+CDMA network mode.        |
| PREFERRED_NETWORK_MODE_TDSCDMA                            | 13   | TD-SCDMA network mode.                        |
| PREFERRED_NETWORK_MODE_TDSCDMA_GSM                        | 14   | TD-SCDMA+GSM network mode.                    |
| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA                      | 15   | TD-SCDMA+WCDMA network mode.                  |
| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM                  | 16   | TD-SCDMA+WCDMA+GSM network mode.              |
| PREFERRED_NETWORK_MODE_LTE_TDSCDMA                        | 17   | LTE+TD-SCDMA network mode.                    |
| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_GSM                    | 18   | LTE+TD-SCDMA+GSM network mode.                |
| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA                  | 19   | LTE+TD-SCDMA+WCDMA network mode.              |
| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM              | 20   | LTE+TD-SCDMA+WCDMA+GSM network mode.          |
| PREFERRED_NETWORK_MODE_TDSCDMA_WCDMA_GSM_EVDO_CDMA        | 21   | TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.    |
| PREFERRED_NETWORK_MODE_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA    | 22   | LTE+TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.|
| PREFERRED_NETWORK_MODE_NR                                 | 31   | NR network mode.                             |
| PREFERRED_NETWORK_MODE_NR_LTE                             | 32   | NR+LTE network mode.                         |
| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA                       | 33   | NR+LTE+WCDMA network mode.                   |
| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM                   | 34   | NR+LTE+WCDMA+GSM network mode.               |
| PREFERRED_NETWORK_MODE_NR_LTE_EVDO_CDMA                   | 35   | NR+LTE+EVDO+CDMA network mode.               |
| PREFERRED_NETWORK_MODE_NR_LTE_WCDMA_GSM_EVDO_CDMA         | 36   | NR+LTE+WCDMA+GSM+EVDO+CDMA network mode.     |
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA                     | 37   | NR+LTE+TD-SCDMA network mode.                 |
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_GSM                 | 38   | NR+LTE+TD-SCDMA+GSM network mode.             |
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA               | 39   | NR+LTE+TD-SCDMA+WCDMA network mode.           |
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM           | 40   | NR+LTE+TD-SCDMA+WCDMA+GSM network mode.       |
S
shawn_he 已提交
2588
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 41   | NR+LTE+TD-SCDMA+WCDMA+GSM network mode.       |
S
shawn_he 已提交
2589 2590 2591 2592 2593 2594
| PREFERRED_NETWORK_MODE_MAX_VALUE                          | 99   | Maximum value of the preferred network mode.                         |

## CellInformation<sup>8+</sup>

Defines the cell information.

S
shawn_he 已提交
2595
**System API**: This is a system API.
S
shawn_he 已提交
2596 2597 2598

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2599 2600 2601 2602 2603 2604 2605
| Name             |                  Type                  | Mandatory|                           Description                              |
| ----------------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| networkType       | [NetworkType](#networktype)             |  Yes | Network type of the cell.                                    |
| isCamped          | boolean                                 |  Yes | Cell status.                                        |
| timeStamp         | number                                  |  Yes | Timestamp when cell information is obtained.                                |
| signalInformation | [SignalInformation](#signalinformation) |  Yes | Signal information.                                                  |
| 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|
S
shawn_he 已提交
2606 2607 2608 2609 2610

## CdmaCellInformation<sup>8+</sup>

Defines the CDMA cell information.

S
shawn_he 已提交
2611
**System API**: This is a system API.
S
shawn_he 已提交
2612 2613 2614

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2615 2616 2617 2618 2619 2620 2621
| Name     | Type  | Mandatory| Description        |
| --------- | ------ | ---- | ------------ |
| baseId    | number |  Yes | Base station ID.    |
| latitude  | number |  Yes | Longitude.      |
| longitude | number |  Yes | Latitude.      |
| nid       | number |  Yes | Network ID.|
| sid       | number |  Yes | System ID.|
S
shawn_he 已提交
2622 2623 2624 2625 2626

## GsmCellInformation<sup>8+</sup>

Defines the GSM cell information.

S
shawn_he 已提交
2627
**System API**: This is a system API.
S
shawn_he 已提交
2628 2629 2630

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2631 2632 2633 2634 2635 2636 2637 2638
| Name  | Type  | Mandatory| Description                |
| ------ | ------ | ---- | -------------------- |
| lac    | number |  Yes | Location area code.        |
| cellId | number |  Yes | Cell ID.            |
| arfcn  | number |  Yes | Absolute radio frequency channel number.|
| bsic   | number |  Yes | Base station ID.        |
| mcc    | string |  Yes | Mobile country code.        |
| mnc    | string |  Yes | Mobile network code.          |
S
shawn_he 已提交
2639 2640 2641

## LteCellInformation<sup>8+</sup>

S
shawn_he 已提交
2642
LTE cell information.
S
shawn_he 已提交
2643

S
shawn_he 已提交
2644
**System API**: This is a system API.
S
shawn_he 已提交
2645 2646 2647

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2648 2649 2650 2651 2652 2653 2654 2655 2656 2657
| Name         | Type   | Mandatory| Description                   |
| ------------- | ------- | ---- | ----------------------- |
| cgi           | number  |  Yes | Cell global identification.         |
| pci           | number  |  Yes | Physical cell ID.         |
| tac           | number  |  Yes | Tracking area code.         |
| earfcn        | number  |  Yes | Absolute radio frequency channel number.   |
| bandwidth     | number  |  Yes | Bandwidth.                 |
| mcc           | string  |  Yes | Mobile country code.           |
| mnc           | string  |  Yes | Mobile network code.             |
| isSupportEndc | boolean |  Yes | Support for New Radio_Dual Connectivity.|
S
shawn_he 已提交
2658 2659 2660

## NrCellInformation<sup>8+</sup>

S
shawn_he 已提交
2661
Defines the 5G NR cell information.
S
shawn_he 已提交
2662

S
shawn_he 已提交
2663
**System API**: This is a system API.
S
shawn_he 已提交
2664 2665 2666

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2667 2668 2669 2670 2671 2672 2673 2674
| Name   | Type  | Mandatory| Description            |
| ------- | ------ | ---- | ---------------- |
| nrArfcn | number |  Yes | 5G frequency number.      |
| pci     | number |  Yes | Physical cell ID.  |
| tac     | number |  Yes | Tracking area code.  |
| nci     | number |  Yes | 5G network cell ID.|
| mcc     | string |  Yes | Mobile country code.    |
| mnc     | string |  Yes | Mobile network code.      |
S
shawn_he 已提交
2675 2676 2677 2678 2679

## TdscdmaCellInformation<sup>8+</sup>

Defines the TD-SCDMA cell information.

S
shawn_he 已提交
2680
**System API**: This is a system API.
S
shawn_he 已提交
2681 2682 2683

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2684 2685 2686 2687 2688 2689 2690 2691
| Name  | Type  | Mandatory| Description        |
| ------ | ------ | ---- | ------------ |
| lac    | number |  Yes | Location area code.|
| cellId | number |  Yes | Cell ID.    |
| cpid   | number |  Yes | Cell parameter ID.|
| uarfcn | number |  Yes | Absolute radio frequency number.|
| mcc    | string |  Yes | Mobile country code.|
| mnc    | string |  Yes | Mobile network code.  |
S
shawn_he 已提交
2692 2693 2694 2695 2696

## WcdmaCellInformation<sup>8+</sup>

Defines the WCDMA cell information.

S
shawn_he 已提交
2697
**System API**: This is a system API.
S
shawn_he 已提交
2698 2699 2700

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2701 2702 2703 2704 2705 2706 2707 2708
| Name  | Type  | Mandatory| Description        |
| ------ | ------ | ---- | ------------ |
| lac    | number |  Yes | Location area code.|
| cellId | number |  Yes | Cell ID.    |
| psc    | number |  Yes | Primary scrambling code.    |
| uarfcn | number |  Yes | Absolute radio frequency number.|
| mcc    | string |  Yes | Mobile country code.|
| mnc    | string |  Yes | Mobile network code.  |
S
shawn_he 已提交
2709 2710 2711 2712 2713

## NrOptionMode<sup>8+</sup>

Enumerates NR selection modes.

S
shawn_he 已提交
2714
**System API**: This is a system API.
S
shawn_he 已提交
2715 2716 2717 2718 2719 2720 2721

**System capability**: SystemCapability.Telephony.CoreService

| Name                | Value  | Description                              |
| -------------------- | ---- | ---------------------------------- |
| NR_OPTION_UNKNOWN    | 0    | Unknown NR selection mode.                |
| NR_OPTION_NSA_ONLY   | 1    | NR selection mode in 5G non-standalone networking.        |
S
shawn_he 已提交
2722
| NR_OPTION_SA_ONLY    | 2    | NR selection mode in 5G non-standalone networking.          |
S
shawn_he 已提交
2723 2724 2725 2726 2727 2728
| NR_OPTION_NSA_AND_SA | 3    | NR selection mode in non-standalone and standalone networking.|

## NetworkSearchResult

Defines the network search result.

S
shawn_he 已提交
2729
**System API**: This is a system API.
S
shawn_he 已提交
2730

S
shawn_he 已提交
2731 2732
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2733 2734 2735 2736
| Name                  | Type                                             | Mandatory| Description          |
| ---------------------- | ------------------------------------------------- | ---- | -------------- |
| isNetworkSearchSuccess | boolean                                           |  Yes | Successful network search.|
| networkSearchResult    | Array<[NetworkInformation](#networkinformation)\> |  Yes | Network search result.|
S
shawn_he 已提交
2737 2738 2739 2740 2741

## NetworkInformation

Defines the network information.

S
shawn_he 已提交
2742
**System API**: This is a system API.
S
shawn_he 已提交
2743 2744 2745

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2746 2747 2748 2749 2750 2751
| Name           |                         Type                       | Mandatory| Description          |
| --------------- | --------------------------------------------------- | ---- | -------------- |
| operatorName    | string                                              |  Yes | Carrier name.|
| operatorNumeric | string                                              |  Yes | Carrier number.  |
| state           | [NetworkInformationState](#networkinformationstate) |  Yes | Network information status.|
| radioTech       | string                                              |  Yes | Radio access technology.  |
S
shawn_he 已提交
2752 2753 2754 2755 2756

## NetworkInformationState

Enumerates network information states.

S
shawn_he 已提交
2757
**System API**: This is a system API.
S
shawn_he 已提交
2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771

**System capability**: SystemCapability.Telephony.CoreService

| Name             | Value  | Description            |
| ----------------- | ---- | ---------------- |
| NETWORK_UNKNOWN   | 0    | Unknown state.  |
| NETWORK_AVAILABLE | 1    | Available for registration.|
| NETWORK_CURRENT   | 2    | Registered state.|
| NETWORK_FORBIDDEN | 3    | Unavailable for registration.  |

## NetworkSelectionModeOptions

Defines the network selection mode.

S
shawn_he 已提交
2772
**System API**: This is a system API.
S
shawn_he 已提交
2773 2774 2775

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2776 2777 2778 2779 2780 2781
| Name              |                    Type                      | Mandatory|                 Description                  |
| ------------------ | --------------------------------------------- | ---- | -------------------------------------- |
| slotId             | number                                        |  Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| selectMode         | [NetworkSelectionMode](#networkselectionmode) |  Yes | Network selection mode.                        |
| networkInformation | [NetworkInformation](#networkinformation)     |  Yes | Network information.                            |
| resumeSelection    | boolean                                       |  Yes | Whether to resume selection.                            |
S
shawn_he 已提交
2782 2783 2784 2785 2786

## ImsRegState<sup>9+</sup>

Enumerates IMS registration states.

S
shawn_he 已提交
2787
**System API**: This is a system API.
S
shawn_he 已提交
2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799

**System capability**: SystemCapability.Telephony.CoreService

| Name            | Value  | Description    |
| ---------------- | ---- | -------- |
| IMS_UNREGISTERED | 0    | Not registered.|
| IMS_REGISTERED   | 1    | Registered.|

## ImsRegTech<sup>9+</sup>

Enumerates IMS registration technologies.

S
shawn_he 已提交
2800
**System API**: This is a system API.
S
shawn_he 已提交
2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814

**System capability**: SystemCapability.Telephony.CoreService

| Name                   | Value  | Description           |
| ----------------------- | ---- | --------------- |
| REGISTRATION_TECH_NONE  | 0    | None.   |
| REGISTRATION_TECH_LTE   | 1    | LTE.  |
| REGISTRATION_TECH_IWLAN | 2    | I-WLAN.|
| REGISTRATION_TECH_NR    | 3    | NR.   |

## ImsRegInfo<sup>9+</sup>

Defines the IMS registration information.

S
shawn_he 已提交
2815
**System API**: This is a system API.
S
shawn_he 已提交
2816 2817 2818

**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
2819 2820 2821 2822
| Name       | Type                        | Mandatory| Description         |
| ----------- | ---------------------------- | ---- | ------------- |
| imsRegState | [ImsRegState](#imsregstate9) |  Yes | IMS registration state.|
| imsRegTech  | [ImsRegTech](#imsregtech9)   |  Yes | IMS registration technology.|
S
shawn_he 已提交
2823 2824 2825 2826 2827

## ImsServiceType<sup>9+</sup>

Enumerates IMS service types.

S
shawn_he 已提交
2828
**System API**: This is a system API.
S
shawn_he 已提交
2829 2830 2831 2832 2833 2834 2835 2836 2837

**System capability**: SystemCapability.Telephony.CoreService

| Name      | Value  | Description      |
| ---------- | ---- | ---------- |
| TYPE_VOICE | 0    | Voice service.|
| TYPE_VIDEO | 1    | Video service.|
| TYPE_UT    | 2    | UT service.  |
| TYPE_SMS   | 3    | SMS service.|