public class CellularDataStateObserver extends Object
This class can observe updates of the uplink and downlink data flow states and the data link connection state.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
OBSERVE_MASK_DATA_CONNECTION_STATE |
Indicates an observer mask for updates to the cellular data connection state.
|
static int |
OBSERVE_MASK_DATA_FLOW |
Indicates an observer mask for updates to the direction of cellular data traffic.
|
| 构造器 | 说明 |
|---|---|
CellularDataStateObserver(int slotId) |
Creates a
CellularDataStateObserver instance. |
CellularDataStateObserver(int slotId,
EventRunner runner) |
CellularDataStateObserver Constructor.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
onCellularDataConnectStateUpdated(int state,
int networkType) |
Called when the cellular data link connection state updates.
|
void |
onCellularDataFlow(int direction) |
Called when the uplink and downlink data flow state of cellular data services updates.
|
public static final int OBSERVE_MASK_DATA_CONNECTION_STATE
onCellularDataConnectStateUpdated(int, int),
常量字段值public static final int OBSERVE_MASK_DATA_FLOW
onCellularDataFlow(int),
常量字段值public CellularDataStateObserver(int slotId)
CellularDataStateObserver instance. Callback will be invoked in the current thread.
Callback will invoked in the current threadslotId - Indicates the ID of the target card slot.
The value 0 indicates card 1, and the value 1 indicates card 2.public CellularDataStateObserver(int slotId,
EventRunner runner)
slotId - Indicates the ID of the target card slot.
The value 0 indicates card 1, and the value 1 indicates card 2.runner - param to init an event handler.IllegalArgumentException - thrown when invalid runner is used as parameter.public void onCellularDataFlow(int direction)
direction - Indicates the cellular data flow state.
public void onCellularDataConnectStateUpdated(int state,
int networkType)
state - Indicates the cellular data link connection state.
networkType - Indicates the radio access technology for cellular data services.
TelephonyConstants#RADIO_TECHNOLOGY_GSM
TelephonyConstants#RADIO_TECHNOLOGY_1XRTT
TelephonyConstants#RADIO_TECHNOLOGY_WCDMA
TelephonyConstants#RADIO_TECHNOLOGY_HSPA
TelephonyConstants#RADIO_TECHNOLOGY_HSPAP
TelephonyConstants#RADIO_TECHNOLOGY_TD_SCDMA
TelephonyConstants#RADIO_TECHNOLOGY_EVDO
TelephonyConstants#RADIO_TECHNOLOGY_EHRPD
TelephonyConstants#RADIO_TECHNOLOGY_LTE
TelephonyConstants#RADIO_TECHNOLOGY_LTE_CA
TelephonyConstants#RADIO_TECHNOLOGY_IWLAN
TelephonyConstants#RADIO_TECHNOLOGY_NR