Added in API level 31

ActiveDataSubscriptionIdListener


interface ActiveDataSubscriptionIdListener
android.telephony.TelephonyCallback.ActiveDataSubscriptionIdListener

Interface for active data subscription ID listener.

Summary

Public methods
abstract Unit

Callback invoked when active data subscription ID changes.

Public methods

onActiveDataSubscriptionIdChanged

Added in API level 31
abstract fun onActiveDataSubscriptionIdChanged(subId: Int): Unit

Callback invoked when active data subscription ID changes. Note, this callback triggers regardless of registered subscription.
Requires android.Manifest.permission#READ_PHONE_STATE

Parameters
subId Int: current subscription used to setup Cellular Internet data. The data is only active on the subscription at a time, even it is multi-SIM mode. For example, it could be the current active opportunistic subscription in use, or the subscription user selected as default data subscription in DSDS mode. The calling app should have carrier privileges (see TelephonyManager#hasCarrierPrivileges) if it does not have the android.Manifest.permission#READ_PHONE_STATE.