js-apis-radio.md 140.9 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
import radio from '@ohos.telephony.radio';
S
shawn_he 已提交
14 15
```

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
**Error codes**

S
shawn_he 已提交
35 36
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
37 38 39 40 41 42 43 44 45
| 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 已提交
46
**Example**
S
shawn_he 已提交
47

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


S
shawn_he 已提交
56
## radio.getRadioTech
S
shawn_he 已提交
57 58 59

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

S
shawn_he 已提交
60
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 已提交
61

S
shawn_he 已提交
62 63 64
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
66
**Parameters**
S
shawn_he 已提交
67

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

S
shawn_he 已提交
72
**Return value**
S
shawn_he 已提交
73

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

S
shawn_he 已提交
78 79
**Error codes**

S
shawn_he 已提交
80 81
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
82 83 84 85 86 87 88 89 90
| 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 已提交
91
**Example**
S
shawn_he 已提交
92

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


S
shawn_he 已提交
104
## radio.getNetworkState
S
shawn_he 已提交
105

S
shawn_he 已提交
106
getNetworkState\(callback: AsyncCallback\<NetworkState\>\): void
S
shawn_he 已提交
107

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

S
shawn_he 已提交
110 111 112
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
114
**Parameters**
S
shawn_he 已提交
115

S
shawn_he 已提交
116
| Name  | Type                                          | Mandatory| Description      |
S
shawn_he 已提交
117
| -------- | ---------------------------------------------- | ---- | ---------- |
S
shawn_he 已提交
118
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
119

S
shawn_he 已提交
120 121
**Error codes**

S
shawn_he 已提交
122 123
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
124 125 126 127 128 129 130 131 132
| 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 已提交
133
**Example**
S
shawn_he 已提交
134

S
shawn_he 已提交
135
```js
S
shawn_he 已提交
136
radio.getNetworkState((err, data) => {
S
shawn_he 已提交
137 138 139
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
140 141


S
shawn_he 已提交
142
## radio.getNetworkState
S
shawn_he 已提交
143

S
shawn_he 已提交
144
getNetworkState\(slotId: number, callback: AsyncCallback\<NetworkState\>\): void
S
shawn_he 已提交
145

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

S
shawn_he 已提交
148 149 150
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
152
**Parameters**
S
shawn_he 已提交
153

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

S
shawn_he 已提交
159 160
**Error codes**

S
shawn_he 已提交
161 162
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
163 164 165 166 167 168 169 170 171
| 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 已提交
172
**Example**
S
shawn_he 已提交
173

S
shawn_he 已提交
174
```js
S
shawn_he 已提交
175 176 177 178 179
let slotId = 0;
radio.getNetworkState(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
180 181


S
shawn_he 已提交
182
## radio.getNetworkState
S
shawn_he 已提交
183

S
shawn_he 已提交
184
getNetworkState\(slotId?: number\): Promise\<NetworkState\>
S
shawn_he 已提交
185

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

S
shawn_he 已提交
188 189 190
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
192
**Parameters**
S
shawn_he 已提交
193

S
shawn_he 已提交
194
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
195
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
196
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
197

S
shawn_he 已提交
198
**Return value**
S
shawn_he 已提交
199

S
shawn_he 已提交
200
| Type                                    | Description                       |
S
shawn_he 已提交
201
| ---------------------------------------- | --------------------------- |
S
shawn_he 已提交
202
| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.|
S
shawn_he 已提交
203

S
shawn_he 已提交
204 205
**Error codes**

S
shawn_he 已提交
206 207
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
208 209 210 211 212 213 214 215 216
| 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 已提交
217
**Example**
S
shawn_he 已提交
218

S
shawn_he 已提交
219
```js
S
shawn_he 已提交
220 221 222 223 224
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 已提交
225
    console.log(`getNetworkState failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
226 227
});
```
S
shawn_he 已提交
228 229


S
shawn_he 已提交
230
## radio.getNetworkSelectionMode
S
shawn_he 已提交
231

S
shawn_he 已提交
232
getNetworkSelectionMode\(slotId: number, callback: AsyncCallback\<NetworkSelectionMode\>\): void
S
shawn_he 已提交
233

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

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

S
shawn_he 已提交
238
**Parameters**
S
shawn_he 已提交
239

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

S
shawn_he 已提交
245 246
**Error codes**

S
shawn_he 已提交
247 248
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
249 250 251 252 253 254 255 256
| 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 已提交
257
**Example**
S
shawn_he 已提交
258

S
shawn_he 已提交
259
```js
S
shawn_he 已提交
260 261 262 263 264
let slotId = 0;
radio.getNetworkSelectionMode(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
265 266


S
shawn_he 已提交
267
## radio.getNetworkSelectionMode
S
shawn_he 已提交
268

S
shawn_he 已提交
269
getNetworkSelectionMode\(slotId: number\): Promise\<NetworkSelectionMode\>
S
shawn_he 已提交
270

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

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

S
shawn_he 已提交
275
**Parameters**
S
shawn_he 已提交
276

S
shawn_he 已提交
277
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
278
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
279
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
280

S
shawn_he 已提交
281
**Return value**
S
shawn_he 已提交
282

S
shawn_he 已提交
283
| Type                                                    | Description                           |
S
shawn_he 已提交
284
| -------------------------------------------------------- | ------------------------------- |
S
shawn_he 已提交
285
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.|
S
shawn_he 已提交
286

S
shawn_he 已提交
287 288
**Error codes**

S
shawn_he 已提交
289 290
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
291 292 293 294 295 296 297 298
| 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 已提交
299
**Example**
S
shawn_he 已提交
300

S
shawn_he 已提交
301
```js
S
shawn_he 已提交
302 303 304 305 306
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 已提交
307
    console.log(`getNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
308 309
});
```
S
shawn_he 已提交
310 311


S
shawn_he 已提交
312
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
313

S
shawn_he 已提交
314
getISOCountryCodeForNetwork\(slotId: number, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
315

S
shawn_he 已提交
316
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 已提交
317

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

S
shawn_he 已提交
320
**Parameters**
S
shawn_he 已提交
321

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

S
shawn_he 已提交
327 328
**Error codes**

S
shawn_he 已提交
329 330
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
331 332 333 334 335 336 337 338
| 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 已提交
339
**Example**
S
shawn_he 已提交
340

S
shawn_he 已提交
341
```js
S
shawn_he 已提交
342 343 344 345 346
let slotId = 0;
radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
347 348


S
shawn_he 已提交
349
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
350

S
shawn_he 已提交
351
getISOCountryCodeForNetwork\(slotId: number\): Promise\<string\>
S
shawn_he 已提交
352

S
shawn_he 已提交
353
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 已提交
354

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

S
shawn_he 已提交
357
**Parameters**
S
shawn_he 已提交
358

S
shawn_he 已提交
359
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
360
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
361
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
362

S
shawn_he 已提交
363
**Return value**
S
shawn_he 已提交
364

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

S
shawn_he 已提交
369 370
**Error codes**

S
shawn_he 已提交
371 372
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
373 374 375 376 377 378 379 380
| 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 已提交
381
**Example**
S
shawn_he 已提交
382

S
shawn_he 已提交
383
```js
S
shawn_he 已提交
384 385 386 387 388
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 已提交
389
    console.log(`getISOCountryCodeForNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
390 391
});
```
S
shawn_he 已提交
392 393


S
shawn_he 已提交
394 395 396 397 398 399 400 401 402 403 404 405
## 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 已提交
406
| callback | AsyncCallback\<number\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
407 408 409

**Error codes**

S
shawn_he 已提交
410 411
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
412 413 414 415 416 417
| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 8300001  | Invalid parameter value.                     |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |
S
shawn_he 已提交
418 419 420

**Example**

S
shawn_he 已提交
421
```js
S
shawn_he 已提交
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441
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 已提交
442 443
**Error codes**

S
shawn_he 已提交
444 445
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
446 447 448 449 450 451
| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
| 8300002  | Operation failed. Cannot connect to service. |
| 8300003  | System internal error.                       |
| 8300999  | Unknown error code.                          |

S
shawn_he 已提交
452 453
**Example**

S
shawn_he 已提交
454
```js
S
shawn_he 已提交
455 456 457 458
let promise = radio.getPrimarySlotId();
promise.then(data => {
    console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
459
    console.error(`getPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
460 461 462 463 464
});
```


## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
465

S
shawn_he 已提交
466
getSignalInformation\(slotId: number, callback: AsyncCallback\<Array\<SignalInformation\>\>\): void
S
shawn_he 已提交
467

S
shawn_he 已提交
468
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 已提交
469

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

S
shawn_he 已提交
472
**Parameters**
S
shawn_he 已提交
473

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

S
shawn_he 已提交
479 480
**Error codes**

S
shawn_he 已提交
481 482
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
483 484 485 486 487 488 489 490
| 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 已提交
491
**Example**
S
shawn_he 已提交
492

S
shawn_he 已提交
493
```js
S
shawn_he 已提交
494 495 496 497 498
let slotId = 0;
radio.getSignalInformation(slotId, (err, data) => {
   console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
499 500


S
shawn_he 已提交
501
## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
502

S
shawn_he 已提交
503
getSignalInformation\(slotId: number\): Promise\<Array\<SignalInformation\>\>
S
shawn_he 已提交
504

S
shawn_he 已提交
505
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 已提交
506

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

S
shawn_he 已提交
509
**Parameters**
S
shawn_he 已提交
510

S
shawn_he 已提交
511
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
512
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
513
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
514

S
shawn_he 已提交
515
**Return value**
S
shawn_he 已提交
516

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

S
shawn_he 已提交
521 522
**Error codes**

S
shawn_he 已提交
523 524
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
525 526 527 528 529 530 531 532
| 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 已提交
533
**Example**
S
shawn_he 已提交
534

S
shawn_he 已提交
535
```js
S
shawn_he 已提交
536 537 538 539 540
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 已提交
541
    console.error(`getSignalInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
542 543
});
```
S
shawn_he 已提交
544

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

isNrSupported\(\): boolean

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

S
shawn_he 已提交
551 552
> **NOTE**
>
S
shawn_he 已提交
553
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9).
S
shawn_he 已提交
554

S
shawn_he 已提交
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
**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 已提交
570
## radio.isNrSupported<sup>(deprecated)</sup>
S
shawn_he 已提交
571 572 573

isNrSupported\(slotId: number\): boolean

S
shawn_he 已提交
574 575 576 577
Checks whether the current device supports 5G \(NR\).

> **NOTE**
>
S
shawn_he 已提交
578
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [isNRSupported](#radioisnrsupported9-1).
S
shawn_he 已提交
579 580 581 582 583 584 585

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

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
586
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
587 588 589 590 591 592 593 594 595

**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 已提交
596
```js
S
shawn_he 已提交
597 598
let slotId = 0;
let result = radio.isNrSupported(slotId);
S
shawn_he 已提交
599
console.log("Result: "+ result);
S
shawn_he 已提交
600 601 602
```


S
shawn_he 已提交
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 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653
## 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 已提交
654
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
655

S
shawn_he 已提交
656
isRadioOn\(callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
657

S
shawn_he 已提交
658
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 已提交
659 660

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

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

S
shawn_he 已提交
664
**Parameters**
S
shawn_he 已提交
665

S
shawn_he 已提交
666
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
667
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
668
| 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 已提交
669

S
shawn_he 已提交
670 671
**Error codes**

S
shawn_he 已提交
672 673
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
674 675 676 677 678 679 680 681 682
| 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 已提交
683
**Example**
S
shawn_he 已提交
684

S
shawn_he 已提交
685
```js
S
shawn_he 已提交
686 687 688 689
radio.isRadioOn((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
690 691


S
shawn_he 已提交
692
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
693

S
shawn_he 已提交
694
isRadioOn\(slotId: number, callback: AsyncCallback\<boolean\>\): void
S
shawn_he 已提交
695

S
shawn_he 已提交
696
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 已提交
697 698 699 700 701 702 703

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

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

**Parameters**

S
shawn_he 已提交
704
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
705
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
706
| slotId   | number                   | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                 |
S
shawn_he 已提交
707
| 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 已提交
708

S
shawn_he 已提交
709 710
**Error codes**

S
shawn_he 已提交
711 712
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
713 714 715 716 717 718 719 720 721
| 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 已提交
722 723
**Example**

S
shawn_he 已提交
724
```js
S
shawn_he 已提交
725 726 727 728 729 730 731
let slotId = 0;
radio.isRadioOn(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
732
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
733

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

S
shawn_he 已提交
736
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 已提交
737

S
shawn_he 已提交
738 739 740 741 742 743
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

**Parameters**

S
shawn_he 已提交
744
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
745
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
746
| 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 已提交
747

S
shawn_he 已提交
748
**Return value**
S
shawn_he 已提交
749

S
shawn_he 已提交
750
| Type              | Description                                                        |
S
shawn_he 已提交
751
| ------------------ | ------------------------------------------------------------ |
S
shawn_he 已提交
752
| 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 已提交
753

S
shawn_he 已提交
754 755
**Error codes**

S
shawn_he 已提交
756 757
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
758 759 760 761 762 763 764 765 766
| 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 已提交
767
**Example**
S
shawn_he 已提交
768

S
shawn_he 已提交
769
```js
S
shawn_he 已提交
770 771
let slotId = 0;
let promise = radio.isRadioOn(slotId);
S
shawn_he 已提交
772 773 774
promise.then(data => {
    console.log(`isRadioOn success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
775
    console.error(`isRadioOn failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
776 777
});
```
S
shawn_he 已提交
778 779


S
shawn_he 已提交
780
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
781

S
shawn_he 已提交
782
getOperatorName\(slotId: number, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
783

S
shawn_he 已提交
784
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 已提交
785 786 787 788 789

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

**Parameters**

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

S
shawn_he 已提交
795 796
**Error codes**

S
shawn_he 已提交
797 798
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
799 800 801 802 803 804 805 806
| 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 已提交
807 808
**Example**

S
shawn_he 已提交
809
```js
S
shawn_he 已提交
810 811 812 813 814 815 816
let slotId = 0;
radio.getOperatorName(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
817
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
818

S
shawn_he 已提交
819
getOperatorName\(slotId: number\): Promise\<string\>
S
shawn_he 已提交
820

S
shawn_he 已提交
821
Obtains the carrier name for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
822 823 824 825 826

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

**Parameters**

S
shawn_he 已提交
827
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
828
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
829
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
830 831 832

**Return value**

S
shawn_he 已提交
833
| Type             | Description                                                        |
S
shawn_he 已提交
834
| ----------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
835
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile.               |
S
shawn_he 已提交
836

S
shawn_he 已提交
837 838
**Error codes**

S
shawn_he 已提交
839 840
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
841 842 843 844 845 846 847 848
| 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 已提交
849 850
**Example**

S
shawn_he 已提交
851
```js
S
shawn_he 已提交
852 853 854 855 856
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 已提交
857
    console.log(`getOperatorName failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
858 859 860
});
```

S
shawn_he 已提交
861 862
## radio.setPrimarySlotId<sup>8+</sup>

S
shawn_he 已提交
863
setPrimarySlotId\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
864 865 866

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 已提交
867
**System API**: This is a system API.
S
shawn_he 已提交
868 869 870 871 872 873 874 875 876 877

**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 已提交
878 879 880 881
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result.                            |

**Error codes**

S
shawn_he 已提交
882 883
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
884 885 886
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
887
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
888 889 890 891 892 893
| 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 已提交
894 895 896 897 898

**Example**

```js
let slotId = 0;
S
shawn_he 已提交
899 900
radio.setPrimarySlotId(slotId, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
901 902 903 904 905 906 907 908 909 910
});
```


## 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 已提交
911
**System API**: This is a system API.
S
shawn_he 已提交
912 913 914 915 916 917 918 919 920 921 922 923 924 925 926

**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 已提交
927
| Promise\<void\> | Promise used to return the result.|
S
shawn_he 已提交
928

S
shawn_he 已提交
929 930
**Error codes**

S
shawn_he 已提交
931 932
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
933 934 935
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
936
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
937 938 939 940 941 942 943
| 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 已提交
944 945 946 947 948
**Example**

```js
let slotId = 0;
let promise = radio.setPrimarySlotId(slotId);
S
shawn_he 已提交
949 950 951
promise.then(() => {
    console.log(`setPrimarySlotId success.`);
}).catch((err) => {
S
shawn_he 已提交
952
    console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
953 954 955 956 957
});
```

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

S
shawn_he 已提交
958
getIMEI\(callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
959

S
shawn_he 已提交
960
Obtains the IMEI for the SIM card in a card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
961

S
shawn_he 已提交
962
**System API**: This is a system API.
S
shawn_he 已提交
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                                      |
| -------- | ----------------------- | ---- | ------------------------------------------ |
| 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
**Error codes**

S
shawn_he 已提交
976 977
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
978 979 980
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
981
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
982 983 984 985 986 987
| 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 已提交
988 989 990 991 992 993 994 995 996 997 998
**Example**

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


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

S
shawn_he 已提交
999
getIMEI\(slotId: number, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
1000

S
shawn_he 已提交
1001
Obtains the IMEI for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1002

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

**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 已提交
1016 1017
**Error codes**

S
shawn_he 已提交
1018 1019
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1020 1021 1022
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1023
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1024 1025 1026 1027 1028 1029
| 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 1038 1039 1040 1041
**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>

S
shawn_he 已提交
1042
getIMEI\(slotId?: number\): Promise\<string\>
S
shawn_he 已提交
1043

S
shawn_he 已提交
1044
Obtains the IMEI for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1045

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

**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 已提交
1064 1065
**Error codes**

S
shawn_he 已提交
1066 1067
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1068 1069 1070
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1071
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1072 1073 1074 1075 1076 1077
| 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 已提交
1078 1079 1080 1081 1082 1083 1084 1085
**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 已提交
1086
    console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1087 1088 1089 1090 1091
});
```

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

S
shawn_he 已提交
1092
getMEID\(callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
1093

S
shawn_he 已提交
1094
Obtains the MEID for the SIM card in a card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1095

S
shawn_he 已提交
1096
**System API**: This is a system API.
S
shawn_he 已提交
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107

**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 已提交
1108 1109
**Error codes**

S
shawn_he 已提交
1110 1111
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1112 1113 1114
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1115
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1116 1117 1118 1119 1120 1121
| 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 已提交
1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132
**Example**

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


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

S
shawn_he 已提交
1133
getMEID\(slotId: number, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
1134

S
shawn_he 已提交
1135
Obtains the MEID for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1136

S
shawn_he 已提交
1137
**System API**: This is a system API.
S
shawn_he 已提交
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149

**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 已提交
1150 1151
**Error codes**

S
shawn_he 已提交
1152 1153
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1154 1155 1156
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1157
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1158 1159 1160 1161 1162 1163
| 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 已提交
1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175
**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>

S
shawn_he 已提交
1176
getMEID\(slotId?: number\): Promise\<string\>
S
shawn_he 已提交
1177

S
shawn_he 已提交
1178
Obtains the MEID for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
1179

S
shawn_he 已提交
1180
**System API**: This is a system API.
S
shawn_he 已提交
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197

**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 已提交
1198 1199
**Error codes**

S
shawn_he 已提交
1200 1201
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1202 1203 1204
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1205
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1206 1207 1208 1209 1210 1211
| 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 已提交
1212 1213 1214 1215 1216 1217 1218 1219
**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 已提交
1220
    console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1221 1222 1223 1224 1225
});
```

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

S
shawn_he 已提交
1226
getUniqueDeviceId\(callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
1227

S
shawn_he 已提交
1228
Obtains the unique device ID for the SIM card in a card slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1229

S
shawn_he 已提交
1230
**System API**: This is a system API.
S
shawn_he 已提交
1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241

**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 已提交
1242 1243
**Error codes**

S
shawn_he 已提交
1244 1245
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1246 1247 1248
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1249
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1250 1251 1252 1253 1254 1255
| 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 已提交
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
**Example**

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


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

S
shawn_he 已提交
1267
getUniqueDeviceId\(slotId: number, callback: AsyncCallback\<string\>\): void
S
shawn_he 已提交
1268

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

S
shawn_he 已提交
1271
**System API**: This is a system API.
S
shawn_he 已提交
1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283

**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 已提交
1284 1285
**Error codes**

S
shawn_he 已提交
1286 1287
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1288 1289 1290
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1291
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1292 1293 1294 1295 1296 1297
| 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 已提交
1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309
**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>

S
shawn_he 已提交
1310
getUniqueDeviceId\(slotId?: number\): Promise\<string\>
S
shawn_he 已提交
1311

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

S
shawn_he 已提交
1314
**System API**: This is a system API.
S
shawn_he 已提交
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331

**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 已提交
1332 1333
**Error codes**

S
shawn_he 已提交
1334 1335
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1336 1337 1338
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1339
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1340 1341 1342 1343 1344 1345
| 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 已提交
1346 1347 1348 1349 1350 1351 1352 1353
**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 已提交
1354
    console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1355 1356
});
```
S
shawn_he 已提交
1357

S
shawn_he 已提交
1358 1359
## radio.sendUpdateCellLocationRequest<sup>8+</sup>

S
shawn_he 已提交
1360
sendUpdateCellLocationRequest\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1361 1362 1363

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

S
shawn_he 已提交
1364
**System API**: This is a system API.
S
shawn_he 已提交
1365

S
shawn_he 已提交
1366
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1367

S
shawn_he 已提交
1368 1369 1370 1371 1372 1373 1374 1375
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

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

S
shawn_he 已提交
1376 1377
**Error codes**

S
shawn_he 已提交
1378 1379
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1380 1381 1382
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1383
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1384 1385 1386 1387 1388 1389
| 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 已提交
1390 1391 1392
**Example**

```js
S
shawn_he 已提交
1393 1394
radio.sendUpdateCellLocationRequest((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1395 1396 1397 1398 1399
});
```

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

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

S
shawn_he 已提交
1402
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 已提交
1403

S
shawn_he 已提交
1404
**System API**: This is a system API.
S
shawn_he 已提交
1405

S
shawn_he 已提交
1406
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1407

S
shawn_he 已提交
1408 1409 1410 1411 1412 1413
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

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

S
shawn_he 已提交
1417 1418
**Error codes**

S
shawn_he 已提交
1419 1420
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1421 1422 1423
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1424
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1425 1426 1427 1428 1429 1430
| 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 已提交
1431 1432 1433
**Example**

```js
S
shawn_he 已提交
1434
let slotId = 0;
S
shawn_he 已提交
1435 1436
radio.sendUpdateCellLocationRequest(slotId, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1437 1438 1439 1440 1441
});
```

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

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

S
shawn_he 已提交
1444
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 已提交
1445

S
shawn_he 已提交
1446
**System API**: This is a system API.
S
shawn_he 已提交
1447

S
shawn_he 已提交
1448
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1449

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

S
shawn_he 已提交
1452 1453 1454 1455 1456 1457
**Parameters**

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

S
shawn_he 已提交
1458 1459 1460 1461 1462 1463
**Return value**

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

S
shawn_he 已提交
1464 1465
**Error codes**

S
shawn_he 已提交
1466 1467
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1468 1469 1470
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1471
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1472 1473 1474 1475 1476 1477
| 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 已提交
1478 1479 1480
**Example**

```js
S
shawn_he 已提交
1481
let slotId = 0;
S
shawn_he 已提交
1482 1483 1484
radio.sendUpdateCellLocationRequest(slotId).then(() => {
    console.log(`sendUpdateCellLocationRequest success.`);
}).catch((err) => {
S
shawn_he 已提交
1485
    console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1486 1487 1488 1489 1490
});
```

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

S
shawn_he 已提交
1491
getCellInformation\(callback: AsyncCallback\<Array\<CellInformation\>\>\): void
S
shawn_he 已提交
1492 1493 1494

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

S
shawn_he 已提交
1495
**System API**: This is a system API.
S
shawn_he 已提交
1496

D
dingxiaochen 已提交
1497
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1498 1499 1500 1501 1502 1503 1504 1505 1506

**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 已提交
1507 1508
**Error codes**

S
shawn_he 已提交
1509 1510
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1511 1512 1513
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1514
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1515 1516 1517 1518 1519 1520
| 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 已提交
1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531
**Example**

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


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

S
shawn_he 已提交
1532
getCellInformation\(slotId: number, callback: AsyncCallback\<Array\<CellInformation\>\>\): void
S
shawn_he 已提交
1533

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

S
shawn_he 已提交
1536
**System API**: This is a system API.
S
shawn_he 已提交
1537

D
dingxiaochen 已提交
1538
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1539 1540 1541 1542 1543 1544 1545 1546 1547 1548

**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 已提交
1549 1550
**Error codes**

S
shawn_he 已提交
1551 1552
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1553 1554 1555
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1556
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1557 1558 1559 1560 1561 1562
| 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 已提交
1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574
**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>

S
shawn_he 已提交
1575
getCellInformation\(slotId?: number\): Promise\<Array\<CellInformation\>\>
S
shawn_he 已提交
1576

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

S
shawn_he 已提交
1579
**System API**: This is a system API.
S
shawn_he 已提交
1580

D
dingxiaochen 已提交
1581
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596

**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 已提交
1597 1598
**Error codes**

S
shawn_he 已提交
1599 1600
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1601 1602 1603
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1604
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1605 1606 1607 1608 1609 1610
| 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 已提交
1611 1612 1613 1614 1615 1616 1617 1618
**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 已提交
1619
    console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1620 1621 1622 1623 1624
});
```

## radio.setNetworkSelectionMode

S
shawn_he 已提交
1625
setNetworkSelectionMode\(options: NetworkSelectionModeOptions, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1626 1627 1628

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

S
shawn_he 已提交
1629
**System API**: This is a system API.
S
shawn_he 已提交
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641

**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 已提交
1642 1643
**Error codes**

S
shawn_he 已提交
1644 1645
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1646 1647 1648
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1649
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1650 1651 1652 1653 1654 1655
| 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 已提交
1656 1657 1658 1659 1660 1661
**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1662
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1663 1664 1665
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1666 1667
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1668 1669 1670
    networkInformation: networkInformation,
    resumeSelection: true
}
S
shawn_he 已提交
1671 1672
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1673 1674 1675 1676 1677
});
```

## radio.setNetworkSelectionMode

S
shawn_he 已提交
1678
setNetworkSelectionMode\(options: NetworkSelectionModeOptions\): Promise\<void\>
S
shawn_he 已提交
1679 1680 1681

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

S
shawn_he 已提交
1682
**System API**: This is a system API.
S
shawn_he 已提交
1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699

**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 已提交
1700 1701
**Error codes**

S
shawn_he 已提交
1702 1703
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1704 1705 1706
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1707
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1708 1709 1710 1711 1712 1713
| 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 已提交
1714 1715 1716 1717 1718 1719
**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1720
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1721 1722 1723
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1724 1725
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1726 1727 1728 1729
    networkInformation: networkInformation,
    resumeSelection: true
}
let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
S
shawn_he 已提交
1730 1731 1732
promise.then(() => {
    console.log(`setNetworkSelectionMode success.`);
}).catch((err) => {
S
shawn_he 已提交
1733
    console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1734 1735 1736 1737 1738
});
```

## radio.getNetworkSearchInformation

S
shawn_he 已提交
1739
getNetworkSearchInformation\(slotId: number, callback: AsyncCallback\<NetworkSearchResult\>\): void
S
shawn_he 已提交
1740

S
shawn_he 已提交
1741
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 已提交
1742

S
shawn_he 已提交
1743
**System API**: This is a system API.
S
shawn_he 已提交
1744 1745 1746 1747 1748 1749 1750 1751 1752 1753

**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 已提交
1754 1755 1756 1757
| callback | AsyncCallback\<[NetworkSearchResult](#networksearchresult)\> | Yes  | Callback used to return the result.          |

**Error codes**

S
shawn_he 已提交
1758 1759
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1760 1761 1762
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1763
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1764 1765 1766 1767 1768
| 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 已提交
1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779

**Example**

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

## radio.getNetworkSearchInformation

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

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

S
shawn_he 已提交
1784
**System API**: This is a system API.
S
shawn_he 已提交
1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801

**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 已提交
1802 1803
**Error codes**

S
shawn_he 已提交
1804 1805
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1806 1807 1808
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1809
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1810 1811 1812 1813 1814 1815
| 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 已提交
1816 1817 1818 1819 1820 1821 1822
**Example**

```js
let promise = radio.getNetworkSearchInformation(0);
promise.then(data => {
    console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1823
    console.log(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1824 1825 1826
});
```

S
shawn_he 已提交
1827
## radio.getNrOptionMode<sup>(deprecated)</sup>
S
shawn_he 已提交
1828

S
shawn_he 已提交
1829
getNrOptionMode\(callback: AsyncCallback\<NrOptionMode\>\): void
S
shawn_he 已提交
1830 1831 1832

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

S
shawn_he 已提交
1833 1834 1835 1836
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).

S
shawn_he 已提交
1837
**System API**: This is a system API.
S
shawn_he 已提交
1838 1839 1840 1841 1842 1843 1844

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

**Parameters**

| Name  | Type                                           | Mandatory| Description      |
| -------- | ----------------------------------------------- | ---- | ---------- |
S
shawn_he 已提交
1845
| callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
1846

S
shawn_he 已提交
1847 1848
**Error codes**

S
shawn_he 已提交
1849 1850
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1851 1852
| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1853
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1854 1855 1856 1857 1858 1859
| 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 已提交
1860 1861 1862 1863 1864 1865 1866 1867 1868
**Example**

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


S
shawn_he 已提交
1869
## radio.getNrOptionMode<sup>(deprecated)</sup>
S
shawn_he 已提交
1870

S
shawn_he 已提交
1871
getNrOptionMode\(slotId: number, callback: AsyncCallback\<NrOptionMode\>\): void
S
shawn_he 已提交
1872

S
shawn_he 已提交
1873 1874 1875 1876 1877
Obtains the NR option mode. This API uses an asynchronous callback to return the result.

> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).
S
shawn_he 已提交
1878

S
shawn_he 已提交
1879
**System API**: This is a system API.
S
shawn_he 已提交
1880 1881 1882 1883 1884 1885

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

**Parameters**

| Name  | Type                                           | Mandatory| Description                                  |
S
shawn_he 已提交
1886
| -------- | ----------------------------------------------- | ---- | ------------------------------------- |
S
shawn_he 已提交
1887
| slotId   | number                                          | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
1888
| callback | AsyncCallback\<[NrOptionMode](#nroptionmodedeprecated)\> | Yes  | Callback used to return the result.                   |
S
shawn_he 已提交
1889

S
shawn_he 已提交
1890 1891
**Error codes**

S
shawn_he 已提交
1892 1893
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1894 1895
| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1896
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1897 1898 1899 1900 1901 1902
| 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 已提交
1903 1904 1905 1906 1907 1908 1909 1910 1911 1912
**Example**

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


S
shawn_he 已提交
1913
## radio.getNrOptionMode<sup>(deprecated)</sup>
S
shawn_he 已提交
1914

S
shawn_he 已提交
1915
getNrOptionMode\(slotId?: number\): Promise\<NrOptionMode\>
S
shawn_he 已提交
1916

S
shawn_he 已提交
1917
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 已提交
1918

S
shawn_he 已提交
1919 1920 1921 1922
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [getNROptionMode](#radiogetnroptionmode10).

S
shawn_he 已提交
1923
**System API**: This is a system API.
S
shawn_he 已提交
1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934

**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**

S
shawn_he 已提交
1935 1936 1937
| Type                                              | Description                   |
| -------------------------------------------------- | ----------------------- |
| Promise\<[NrOptionMode](#nroptionmodedeprecated)\> | Promise used to return the result. |
S
shawn_he 已提交
1938

S
shawn_he 已提交
1939 1940
**Error codes**

S
shawn_he 已提交
1941 1942
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1943 1944
| ID|                 Error Message                    |
| -------- | -------------------------------------------- |
S
shawn_he 已提交
1945
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1946 1947 1948 1949 1950 1951
| 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 已提交
1952 1953 1954 1955 1956 1957 1958 1959
**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 已提交
1960
    console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1961 1962 1963 1964 1965
});
```

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

S
shawn_he 已提交
1966
turnOnRadio\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
1967 1968 1969

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

S
shawn_he 已提交
1970
**System API**: This is a system API.
S
shawn_he 已提交
1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981

**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 已提交
1982 1983
**Error codes**

S
shawn_he 已提交
1984 1985
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
1986 1987 1988
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
1989
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
1990 1991 1992 1993 1994 1995
| 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 已提交
1996 1997 1998
**Example**

```js
S
shawn_he 已提交
1999 2000
radio.turnOnRadio((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2001 2002 2003 2004 2005 2006
});
```


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

S
shawn_he 已提交
2007
turnOnRadio\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2008 2009 2010

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 已提交
2011
**System API**: This is a system API.
S
shawn_he 已提交
2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023

**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 已提交
2024 2025
**Error codes**

S
shawn_he 已提交
2026 2027
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2028 2029 2030
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2031
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2032 2033 2034 2035 2036 2037
| 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 已提交
2038 2039 2040 2041
**Example**

```js
let slotId = 0;
S
shawn_he 已提交
2042 2043
radio.turnOnRadio(slotId, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2044 2045 2046 2047 2048 2049
});
```


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

S
shawn_he 已提交
2050
turnOnRadio(slotId?: number): Promise\<void\>
S
shawn_he 已提交
2051 2052 2053

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 已提交
2054
**System API**: This is a system API.
S
shawn_he 已提交
2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071

**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 已提交
2072 2073
**Error codes**

S
shawn_he 已提交
2074 2075
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2076 2077 2078
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2079
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2080 2081 2082 2083 2084 2085
| 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
**Example**

```js
let slotId = 0;
S
shawn_he 已提交
2090 2091 2092
radio.turnOnRadio(slotId).then(() => {
    console.log(`turnOnRadio success.`);
}).catch((err) => {
S
shawn_he 已提交
2093
    console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2094 2095 2096 2097 2098
});
```

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

S
shawn_he 已提交
2099
turnOffRadio\(callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2100 2101 2102

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

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

**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 已提交
2115 2116
**Error codes**

S
shawn_he 已提交
2117 2118
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2119 2120 2121
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2122
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2123 2124 2125 2126 2127 2128
| 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
**Example**

```js
S
shawn_he 已提交
2132 2133
radio.turnOffRadio((err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2134 2135 2136 2137 2138 2139
});
```


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

S
shawn_he 已提交
2140
turnOffRadio\(slotId: number, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2141 2142 2143

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 已提交
2144
**System API**: This is a system API.
S
shawn_he 已提交
2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156

**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 已提交
2157 2158
**Error codes**

S
shawn_he 已提交
2159 2160
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2161 2162 2163
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2164
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2165 2166 2167 2168 2169 2170
| 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 已提交
2171 2172 2173 2174
**Example**

```js
let slotId = 0;
S
shawn_he 已提交
2175 2176
radio.turnOffRadio(slotId, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2177 2178 2179 2180 2181 2182
});
```


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

S
shawn_he 已提交
2183
turnOffRadio\(slotId?: number\): Promise\<void\>
S
shawn_he 已提交
2184 2185 2186

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 已提交
2187
**System API**: This is a system API.
S
shawn_he 已提交
2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204

**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 已提交
2205 2206
**Error codes**

S
shawn_he 已提交
2207 2208
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2209 2210 2211
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2212
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2213 2214 2215 2216 2217 2218
| 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 已提交
2219 2220 2221 2222
**Example**

```js
let slotId = 0;
S
shawn_he 已提交
2223 2224 2225
radio.turnOffRadio(slotId).then(() => {
    console.log(`turnOffRadio success.`);
}).catch((err) => {
S
shawn_he 已提交
2226
    console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2227 2228 2229 2230 2231
});
```

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

S
shawn_he 已提交
2232
setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode, callback: AsyncCallback\<void\>\): void
S
shawn_he 已提交
2233

S
shawn_he 已提交
2234
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 已提交
2235

S
shawn_he 已提交
2236
**System API**: This is a system API.
S
shawn_he 已提交
2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249

**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 已提交
2250 2251
**Error codes**

S
shawn_he 已提交
2252 2253
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2254 2255 2256
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2257
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2258 2259 2260 2261 2262 2263
| 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 已提交
2264 2265 2266
**Example**

```js
S
shawn_he 已提交
2267 2268 2269
let slotId = 0;
radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2270 2271 2272 2273 2274
});
```

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

S
shawn_he 已提交
2275
setPreferredNetwork\(slotId: number, networkMode: PreferredNetworkMode\): Promise\<void\>
S
shawn_he 已提交
2276

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

S
shawn_he 已提交
2279
**System API**: This is a system API.
S
shawn_he 已提交
2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297

**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 已提交
2298 2299
**Error codes**

S
shawn_he 已提交
2300 2301 2302
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

| ID|                  Error Message                    |
S
shawn_he 已提交
2303 2304
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2305
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2306 2307 2308 2309 2310 2311
| 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 已提交
2312 2313 2314
**Example**

```js
S
shawn_he 已提交
2315 2316 2317 2318
let slotId = 0;
radio.setPreferredNetwork(slotId, radio.PreferredNetworkMode.PREFERRED_NETWORK_MODE_GSM).then(() => {
    console.log(`setPreferredNetwork success.`);
}).catch((err) => {
S
shawn_he 已提交
2319
    console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2320 2321 2322 2323 2324
});
```

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

S
shawn_he 已提交
2325
getPreferredNetwork\(slotId: number, callback: AsyncCallback\<PreferredNetworkMode\>\): void
S
shawn_he 已提交
2326

S
shawn_he 已提交
2327
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 已提交
2328

S
shawn_he 已提交
2329
**System API**: This is a system API.
S
shawn_he 已提交
2330 2331 2332 2333 2334 2335 2336

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

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

**Parameters**

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

S
shawn_he 已提交
2342 2343
**Error codes**

S
shawn_he 已提交
2344 2345
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2346 2347 2348
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2349
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2350 2351 2352 2353 2354 2355
| 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 已提交
2356 2357 2358 2359 2360 2361 2362 2363 2364 2365
**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 已提交
2366
getPreferredNetwork\(slotId: number\): Promise\<PreferredNetworkMode\>
S
shawn_he 已提交
2367

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

S
shawn_he 已提交
2370
**System API**: This is a system API.
S
shawn_he 已提交
2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387

**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 已提交
2388 2389
**Error codes**

S
shawn_he 已提交
2390 2391
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2392 2393 2394
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2395
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2396 2397 2398 2399 2400 2401
| 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 已提交
2402 2403 2404 2405 2406 2407 2408
**Example**

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

S
shawn_he 已提交
2413 2414
## radio.getImsRegInfo<sup>9+</sup>

S
shawn_he 已提交
2415
getImsRegInfo\(slotId: number, imsType: ImsServiceType, callback: AsyncCallback\<ImsRegInfo\>\): void
S
shawn_he 已提交
2416

S
shawn_he 已提交
2417
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 已提交
2418

S
shawn_he 已提交
2419
**System API**: This is a system API.
S
shawn_he 已提交
2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432

**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 已提交
2433 2434
**Error codes**

S
shawn_he 已提交
2435 2436
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2437 2438 2439
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2440
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2441 2442 2443 2444 2445 2446
| 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 已提交
2447 2448 2449
**Example**

```js
S
shawn_he 已提交
2450
radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
S
shawn_he 已提交
2451 2452 2453 2454 2455 2456
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

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

S
shawn_he 已提交
2457
getImsRegInfo\(slotId: number, imsType: ImsServiceType\): Promise\<ImsRegInfo\>
S
shawn_he 已提交
2458

S
shawn_he 已提交
2459
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 已提交
2460

S
shawn_he 已提交
2461
**System API**: This is a system API.
S
shawn_he 已提交
2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479

**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 已提交
2480 2481
**Error codes**

S
shawn_he 已提交
2482 2483
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2484 2485 2486
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2487
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2488 2489 2490 2491 2492 2493
| 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 已提交
2494 2495 2496
**Example**

```js
S
shawn_he 已提交
2497
let promise = radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO);
S
shawn_he 已提交
2498 2499 2500
promise.then(data => {
    console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
2501
    console.log(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
2502 2503 2504 2505 2506
});
```

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

S
shawn_he 已提交
2507
on\(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback\<ImsRegInfo\>\): void
S
shawn_he 已提交
2508

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

S
shawn_he 已提交
2511
**System API**: This is a system API.
S
shawn_he 已提交
2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525

**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 已提交
2526 2527
**Error codes**

S
shawn_he 已提交
2528 2529
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2530 2531 2532
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2533
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2534 2535 2536 2537 2538 2539
| 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 已提交
2540 2541 2542
**Example**

```js
S
shawn_he 已提交
2543 2544
radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2545 2546 2547 2548 2549
});
```

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

S
shawn_he 已提交
2550
off\(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback\<ImsRegInfo\>\): void
S
shawn_he 已提交
2551

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

S
shawn_he 已提交
2554
**System API**: This is a system API.
S
shawn_he 已提交
2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566

**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.                         |
S
shawn_he 已提交
2567
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No  | Callback used to return the result. If this parameter is not set, the API unsubscribes from all callbacks.|
S
shawn_he 已提交
2568

S
shawn_he 已提交
2569 2570
**Error codes**

S
shawn_he 已提交
2571 2572
For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

S
shawn_he 已提交
2573 2574 2575
| ID|                  Error Message                   |
| -------- | -------------------------------------------- |
| 201      | Permission denied.                           |
S
shawn_he 已提交
2576
| 202      | Non-system applications use system APIs.     |
S
shawn_he 已提交
2577 2578 2579 2580 2581 2582
| 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 已提交
2583 2584 2585
**Example**

```js
S
shawn_he 已提交
2586 2587
radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, data => {
    console.log(`callback: data->${JSON.stringify(data)}`);
S
shawn_he 已提交
2588 2589 2590
});
```

S
shawn_he 已提交
2591 2592 2593 2594 2595

## radio.getBasebandVersion<sup>10+</sup>

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

S
shawn_he 已提交
2596
Obtains the baseband version of the device for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638

**System API**: This is a system API.

**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. Baseband version of the device.           |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

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


## radio.getBasebandVersion<sup>10+</sup>

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

S
shawn_he 已提交
2639
Obtains the baseband version of the device for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685

**System API**: This is a system API.

**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\<string\> | Promise used to return the result.     |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let promise = radio.getBasebandVersion(slotId);
promise.then(data => {
    console.log(`getBasebandVersion success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getBasebandVersion failed, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869
## radio.setNROptionMode<sup>10+</sup>

setNROptionMode\(slotId: number, mode: NROptionMode, callback: AsyncCallback\<void\>\): void

Sets the NR mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**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 |
| mode     | [NROptionMode](#nroptionmode10)                  | Yes  | Enumerates NR selection modes.                         |
| callback | AsyncCallback\<void\>                            | Yes  | Callback used to return the result.                             |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

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


## radio.setNROptionMode<sup>10+</sup>

setNROptionMode\(slotId: number, mode: NROptionMode\): Promise\<void\>

Sets the NR mode for the SIM card in the specified slot. This API uses a promise to return the result.

**System API**: This is a system API.

**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|
| mode   | [NROptionMode](#nroptionmode10) | Yes  | Enumerates NR selection modes.                        |

**Return value**

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

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let promise = radio.setNROptionMode(slotId, 1);
promise.then(data => {
    console.log(`setNROptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`setNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});
```


## radio.getNROptionMode<sup>10+</sup>

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

Obtains the NR option mode for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**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](#nroptionmode10)\> | Yes  | Callback used to return the result.                             |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

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


## radio.getNROptionMode<sup>10+</sup>

getNROptionMode\(slotId: number\): Promise\<NROptionMode\>

Obtains the NR option mode for the SIM card in the specified slot. This API uses a promise to return the result.

**System API**: This is a system API.

**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\<[NROptionMode](#nroptionmode10)\> | Promise used to return the result.|

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let promise = radio.getNROptionMode(slotId);
promise.then(data => {
    console.log(`getNROptionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.error(`getNROptionMode failed, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069
## radio.getNetworkCapability<sup>10+</sup>

getNetworkCapability\(slotId: number, type: NetworkCapabilityType, callback: AsyncCallback\<NetworkCapabilityState\>\): void

Obtains the network capability for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**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|
| type     | [NetworkCapabilityType](#networkcapabilitytype10)                      | Yes  | Network capability type.                       |
| callback | AsyncCallback\<[NetworkCapabilityState](#networkcapabilitystate10)\>   | Yes  | Callback used to return the result.                           |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

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


## radio.getNetworkCapability<sup>10+</sup>

getNetworkCapability\(slotId: number, type: NetworkCapabilityType\): Promise\<NetworkCapabilityState\>

Obtains the network capability for the SIM card in the specified slot. This API uses a promise to return the result.

**System API**: This is a system API.

**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|
| type     | [NetworkCapabilityType](#networkcapabilitytype10)               | Yes  | Network capability type.                       |

**Return value**

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

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let type = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
let promise = radio.getNetworkCapability(slotId, type);
promise.then(data => {
    console.log(`getNetworkCapability success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`getNetworkCapability failed, promise: err->${JSON.stringify(err)}`);
});
```


## radio.setNetworkCapability<sup>10+</sup>

setNetworkCapability\(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState,
      callback: AsyncCallback\<void\>\): void

Sets the network capability for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.

**System API**: This is a system API.

**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|
| type     | [NetworkCapabilityType](#networkcapabilitytype10)               | Yes  | Network capability type.                       |
| state    | [NetworkCapabilityState](#networkcapabilitystate10)             | Yes  | Network capability status.                       |
| callback | AsyncCallback\<void\>                                           | Yes  | Callback used to return the result.                           |

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let type = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
let state = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON;
radio.setNetworkCapability(slotId, type, state, (err) => {
    console.log(`callback: err->${JSON.stringify(err)}`);
});
```

## radio.setNetworkCapability<sup>10+</sup>

setNetworkCapability\(slotId: number, type: NetworkCapabilityType, state: NetworkCapabilityState\): Promise\<void\>

Sets the network capability for the SIM card in the specified slot. This API uses a promise to return the result.

**System API**: This is a system API.

**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|
| type     | [NetworkCapabilityType](#networkcapabilitytype10)               | Yes  | Network capability type.                       |
| state    | [NetworkCapabilityState](#networkcapabilitystate10)             | Yes  | Network capability status.                       |

**Return value**

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

**Error codes**

For details about the following error codes, see [Telephony Error Codes](../../reference/errorcodes/errorcode-telephony.md).

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

**Example**

```js
let slotId = 0;
let type = radio.NetworkCapabilityType.SERVICE_TYPE_NR;
let state = radio.NetworkCapabilityState.SERVICE_CAPABILITY_ON;
let promise = radio.setNetworkCapability(slotId, type, state);
promise.then(data => {
    console.log(`setNetworkCapability success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
    console.log(`setNetworkCapability failed, promise: err->${JSON.stringify(err)}`);
});
```


S
shawn_he 已提交
3070
## RadioTechnology
S
shawn_he 已提交
3071

S
shawn_he 已提交
3072
Enumerates radio access technologies.
S
shawn_he 已提交
3073

S
shawn_he 已提交
3074 3075 3076
**System capability**: SystemCapability.Telephony.CoreService

| Name                     | Value  | Description                                                        |
S
shawn_he 已提交
3077
| ------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093
| 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 已提交
3094 3095 3096

Defines the signal strength.

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

S
shawn_he 已提交
3099 3100 3101 3102
|      Name      |           Type             | Mandatory|      Description         |
| --------------- | --------------------------- | ---- | ------------------ |
| signalType      | [NetworkType](#networktype) | Yes  | Signal strength type.|
| signalLevel     | number                      | Yes  | Signal strength level.|
S
shawn_he 已提交
3103
| dBm<sup>9+</sup>| number                      | Yes  | Signal strength, in dBm.    |
S
shawn_he 已提交
3104

S
shawn_he 已提交
3105
## NetworkType
S
shawn_he 已提交
3106

S
shawn_he 已提交
3107
Enumerates network types.
S
shawn_he 已提交
3108

S
shawn_he 已提交
3109 3110 3111
**System capability**: SystemCapability.Telephony.CoreService

| Name                | Value  | Description                                                        |
S
shawn_he 已提交
3112
| -------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
3113 3114 3115 3116 3117 3118 3119
| 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 已提交
3120

S
shawn_he 已提交
3121
## NetworkState
S
shawn_he 已提交
3122

S
shawn_he 已提交
3123
Defines the network status.
S
shawn_he 已提交
3124

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

S
shawn_he 已提交
3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137
|       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 已提交
3138 3139


S
shawn_he 已提交
3140
## RegState
S
shawn_he 已提交
3141

S
shawn_he 已提交
3142
Defines the network status.
S
shawn_he 已提交
3143

S
shawn_he 已提交
3144 3145 3146 3147
**System capability**: SystemCapability.Telephony.CoreService

| Name                         | Value  | Description                      |
| ----------------------------- | ---- | -------------------------- |
S
shawn_he 已提交
3148 3149
| 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 已提交
3150
| REG_STATE_EMERGENCY_CALL_ONLY | 2    | The device can use only the emergency call service.|
S
shawn_he 已提交
3151
| 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 已提交
3152 3153


S
shawn_he 已提交
3154
## NsaState
S
shawn_he 已提交
3155 3156 3157

Enumerates NSA network states.

S
shawn_he 已提交
3158 3159 3160 3161 3162 3163 3164 3165 3166 3167
**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 已提交
3168 3169


S
shawn_he 已提交
3170
## NetworkSelectionMode
S
shawn_he 已提交
3171 3172 3173

Enumerates network selection modes.

S
shawn_he 已提交
3174 3175 3176 3177 3178 3179 3180
**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 已提交
3181 3182 3183 3184 3185

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

Enumerates preferred network modes.

S
shawn_he 已提交
3186
**System API**: This is a system API.
S
shawn_he 已提交
3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223

**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 已提交
3224
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 41   | NR+LTE+TD-SCDMA+WCDMA+GSM network mode.       |
S
shawn_he 已提交
3225 3226 3227 3228 3229 3230
| PREFERRED_NETWORK_MODE_MAX_VALUE                          | 99   | Maximum value of the preferred network mode.                         |

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

Defines the cell information.

S
shawn_he 已提交
3231
**System API**: This is a system API.
S
shawn_he 已提交
3232 3233 3234

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

S
shawn_he 已提交
3235 3236 3237 3238 3239 3240 3241
| 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 已提交
3242 3243 3244 3245 3246

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

Defines the CDMA cell information.

S
shawn_he 已提交
3247
**System API**: This is a system API.
S
shawn_he 已提交
3248 3249 3250

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

S
shawn_he 已提交
3251 3252 3253 3254 3255 3256 3257
| 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 已提交
3258 3259 3260 3261 3262

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

Defines the GSM cell information.

S
shawn_he 已提交
3263
**System API**: This is a system API.
S
shawn_he 已提交
3264 3265 3266

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

S
shawn_he 已提交
3267 3268 3269 3270 3271 3272 3273 3274
| 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 已提交
3275 3276 3277

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

S
shawn_he 已提交
3278
LTE cell information.
S
shawn_he 已提交
3279

S
shawn_he 已提交
3280
**System API**: This is a system API.
S
shawn_he 已提交
3281 3282 3283

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

S
shawn_he 已提交
3284 3285 3286 3287 3288 3289 3290 3291 3292 3293
| 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 已提交
3294 3295 3296

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

S
shawn_he 已提交
3297
Defines the 5G NR cell information.
S
shawn_he 已提交
3298

S
shawn_he 已提交
3299
**System API**: This is a system API.
S
shawn_he 已提交
3300 3301 3302

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

S
shawn_he 已提交
3303 3304 3305 3306 3307 3308 3309 3310
| 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 已提交
3311 3312 3313 3314 3315

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

Defines the TD-SCDMA cell information.

S
shawn_he 已提交
3316
**System API**: This is a system API.
S
shawn_he 已提交
3317 3318 3319

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

S
shawn_he 已提交
3320 3321 3322 3323 3324 3325 3326 3327
| 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 已提交
3328 3329 3330 3331 3332

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

Defines the WCDMA cell information.

S
shawn_he 已提交
3333
**System API**: This is a system API.
S
shawn_he 已提交
3334 3335 3336

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

S
shawn_he 已提交
3337 3338 3339 3340 3341 3342 3343 3344
| 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 已提交
3345

S
shawn_he 已提交
3346
## NrOptionMode<sup>(deprecated)</sup>
S
shawn_he 已提交
3347 3348 3349

Enumerates NR selection modes.

S
shawn_he 已提交
3350 3351 3352 3353
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 10. You are advised to use [NROptionMode](#nroptionmode10).

S
shawn_he 已提交
3354
**System API**: This is a system API.
S
shawn_he 已提交
3355 3356 3357 3358 3359 3360 3361

**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 已提交
3362
| NR_OPTION_SA_ONLY    | 2    | NR selection mode in 5G non-standalone networking.          |
S
shawn_he 已提交
3363 3364
| NR_OPTION_NSA_AND_SA | 3    | NR selection mode in non-standalone and standalone networking.|

S
shawn_he 已提交
3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379
## NROptionMode<sup>10+</sup>

Enumerates NR selection modes.

**System API**: This is a system API.

**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.        |
| NR_OPTION_SA_ONLY    | 2    | NR selection mode in 5G non-standalone networking.          |
| NR_OPTION_NSA_AND_SA | 3    | NR selection mode in non-standalone and standalone networking. |

S
shawn_he 已提交
3380 3381 3382 3383
## NetworkSearchResult

Defines the network search result.

S
shawn_he 已提交
3384
**System API**: This is a system API.
S
shawn_he 已提交
3385

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

S
shawn_he 已提交
3388 3389 3390 3391
| Name                  | Type                                             | Mandatory| Description          |
| ---------------------- | ------------------------------------------------- | ---- | -------------- |
| isNetworkSearchSuccess | boolean                                           |  Yes | Successful network search.|
| networkSearchResult    | Array<[NetworkInformation](#networkinformation)\> |  Yes | Network search result.|
S
shawn_he 已提交
3392 3393 3394 3395 3396

## NetworkInformation

Defines the network information.

S
shawn_he 已提交
3397
**System API**: This is a system API.
S
shawn_he 已提交
3398 3399 3400

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

S
shawn_he 已提交
3401 3402 3403 3404 3405 3406
| 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 已提交
3407 3408 3409 3410 3411

## NetworkInformationState

Enumerates network information states.

S
shawn_he 已提交
3412
**System API**: This is a system API.
S
shawn_he 已提交
3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426

**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 已提交
3427
**System API**: This is a system API.
S
shawn_he 已提交
3428 3429 3430

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

S
shawn_he 已提交
3431 3432 3433 3434 3435 3436
| 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 已提交
3437 3438 3439 3440 3441

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

Enumerates IMS registration states.

S
shawn_he 已提交
3442
**System API**: This is a system API.
S
shawn_he 已提交
3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454

**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 已提交
3455
**System API**: This is a system API.
S
shawn_he 已提交
3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469

**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 已提交
3470
**System API**: This is a system API.
S
shawn_he 已提交
3471 3472 3473

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

S
shawn_he 已提交
3474 3475 3476 3477
| Name       | Type                        | Mandatory| Description         |
| ----------- | ---------------------------- | ---- | ------------- |
| imsRegState | [ImsRegState](#imsregstate9) |  Yes | IMS registration state.|
| imsRegTech  | [ImsRegTech](#imsregtech9)   |  Yes | IMS registration technology.|
S
shawn_he 已提交
3478 3479 3480 3481 3482

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

Enumerates IMS service types.

S
shawn_he 已提交
3483
**System API**: This is a system API.
S
shawn_he 已提交
3484 3485 3486 3487 3488 3489 3490 3491 3492

**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.|
S
shawn_he 已提交
3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518

## NetworkCapabilityType<sup>10+</sup>

Network capability type.

**System API**: This is a system API.

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

| Name            | Value  | Description      |
| -----------------| ---- | ---------- |
| SERVICE_TYPE_LTE | 0    | LTE service.|
| SERVICE_TYPE_NR  | 1    | NR service.|

## NetworkCapabilityState<sup>10+</sup>

Defines the network capability switch status.

**System API**: This is a system API.

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

| Name                  | Value  | Description      |
| -----------------------| ---- | ---------- |
| SERVICE_CAPABILITY_OFF | 0    | The network capability is disabled.|
| SERVICE_CAPABILITY_ON  | 1    | The network capability is enabled.|