Added in API level 31

DataConnectionStateListener


interface DataConnectionStateListener
android.telephony.TelephonyCallback.DataConnectionStateListener

Interface for data connection state listener.

Summary

Public methods
abstract Unit
onDataConnectionStateChanged(state: Int, networkType: Int)

Callback invoked when connection state changes on the registered subscription.

Public methods

onDataConnectionStateChanged

Added in API level 31
abstract fun onDataConnectionStateChanged(
    state: Int,
    networkType: Int
): Unit

Callback invoked when connection state changes on the registered subscription. Note, the registration subscription ID comes from TelephonyManager object which registers TelephonyCallback by TelephonyManager.registerTelephonyCallback(Executor, TelephonyCallback). If this TelephonyManager object was created with TelephonyManager.createForSubscriptionId(int), then the callback applies to the subscription ID. Otherwise, this callback applies to SubscriptionManager.getDefaultSubscriptionId().

Parameters
state Int: is the current state of data connection.
Value is one of the following:
networkType Int: is the current network type of data connection.
Value is one of the following: