Added in API level 31

TelephonyCallback.UserMobileDataStateListener


public static interface TelephonyCallback.UserMobileDataStateListener

android.telephony.TelephonyCallback.UserMobileDataStateListener


Interface for user mobile data state listener.

Summary

Public methods

abstract void onUserMobileDataStateChanged(boolean enabled)

Callback invoked when the user mobile data state has changed on the registered subscription.

Public methods

onUserMobileDataStateChanged

Added in API level 31
public abstract void onUserMobileDataStateChanged (boolean enabled)

Callback invoked when the user mobile data state has changed 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
enabled boolean: indicates whether the current user mobile data state is enabled or disabled.