| type | string | Yes| Network status change event.|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | Yes| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Example**
...
...
@@ -37,11 +37,11 @@ observer.on('networkStateChange', data =>{
on\(type: \'networkStateChange\', options: { slotId: number }, callback: Callback<NetworkState\>\): void;
Registers an observer for network status change events of the SIM card in the specified slot. This function uses an asynchronous callback to return the execution result.
Registers an observer for network status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
| type | string | Yes| Network status change event.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | Yes| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | Yes | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
**Example**
...
...
@@ -64,11 +64,11 @@ observer.on('networkStateChange', {slotId: 0}, data =>{
| type | string | Yes| Network status change event.|
| callback | Callback\<[NetworkState](js-apis-radio.md#NetworkState)\> | No| Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#NetworkState).|
| type | string | Yes | Network status change event. |
| callback | Callback\<[NetworkState](js-apis-radio.md#networkstate)\> | No | Callback used to return the result. For details, see [NetworkState](js-apis-radio.md#networkstate).|
| type | string | Yes| Signal status change event.|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | Yes| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Example**
...
...
@@ -121,21 +121,21 @@ observer.on('signalInfoChange', data =>{
on\(type: \'signalInfoChange\', options: { slotId: number }, callback: Callback<Array<SignalInformation\>\>): void;
Registers an observer for signal status change events of the SIM card in the specified slot. This function uses an asynchronous callback to return the execution result.
Registers an observer for signal status change events of the SIM card in the specified slot. This API uses an asynchronous callback to return the execution result.
| type | string | Yes| Signal status change event.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | Yes| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | Yes | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
**Example**
...
...
@@ -146,11 +146,11 @@ observer.on('signalInfoChange', {slotId: 0}, data =>{
| type | string | Yes| Signal status change event.|
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#SignalInformation)\>\> | No| Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#SignalInformation).|
| type | string | Yes | Signal status change event. |
| callback | Callback<Array<[SignalInformation](js-apis-radio.md#signalinformation)\>\> | No | Callback used to return the result. For details, see [SignalInformation](js-apis-radio.md#signalinformation).|
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | Yes| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br/>**number**: phone number.|
| type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | Yes | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
**Example**
...
...
@@ -204,11 +204,11 @@ observer.on('callStateChange', value =>{
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | Yes| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br/>**number**: phone number.|
| type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#CallState), number: string }\> | No| Callback used to return the result. For details, see [CallState](js-apis-call.md#CallState)<br/>**number**: phone number.|
| type | string | Yes | Call status change event. |
| callback | Callback\<{ state: [CallState](js-apis-call.md#callstate), number: string }\> | No | Callback function. For details, see [CallState](js-apis-call.md#callstate) in call.<br>**number**: phone number.|
| type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Example**
```
observer.on('cellularDataConnectionStateChange', value =>{
Registers an observer for connection status change events of the cellular data link over the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | Yes | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
**Example**
```
observer.on('cellularDataConnectionStateChange', {slotId: 0}, value =>{
Unregisters the observer for connection status change events of the cellular data link. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
| type | string | Yes | Connection status change event of the cellular data link. |
| callback | Callback\<{ state: [DataConnectState](js-apis-telephony-data.md#dataconnectState), network: [RatType](js-apis-radio.md#radiotechnology) }\> | No | Callback used to return the result. For details, see [DataConnectState](js-apis-telephony-data.md#dataconnectstate) and [RadioTechnology](js-apis-radio.md#radiotechnology).|
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
Registers an observer for the uplink and downlink data flow status change events of the cellular data service. This API uses an asynchronous callback to return the result.
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
on\(type: 'cellularDataFlowChange', options: { slotId: number }, callback: Callback\<DataFlowType\>\): void;
Registers an observer for the uplink and downlink data flow status change events of the cellular data service on the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | Yes | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
**Example**
```
observer.on('cellularDataFlowChange', {slotId: 0}, data =>{
Unregisters the observer for the uplink and downlink data flow status change events of the cellular data service. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
| type | string | Yes | Uplink and downlink data flow status change event of the cellular data service. |
| callback | Callback\<[DataFlowType](js-apis-telephony-data.md#dataflowtype)\> | No | Callback used to return the result. For details, see [DataFlowType](js-apis-telephony-data.md#dataflowtype).|
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
Unregisters the observer for SIM card status change events. This API uses an asynchronous callback to return the result.
>**NOTE**
>
>You can pass the callback of the **on** function if you want to cancel listening for a certain type of event. If you do not pass the callback, you will cancel listening for all events.
// You can pass the callback of the on method to cancel listening for a certain type of callback. If you do not pass the callback, you will cancel listening for all callbacks.
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1 <br/> - **1**: slot 2|
| callback | AsyncCallback\<{psRadioTech: [RadioTechnology](#RadioTechnology), csRadioTech:[RadioTechnology](#RadioTechnology)}\> | Yes| Callback used to return the result.|
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This function uses an asynchronous callback to return the result.
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.
Obtains the ISO country code of the network with which the SIM card in the specified slot is registered. This function uses a promise to return the result.
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.
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This function uses an asynchronous callback to return the result.
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.
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | AsyncCallback\<Array\<[SignalInformation](#SignalInformation)\>\> | Yes| Callback used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.|
| callback | AsyncCallback\<Array\<[SignalInformation](#signalinformation)\>\> | Yes | Callback used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
Obtains a list of signal strengths of the network with which the SIM card in the specified slot is registered. This function uses a promise to return the result.
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.
| Promise\<Array\<[SignalInformation](#SignalInformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#SignalInformation) objects.|
| Promise\<Array\<[SignalInformation](#signalinformation)\>\> | Promise used to return the result, which is a list of [SignalInformation](#signalinformation) objects.|
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br/> - **true**: The radio service is enabled.<br/>- **false**: The radio service is disabled.|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
| slotId | number | Yes| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2|
| callback | AsyncCallback\<boolean\> | Yes| Callback used to return the result. <br/> - **true**: The radio service is enabled.<br/>- **false**: The radio service is disabled.|
| callback | AsyncCallback\<boolean\> | Yes | Callback used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
| slotId | number | No| Card slot ID. The options are as follows: <br/> - **0**: slot 1<br/> - **1**: slot 2<br/>If the slot ID is not specified, this function is defaulted to check whether the radio service is enabled on the primary SIM card.|
| 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.|
| Promise\<boolean\> | Promise used to return the result.<br/> - **true**: The radio service is enabled.<br/>- **false**: The radio service is disabled.|
| Promise\<boolean\> | Promise used to return the result.<br>- **true**: The radio service is enabled.<br>- **false**: The radio service is disabled.|
| longOperatorName | string | Long carrier name of the registered network.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| shortOperatorName | string | Short carrier name of the registered network.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| plmnNumeric | string | PLMN code of the registered network.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| isRoaming | boolean | Whether the user is roaming.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| regState | [RegState](#RegState) | Network registration status of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| cfgTech<sup>8+</sup> | [RadioTechnology](#RadioTechnology) | RAT of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| nsaState | [NsaState](#NsaState) | NSA network registration status of the device. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| isCaActive | boolean | CA status.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| isEmergency | boolean | Whether only emergency calls are allowed.<br/>**System capability**: SystemCapability.Telephony.CoreService|
| 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.|
| nsaState | [NsaState](#nsaState) | NSA network registration status of the device.|
| isCaActive | boolean | CA status.|
| isEmergency | boolean | Whether only emergency calls are allowed.|
| REG_STATE_NO_SERVICE | 0 | The device cannot use any service. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_IN_SERVICE | 1 | The device can use services normally. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_EMERGENCY_CALL_ONLY | 2 | The device can use only the emergency call service. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| REG_STATE_POWER_OFF | 3 | The cellular radio service is disabled. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_NOT_SUPPORT | 1 | The device is in idle or connected state in an LTE cell that does not support NSA. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_NO_DETECT | 2 | The device is in the idle state in an LTE cell that supports NSA but does not support NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_CONNECTED_DETECT | 3 | The device is connected to the LTE network in an LTE cell that supports NSA and NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_IDLE_DETECT | 4 | The device is in the idle state in an LTE cell that supports NSA and NR coverage detection. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_DUAL_CONNECTED | 5 | The device is connected to the LTE/NR network in an LTE cell that supports NSA. <br/>**System capability**: SystemCapability.Telephony.CoreService|
| NSA_STATE_SA_ATTACHED | 6 | The device is idle or connected to the NG-RAN cell when being attached to the 5G Core. <br/>**System capability**: SystemCapability.Telephony.CoreService|