js-apis-radio.md 81.4 KB
Newer Older
S
shawn_he 已提交
1 2
# Radio

S
shawn_he 已提交
3 4
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 已提交
5
>**NOTE**
S
shawn_he 已提交
6
>
Z
zengyawen 已提交
7
>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
S
shawn_he 已提交
8 9 10 11


## Modules to Import

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

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

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

S
shawn_he 已提交
20
Obtains the RAT used in the CS and PS domains for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
21

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

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

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

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

S
shawn_he 已提交
33
**Example**
S
shawn_he 已提交
34

S
shawn_he 已提交
35
```js
S
shawn_he 已提交
36 37 38 39 40
let slotId = 0;
radio.getRadioTech(slotId, (err, data) =>{ 
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
41 42


S
shawn_he 已提交
43
## radio.getRadioTech
S
shawn_he 已提交
44 45 46

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

S
shawn_he 已提交
47
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 已提交
48

S
shawn_he 已提交
49 50 51
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
53
**Parameters**
S
shawn_he 已提交
54

S
shawn_he 已提交
55
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
56
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
57
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
58

S
shawn_he 已提交
59
**Return value**
S
shawn_he 已提交
60

S
shawn_he 已提交
61
| Type                                                        | Description                                           |
S
shawn_he 已提交
62
| ------------------------------------------------------------ | ----------------------------------------------- |
S
shawn_he 已提交
63
| Promise<{psRadioTech: [RadioTechnology](#radiotechnology), csRadioTech: [RadioTechnology](#radiotechnology)}> | Promise used to return the result.|
S
shawn_he 已提交
64

S
shawn_he 已提交
65
**Example**
S
shawn_he 已提交
66

S
shawn_he 已提交
67
```js
S
shawn_he 已提交
68 69 70 71 72
let slotId = 0;
let promise = radio.getRadioTech(slotId);
promise.then(data => {
    console.log(`getRadioTech success, data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
73
    console.log(`getRadioTech failed, err->${JSON.stringify(err)}`);
S
shawn_he 已提交
74 75
});
```
S
shawn_he 已提交
76 77


S
shawn_he 已提交
78
## radio.getNetworkState
S
shawn_he 已提交
79 80 81

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

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

S
shawn_he 已提交
84 85 86
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
88
**Parameters**
S
shawn_he 已提交
89

S
shawn_he 已提交
90
| Name  | Type                                          | Mandatory| Description      |
S
shawn_he 已提交
91
| -------- | ---------------------------------------------- | ---- | ---------- |
S
shawn_he 已提交
92
| callback | AsyncCallback\<[NetworkState](#networkstate)\> | Yes  | Callback used to return the result.|
S
shawn_he 已提交
93

S
shawn_he 已提交
94
**Example**
S
shawn_he 已提交
95

S
shawn_he 已提交
96
```js
S
shawn_he 已提交
97 98 99 100
radio.getNetworkState((err, data) =>{
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
101 102


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

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

S
shawn_he 已提交
107
Obtains the network status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
108

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

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

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

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

S
shawn_he 已提交
120
**Example**
S
shawn_he 已提交
121

S
shawn_he 已提交
122
```js
S
shawn_he 已提交
123 124 125 126 127
let slotId = 0;
radio.getNetworkState(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
128 129


S
shawn_he 已提交
130
## radio.getNetworkState
S
shawn_he 已提交
131 132 133

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

S
shawn_he 已提交
134
Obtains the network status of the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
135

S
shawn_he 已提交
136 137 138
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

S
shawn_he 已提交
140
**Parameters**
S
shawn_he 已提交
141

S
shawn_he 已提交
142
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
143
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
144
| slotId | number | No  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
145

S
shawn_he 已提交
146
**Return value**
S
shawn_he 已提交
147

S
shawn_he 已提交
148
| Type                                    | Description                       |
S
shawn_he 已提交
149
| ---------------------------------------- | --------------------------- |
S
shawn_he 已提交
150
| Promise\<[NetworkState](#networkstate)\> | Promise used to return the result.|
S
shawn_he 已提交
151

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

S
shawn_he 已提交
154
```js
S
shawn_he 已提交
155 156 157 158 159
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 已提交
160
    console.log(`getNetworkState failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
161 162
});
```
S
shawn_he 已提交
163 164


S
shawn_he 已提交
165
## radio.getNetworkSelectionMode
S
shawn_he 已提交
166 167 168

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

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

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

S
shawn_he 已提交
173
**Parameters**
S
shawn_he 已提交
174

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

S
shawn_he 已提交
180
**Example**
S
shawn_he 已提交
181

S
shawn_he 已提交
182
```js
S
shawn_he 已提交
183 184 185 186 187
let slotId = 0;
radio.getNetworkSelectionMode(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
188 189


S
shawn_he 已提交
190
## radio.getNetworkSelectionMode
S
shawn_he 已提交
191 192 193

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

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

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

S
shawn_he 已提交
198
**Parameters**
S
shawn_he 已提交
199

S
shawn_he 已提交
200
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
201
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
202
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
203

S
shawn_he 已提交
204
**Return value**
S
shawn_he 已提交
205

S
shawn_he 已提交
206
| Type                                                    | Description                           |
S
shawn_he 已提交
207
| -------------------------------------------------------- | ------------------------------- |
S
shawn_he 已提交
208
| Promise\<[NetworkSelectionMode](#networkselectionmode)\> | Promise used to return the result.|
S
shawn_he 已提交
209

S
shawn_he 已提交
210
**Example**
S
shawn_he 已提交
211

S
shawn_he 已提交
212
```js
S
shawn_he 已提交
213 214 215 216 217
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 已提交
218
    console.log(`getNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
219 220
});
```
S
shawn_he 已提交
221 222


S
shawn_he 已提交
223
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
224 225 226

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

S
shawn_he 已提交
227
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 已提交
228

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

S
shawn_he 已提交
231
**Parameters**
S
shawn_he 已提交
232

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

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

S
shawn_he 已提交
240
```js
S
shawn_he 已提交
241 242 243 244 245
let slotId = 0;
radio.getISOCountryCodeForNetwork(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
246 247


S
shawn_he 已提交
248
## radio.getISOCountryCodeForNetwork<sup>7+</sup>
S
shawn_he 已提交
249 250 251

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

S
shawn_he 已提交
252
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 已提交
253

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

S
shawn_he 已提交
256
**Parameters**
S
shawn_he 已提交
257

S
shawn_he 已提交
258
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
259
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
260
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
261

S
shawn_he 已提交
262
**Return value**
S
shawn_he 已提交
263

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

S
shawn_he 已提交
268
**Example**
S
shawn_he 已提交
269

S
shawn_he 已提交
270
```js
S
shawn_he 已提交
271 272 273 274 275
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 已提交
276
    console.log(`getISOCountryCodeForNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
277 278
});
```
S
shawn_he 已提交
279 280


S
shawn_he 已提交
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
## 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                                                        |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback\<number\> | Yes  | Callback used to return the result.|

**Example**

S
shawn_he 已提交
297
```js
S
shawn_he 已提交
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319
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.|

**Example**

S
shawn_he 已提交
320
```js
S
shawn_he 已提交
321 322 323 324
let promise = radio.getPrimarySlotId();
promise.then(data => {
    console.log(`getPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
325
    console.error(`getPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
326 327 328 329 330
});
```


## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
331 332 333

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

S
shawn_he 已提交
334
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 已提交
335

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

S
shawn_he 已提交
338
**Parameters**
S
shawn_he 已提交
339

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

S
shawn_he 已提交
345
**Example**
S
shawn_he 已提交
346

S
shawn_he 已提交
347
```js
S
shawn_he 已提交
348 349 350 351 352
let slotId = 0;
radio.getSignalInformation(slotId, (err, data) => {
   console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
353 354


S
shawn_he 已提交
355
## radio.getSignalInformation<sup>7+</sup>
S
shawn_he 已提交
356 357 358

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

S
shawn_he 已提交
359
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 已提交
360

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

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

S
shawn_he 已提交
365
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
366
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
367
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
368

S
shawn_he 已提交
369
**Return value**
S
shawn_he 已提交
370

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

S
shawn_he 已提交
375
**Example**
S
shawn_he 已提交
376

S
shawn_he 已提交
377
```js
S
shawn_he 已提交
378 379 380 381 382
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 已提交
383
    console.error(`getSignalInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
384 385
});
```
S
shawn_he 已提交
386

S
shawn_he 已提交
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
## radio.isNrSupported<sup>7+</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);
```

S
shawn_he 已提交
408

S
shawn_he 已提交
409 410 411 412
## radio.isNrSupported<sup>8+</sup>

isNrSupported\(slotId: number\): boolean

S
shawn_he 已提交
413
Checks whether the current device supports 5G \(NR\) for the SIM card in the specified slot.
S
shawn_he 已提交
414 415 416 417 418 419 420

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

**Parameters**

| Name| Type  | Mandatory| Description                                  |
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
421
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
422 423 424 425 426 427 428 429 430

**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 已提交
431
```js
S
shawn_he 已提交
432 433
let slotId = 0;
let result = radio.isNrSupported(slotId);
S
shawn_he 已提交
434
console.log("Result: "+ result);
S
shawn_he 已提交
435 436 437 438
```


## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
439 440 441

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

S
shawn_he 已提交
442
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 已提交
443 444

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

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

S
shawn_he 已提交
448
**Parameters**
S
shawn_he 已提交
449

S
shawn_he 已提交
450
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
451
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
452
| 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 已提交
453

S
shawn_he 已提交
454
**Example**
S
shawn_he 已提交
455

S
shawn_he 已提交
456
```js
S
shawn_he 已提交
457 458 459 460
radio.isRadioOn((err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
S
shawn_he 已提交
461 462


S
shawn_he 已提交
463
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
464 465 466

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

S
shawn_he 已提交
467
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 已提交
468 469 470 471 472 473 474

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

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

**Parameters**

S
shawn_he 已提交
475
| Name  | Type                    | Mandatory| Description                                                   |
S
shawn_he 已提交
476
| -------- | ------------------------ | ---- | ------------------------------------------------------- |
S
shawn_he 已提交
477
| slotId   | number                   | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2                 |
S
shawn_he 已提交
478
| 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 已提交
479 480 481

**Example**

S
shawn_he 已提交
482
```js
S
shawn_he 已提交
483 484 485 486 487 488 489
let slotId = 0;
radio.isRadioOn(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
490
## radio.isRadioOn<sup>7+</sup>
S
shawn_he 已提交
491

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

S
shawn_he 已提交
494
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 已提交
495

S
shawn_he 已提交
496 497 498 499 500 501
**Required permission**: ohos.permission.GET_NETWORK_INFO

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

**Parameters**

S
shawn_he 已提交
502
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
503
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
504
| 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 已提交
505

S
shawn_he 已提交
506
**Return value**
S
shawn_he 已提交
507

S
shawn_he 已提交
508
| Type              | Description                                                        |
S
shawn_he 已提交
509
| ------------------ | ------------------------------------------------------------ |
S
shawn_he 已提交
510
| 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 已提交
511

S
shawn_he 已提交
512
**Example**
S
shawn_he 已提交
513

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


S
shawn_he 已提交
525
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
526 527 528

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

S
shawn_he 已提交
529
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 已提交
530 531 532 533 534

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

**Parameters**

S
shawn_he 已提交
535
| Name  | Type                   | Mandatory| Description                                      |
S
shawn_he 已提交
536
| -------- | ----------------------- | ---- | ------------------------------------------ |
S
shawn_he 已提交
537
| slotId   | number                  | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2    |
S
shawn_he 已提交
538
| callback | AsyncCallback\<string\> | Yes  | Callback used to return the result, which is the carrier name, for example, China Mobile.|
S
shawn_he 已提交
539 540 541

**Example**

S
shawn_he 已提交
542
```js
S
shawn_he 已提交
543 544 545 546 547 548 549
let slotId = 0;
radio.getOperatorName(slotId, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```


S
shawn_he 已提交
550
## radio.getOperatorName<sup>7+</sup>
S
shawn_he 已提交
551 552 553

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

S
shawn_he 已提交
554
Obtains the carrier name for the SIM card in the specified slot. This API uses a promise to return the result.
S
shawn_he 已提交
555 556 557 558 559

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

**Parameters**

S
shawn_he 已提交
560
| Name| Type  | Mandatory| Description                                  |
S
shawn_he 已提交
561
| ------ | ------ | ---- | -------------------------------------- |
S
shawn_he 已提交
562
| slotId | number | Yes  | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
S
shawn_he 已提交
563 564 565

**Return value**

S
shawn_he 已提交
566
| Type             | Description                                                        |
S
shawn_he 已提交
567
| ----------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
568
| Promise\<string\> | Promise used t return the result, which is the carrier name, for example, China Mobile.               |
S
shawn_he 已提交
569 570 571

**Example**

S
shawn_he 已提交
572
```js
S
shawn_he 已提交
573 574 575 576 577
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 已提交
578
    console.log(`getOperatorName failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
579 580 581
});
```

S
shawn_he 已提交
582 583 584 585 586 587
## radio.setPrimarySlotId<sup>8+</sup>

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

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

S
shawn_he 已提交
588
**System API**: This is a system API.
S
shawn_he 已提交
589 590 591 592 593 594 595 596 597 598

**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 已提交
599
| callback | AsyncCallback\<void\> | Yes  | Callback used to return the result. |
S
shawn_he 已提交
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616

**Example**

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


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

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

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

S
shawn_he 已提交
617
**System API**: This is a system API.
S
shawn_he 已提交
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632

**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 已提交
633
| Promise\<void\> | Promise used to return the result.|
S
shawn_he 已提交
634 635 636 637 638 639 640 641 642

**Example**

```js
let slotId = 0;
let promise = radio.setPrimarySlotId(slotId);
promise.then(data => {
    console.log(`setPrimarySlotId success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
643
    console.log(`setPrimarySlotId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
644 645 646 647 648 649 650 651 652
});
```

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

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

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

S
shawn_he 已提交
653
**System API**: This is a system API.
S
shawn_he 已提交
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679

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

**Example**

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


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

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

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

S
shawn_he 已提交
680
**System API**: This is a system API.
S
shawn_he 已提交
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708

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

**Example**

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


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

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

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

S
shawn_he 已提交
709
**System API**: This is a system API.
S
shawn_he 已提交
710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734

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

**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 已提交
735
    console.error(`getIMEI failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
736 737 738 739 740 741 742 743 744
});
```

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

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

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

S
shawn_he 已提交
745
**System API**: This is a system API.
S
shawn_he 已提交
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771

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

**Example**

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


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

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

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

S
shawn_he 已提交
772
**System API**: This is a system API.
S
shawn_he 已提交
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800

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

**Example**

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


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

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

Obtains the MEID of the SIM card in the specified slot. This API uses a promise to return the result.

S
shawn_he 已提交
801
**System API**: This is a system API.
S
shawn_he 已提交
802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826

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

**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 已提交
827
    console.error(`getMEID failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
828 829 830 831 832 833 834 835 836
});
```

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

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

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

S
shawn_he 已提交
837
**System API**: This is a system API.
S
shawn_he 已提交
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863

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

**Example**

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


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

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

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

S
shawn_he 已提交
864
**System API**: This is a system API.
S
shawn_he 已提交
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892

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

**Example**

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


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

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

Obtains the unique device ID of the SIM card in the specified slot. This API uses a promise to return the result.

S
shawn_he 已提交
893
**System API**: This is a system API.
S
shawn_he 已提交
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918

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

**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 已提交
919
    console.error(`getUniqueDeviceId failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
920 921
});
```
S
shawn_he 已提交
922

S
shawn_he 已提交
923 924 925 926 927 928
## radio.sendUpdateCellLocationRequest<sup>8+</sup>

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

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

S
shawn_he 已提交
929
**System API**: This is a system API.
S
shawn_he 已提交
930

D
dingxiaochen 已提交
931
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

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

**Example**

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

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

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

S
shawn_he 已提交
952
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 已提交
953

S
shawn_he 已提交
954
**System API**: This is a system API.
S
shawn_he 已提交
955

D
dingxiaochen 已提交
956
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
957 958 959 960 961 962
**System capability**: SystemCapability.Telephony.CoreService

**Parameters**

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

**Example**

```js
S
shawn_he 已提交
969 970
let slotId = 0;
radio.sendUpdateCellLocationRequest(slotId, (err, data) => {
S
shawn_he 已提交
971 972 973 974 975 976
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

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

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

S
shawn_he 已提交
979
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 已提交
980

S
shawn_he 已提交
981
**System API**: This is a system API.
S
shawn_he 已提交
982

D
dingxiaochen 已提交
983
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
984 985
**System capability**: SystemCapability.Telephony.CoreService

S
shawn_he 已提交
986 987 988 989 990 991
**Parameters**

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

S
shawn_he 已提交
992 993 994 995 996 997 998 999 1000
**Return value**

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

**Example**

```js
S
shawn_he 已提交
1001 1002
let slotId = 0;
let promise = radio.sendUpdateCellLocationRequest(slotId);
S
shawn_he 已提交
1003 1004 1005
promise.then(data => {
    console.log(`sendUpdateCellLocationRequest success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1006
    console.log(`sendUpdateCellLocationRequest failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1007 1008 1009 1010 1011 1012 1013 1014 1015
});
```

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

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

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

S
shawn_he 已提交
1016
**System API**: This is a system API.
S
shawn_he 已提交
1017

D
dingxiaochen 已提交
1018
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040

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

**Parameters**

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

**Example**

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


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

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

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

S
shawn_he 已提交
1043
**System API**: This is a system API.
S
shawn_he 已提交
1044

D
dingxiaochen 已提交
1045
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069

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

**Example**

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


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

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

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

S
shawn_he 已提交
1072
**System API**: This is a system API.
S
shawn_he 已提交
1073

D
dingxiaochen 已提交
1074
**Required permissions**: ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION
S
shawn_he 已提交
1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097

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

**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 已提交
1098
    console.error(`getCellInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1099 1100 1101 1102 1103 1104 1105 1106 1107
});
```

## radio.setNetworkSelectionMode

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

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

S
shawn_he 已提交
1108
**System API**: This is a system API.
S
shawn_he 已提交
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126

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

**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1127
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1128 1129 1130
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1131 1132
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146
    networkInformation: networkInformation,
    resumeSelection: true
}
radio.setNetworkSelectionMode(networkSelectionModeOptions, (err, data) => {
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

## radio.setNetworkSelectionMode

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

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

S
shawn_he 已提交
1147
**System API**: This is a system API.
S
shawn_he 已提交
1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170

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

**Example**

```js
let networkInformation={
    operatorName: "China Mobile",
    operatorNumeric: "898600",
S
shawn_he 已提交
1171
    state: radio.NetworkInformationState.NETWORK_AVAILABLE,
S
shawn_he 已提交
1172 1173 1174
    radioTech: "CS"
}
let networkSelectionModeOptions={
S
shawn_he 已提交
1175 1176
    slotId: 0,
    selectMode: radio.NetworkSelectionMode.NETWORK_SELECTION_AUTOMATIC,
S
shawn_he 已提交
1177 1178 1179 1180 1181 1182 1183
    networkInformation: networkInformation,
    resumeSelection: true
}
let promise = radio.setNetworkSelectionMode(networkSelectionModeOptions);
promise.then(data => {
    console.log(`setNetworkSelectionMode success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1184
    console.log(`setNetworkSelectionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1185 1186 1187 1188 1189 1190 1191
});
```

## radio.getNetworkSearchInformation

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

S
shawn_he 已提交
1192
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 已提交
1193

S
shawn_he 已提交
1194
**System API**: This is a system API.
S
shawn_he 已提交
1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216

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

**Example**

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

## radio.getNetworkSearchInformation

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

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

S
shawn_he 已提交
1221
**System API**: This is a system API.
S
shawn_he 已提交
1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245

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

**Example**

```js
let promise = radio.getNetworkSearchInformation(0);
promise.then(data => {
    console.log(`getNetworkSearchInformation success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1246
    console.log(`getNetworkSearchInformation failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1247 1248 1249 1250 1251 1252 1253 1254 1255
});
```

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

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

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

S
shawn_he 已提交
1256
**System API**: This is a system API.
S
shawn_he 已提交
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278

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

**Parameters**

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

**Example**

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


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

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

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

S
shawn_he 已提交
1281
**System API**: This is a system API.
S
shawn_he 已提交
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305

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

**Parameters**

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

**Example**

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


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

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

S
shawn_he 已提交
1306
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 已提交
1307

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

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

**Parameters**

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

**Return value**

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

**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 已提交
1332
    console.error(`getNrOptionMode failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1333 1334 1335 1336 1337 1338 1339 1340 1341
});
```

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

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

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

S
shawn_he 已提交
1342
**System API**: This is a system API.
S
shawn_he 已提交
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368

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

**Example**

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


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

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

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

S
shawn_he 已提交
1369
**System API**: This is a system API.
S
shawn_he 已提交
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397

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

**Example**

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


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

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

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

S
shawn_he 已提交
1398
**System API**: This is a system API.
S
shawn_he 已提交
1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423

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

**Example**

```js
let slotId = 0;
let promise = radio.turnOnRadio(slotId);
promise.then(data => {
    console.log(`turnOnRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1424
    console.error(`turnOnRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1425 1426 1427 1428 1429 1430 1431 1432 1433
});
```

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

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

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

S
shawn_he 已提交
1434
**System API**: This is a system API.
S
shawn_he 已提交
1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460

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

**Example**

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


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

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

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

S
shawn_he 已提交
1461
**System API**: This is a system API.
S
shawn_he 已提交
1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489

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

**Example**

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


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

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

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

S
shawn_he 已提交
1490
**System API**: This is a system API.
S
shawn_he 已提交
1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515

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

**Example**

```js
let slotId = 0;
let promise = radio.turnOffRadio(slotId);
promise.then(data => {
    console.log(`turnOffRadio success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1516
    console.error(`turnOffRadio failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1517 1518 1519 1520 1521 1522 1523
});
```

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

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

S
shawn_he 已提交
1524
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 已提交
1525

S
shawn_he 已提交
1526
**System API**: This is a system API.
S
shawn_he 已提交
1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551

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

**Example**

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

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

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

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

S
shawn_he 已提交
1554
**System API**: This is a system API.
S
shawn_he 已提交
1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579

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

**Example**

```js
let promise = radio.setPreferredNetwork(0, 1);
promise.then(data => {
    console.log(`setPreferredNetwork success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1580
    console.log(`setPreferredNetwork failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1581 1582 1583 1584 1585 1586 1587
});
```

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

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

S
shawn_he 已提交
1588
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 已提交
1589

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

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

**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 已提交
1613
getPreferredNetwork(slotId: number): Promise<PreferredNetworkMode\>
S
shawn_he 已提交
1614

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

S
shawn_he 已提交
1617
**System API**: This is a system API.
S
shawn_he 已提交
1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641

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

**Example**

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

S
shawn_he 已提交
1646 1647 1648 1649
## radio.getImsRegInfo<sup>9+</sup>

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

S
shawn_he 已提交
1650
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 已提交
1651

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

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

**Example**

```js
S
shawn_he 已提交
1669
radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
S
shawn_he 已提交
1670 1671 1672 1673 1674 1675 1676 1677
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

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

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

S
shawn_he 已提交
1678
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 已提交
1679

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

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

**Example**

```js
S
shawn_he 已提交
1702
let promise = radio.getImsRegInfo(0, radio.ImsServiceType.TYPE_VIDEO);
S
shawn_he 已提交
1703 1704 1705
promise.then(data => {
    console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
S
shawn_he 已提交
1706
    console.log(`getImsRegInfo failed, promise: err->${JSON.stringify(err)}`);
S
shawn_he 已提交
1707 1708 1709 1710 1711 1712 1713
});
```

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

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

S
shawn_he 已提交
1714
Enables listening for **imsRegStateChange** events for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1715

S
shawn_he 已提交
1716
**System API**: This is a system API.
S
shawn_he 已提交
1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733

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

**Example**

```js
S
shawn_he 已提交
1734
radio.on('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
S
shawn_he 已提交
1735 1736 1737 1738 1739 1740 1741 1742
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

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

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

S
shawn_he 已提交
1743
Disables listening for **imsRegStateChange** events for the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
S
shawn_he 已提交
1744

S
shawn_he 已提交
1745
**System API**: This is a system API.
S
shawn_he 已提交
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762

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

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

**Parameters**

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

**Example**

```js
S
shawn_he 已提交
1763
radio.off('imsRegStateChange', 0, radio.ImsServiceType.TYPE_VIDEO, (err, data) => {
S
shawn_he 已提交
1764 1765 1766 1767
    console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```

S
shawn_he 已提交
1768
## RadioTechnology
S
shawn_he 已提交
1769

S
shawn_he 已提交
1770
Enumerates radio access technologies.
S
shawn_he 已提交
1771

S
shawn_he 已提交
1772 1773 1774
**System capability**: SystemCapability.Telephony.CoreService

| Name                     | Value  | Description                                                        |
S
shawn_he 已提交
1775
| ------------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791
| 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 已提交
1792 1793 1794

Defines the signal strength.

S
shawn_he 已提交
1795 1796 1797 1798 1799 1800
**System capability**: SystemCapability.Telephony.CoreService

| Name     | Type                       | Description              |
| ----------- | --------------------------- | ------------------ |
| signalType  | [NetworkType](#networktype) | Signal strength type.|
| signalLevel | number                      | Signal strength level.|
S
shawn_he 已提交
1801 1802


S
shawn_he 已提交
1803
## NetworkType
S
shawn_he 已提交
1804

S
shawn_he 已提交
1805
Enumerates network types.
S
shawn_he 已提交
1806

S
shawn_he 已提交
1807 1808 1809
**System capability**: SystemCapability.Telephony.CoreService

| Name                | Value  | Description                                                        |
S
shawn_he 已提交
1810
| -------------------- | ---- | ------------------------------------------------------------ |
S
shawn_he 已提交
1811 1812 1813 1814 1815 1816 1817
| 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 已提交
1818

S
shawn_he 已提交
1819
## NetworkState
S
shawn_he 已提交
1820

S
shawn_he 已提交
1821
Defines the network status.
S
shawn_he 已提交
1822

S
shawn_he 已提交
1823 1824 1825
**System capability**: SystemCapability.Telephony.CoreService

| Name           | Type                 | Description                                                        |
S
shawn_he 已提交
1826
| ----------------- | --------------------- | ------------------------------------------------------------ |
S
shawn_he 已提交
1827 1828 1829 1830 1831 1832
| longOperatorName  | string                | Long carrier name of the registered network.|
| shortOperatorName | string                | Short carrier name of the registered network.|
| plmnNumeric       | string                | PLMN code of the registered network.|
| isRoaming         | boolean               | Whether the user is roaming.|
| regState          | [RegState](#regstate) | Network registration status of the device.|
| cfgTech<sup>8+</sup> | [RadioTechnology](#radiotechnology) | RAT of the device.|
S
shawn_he 已提交
1833
| nsaState          | [NsaState](#nsastate) | NSA network registration status of the device.|
S
shawn_he 已提交
1834 1835
| isCaActive        | boolean               | CA status.|
| isEmergency       | boolean               | Whether only emergency calls are allowed.|
S
shawn_he 已提交
1836 1837


S
shawn_he 已提交
1838
## RegState
S
shawn_he 已提交
1839

S
shawn_he 已提交
1840
Defines the network status.
S
shawn_he 已提交
1841

S
shawn_he 已提交
1842 1843 1844 1845
**System capability**: SystemCapability.Telephony.CoreService

| Name                         | Value  | Description                      |
| ----------------------------- | ---- | -------------------------- |
S
shawn_he 已提交
1846 1847 1848 1849
| 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.    |
| REG_STATE_EMERGENCY_CALL_ONLY | 2    | The device can use only the emergency call service.    |
| 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 已提交
1850 1851


S
shawn_he 已提交
1852
## NsaState
S
shawn_he 已提交
1853 1854 1855

Enumerates NSA network states.

S
shawn_he 已提交
1856 1857 1858 1859 1860 1861 1862 1863 1864 1865
**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 已提交
1866 1867


S
shawn_he 已提交
1868
## NetworkSelectionMode
S
shawn_he 已提交
1869 1870 1871

Enumerates network selection modes.

S
shawn_he 已提交
1872 1873 1874 1875 1876 1877 1878
**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 已提交
1879 1880 1881 1882 1883

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

Enumerates preferred network modes.

S
shawn_he 已提交
1884
**System API**: This is a system API.
S
shawn_he 已提交
1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928

**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.       |
| PREFERRED_NETWORK_MODE_NR_LTE_TDSCDMA_WCDMA_GSM_EVDO_CDMA | 41   | NR+LTE+TD-SCDMA+WCDMA+GSM+EVDO+CDMA network mode.       |
| PREFERRED_NETWORK_MODE_MAX_VALUE                          | 99   | Maximum value of the preferred network mode.                         |

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

Defines the cell information.

S
shawn_he 已提交
1929
**System API**: This is a system API.
S
shawn_he 已提交
1930 1931 1932 1933 1934

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

| Name             | Type                                                        | Description                                                        |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
S
shawn_he 已提交
1935
| networkType       | [NetworkType](#networktype)                                  | Network type of the cell.                                    |
S
shawn_he 已提交
1936 1937 1938
| isCamped          | boolean                                                      | Status of the cell.                                        |
| timeStamp         | number                                                       | Timestamp when cell information is obtained.                                |
| signalInformation | [SignalInformation](#signalinformation)                      | Signal information.                                                  |
S
shawn_he 已提交
1939
| data              | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | CDMA cell information \|GSM cell information \|LTE cell information \|NR cell information \|TD-SCDMA cell information|
S
shawn_he 已提交
1940 1941 1942 1943 1944

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

Defines the CDMA cell information.

S
shawn_he 已提交
1945
**System API**: This is a system API.
S
shawn_he 已提交
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960

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

| Name     | Type  | Description        |
| --------- | ------ | ------------ |
| baseId    | number | Base station ID.    |
| latitude  | number | Longitude.      |
| longitude | number | Latitude.      |
| nid       | number | Network ID.|
| sid       | number | System ID.|

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

Defines the GSM cell information.

S
shawn_he 已提交
1961
**System API**: This is a system API.
S
shawn_he 已提交
1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977

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

| Name  | Type  | Description                |
| ------ | ------ | -------------------- |
| lac    | number | Location area code.        |
| cellId | number | Cell ID.            |
| arfcn  | number | Absolute radio frequency channel number.|
| bsic   | number | Base station ID.        |
| mcc    | string | Mobile country code.        |
| mnc    | string | Mobile network code.          |

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

Defines the LTE cell information.

S
shawn_he 已提交
1978
**System API**: This is a system API.
S
shawn_he 已提交
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996

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

| Name         | Type   | Description                   |
| ------------- | ------- | ----------------------- |
| cgi           | number  | Cell global identification.         |
| pci           | number  | Physical cell ID.         |
| tac           | number  | Tracking area code.         |
| earfcn        | number  | Absolute radio frequency channel number.   |
| bandwidth     | number  | Bandwidth.                 |
| mcc           | string  | Mobile country code.           |
| mnc           | string  | Mobile network code.             |
| isSupportEndc | boolean | Support New Radio_Dual Connectivity|

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

Defines the NR cell information.

S
shawn_he 已提交
1997
**System API**: This is a system API.
S
shawn_he 已提交
1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013

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

| Name   | Type  | Description            |
| ------- | ------ | ---------------- |
| nrArfcn | number | 5G frequency number.      |
| pci     | number | Physical cell ID.  |
| tac     | number | Tracking area code.  |
| nci     | number | 5G network cell ID.|
| mcc     | string | Mobile country code.    |
| mnc     | string | Mobile network code.      |

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

Defines the TD-SCDMA cell information.

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

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

| Name  | Type  | Description        |
| ------ | ------ | ------------ |
| lac    | number | Location area code.|
| cellId | number | Cell ID.    |
| cpid   | number | Cell parameter ID.|
| uarfcn | number | Absolute radio frequency number.|
| mcc    | string | Mobile country code.|
| mnc    | string | Mobile network code.  |

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

Defines the WCDMA cell information.

S
shawn_he 已提交
2031
**System API**: This is a system API.
S
shawn_he 已提交
2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047

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

| Name  | Type  | Description        |
| ------ | ------ | ------------ |
| lac    | number | Location area code.|
| cellId | number | Cell ID.    |
| psc    | number | Primary scrambling code.    |
| uarfcn | number | Absolute radio frequency number.|
| mcc    | string | Mobile country code.|
| mnc    | string | Mobile network code.  |

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

Enumerates NR selection modes.

S
shawn_he 已提交
2048
**System API**: This is a system API.
S
shawn_he 已提交
2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062

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

## NetworkSearchResult

Defines the network search result.

S
shawn_he 已提交
2063
**System API**: This is a system API.
S
shawn_he 已提交
2064

S
shawn_he 已提交
2065 2066 2067 2068 2069
**System capability**: SystemCapability.Telephony.CoreService

| Name                  | Type                                             | Description          |
| ---------------------- | ------------------------------------------------- | -------------- |
| isNetworkSearchSuccess | boolean                                           | Successful network search.|
S
shawn_he 已提交
2070
| networkSearchResult    | Array<[NetworkInformation](#networkinformation)\> | Network search result.|
S
shawn_he 已提交
2071 2072 2073 2074 2075

## NetworkInformation

Defines the network information.

S
shawn_he 已提交
2076
**System API**: This is a system API.
S
shawn_he 已提交
2077 2078 2079 2080 2081 2082 2083

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

| Name           | Type                                     | Description          |
| --------------- | ----------------------------------------- | -------------- |
| operatorName    | string                                    | Carrier name.|
| operatorNumeric | string                                    | Carrier number.  |
S
shawn_he 已提交
2084
| state           | [NetworkInformation](#networkinformationstate) | Network information status.|
S
shawn_he 已提交
2085 2086 2087 2088 2089 2090
| radioTech       | string                                    | Radio technology.  |

## NetworkInformationState

Enumerates network information states.

S
shawn_he 已提交
2091
**System API**: This is a system API.
S
shawn_he 已提交
2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105

**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 已提交
2106
**System API**: This is a system API.
S
shawn_he 已提交
2107 2108 2109 2110 2111 2112 2113 2114 2115

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

| Name              | Type                                         | Description                                  |
| ------------------ | --------------------------------------------- | -------------------------------------- |
| slotId             | number                                        | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| selectMode         | [NetworkSelectionMode](#networkselectionmode) | Network selection mode.                       |
| networkInformation | [NetworkInformation](#networkinformation)    | Network information.                           |
| resumeSelection    | boolean                                       | Whether to resume selection.                            |
S
shawn_he 已提交
2116 2117 2118 2119 2120

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

Enumerates IMS registration states.

S
shawn_he 已提交
2121
**System API**: This is a system API.
S
shawn_he 已提交
2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133

**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 已提交
2134
**System API**: This is a system API.
S
shawn_he 已提交
2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148

**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 已提交
2149
**System API**: This is a system API.
S
shawn_he 已提交
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161

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

| Name       | Type                        | Description         |
| ----------- | ---------------------------- | ------------- |
| imsRegState | [ImsRegState](#imsregstate9) | IMS registration state.|
| imsRegTech  | [ImsRegTech](#imsregtech9)   | IMS registration technology.|

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

Enumerates IMS service types.

S
shawn_he 已提交
2162
**System API**: This is a system API.
S
shawn_he 已提交
2163 2164 2165 2166 2167 2168 2169 2170 2171

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