Added in API level 31

TelephonyCallback.DataActivityListener


public static interface TelephonyCallback.DataActivityListener

android.telephony.TelephonyCallback.DataActivityListener


Interface for data activity state listener.

Summary

Public methods

abstract void onDataActivity(int direction)

Callback invoked when data activity state changes on the registered subscription.

Public methods

onDataActivity

Added in API level 31
public abstract void onDataActivity (int direction)

Callback invoked when data activity 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
direction int: Value is TelephonyManager.DATA_ACTIVITY_NONE, TelephonyManager.DATA_ACTIVITY_IN, TelephonyManager.DATA_ACTIVITY_OUT, TelephonyManager.DATA_ACTIVITY_INOUT, or TelephonyManager.DATA_ACTIVITY_DORMANT