# TelephonyCallback.ActiveDataSubscriptionIdListener

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

# TelephonyCallback.ActiveDataSubscriptionIdListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener "View this page in Kotlin")\|Java

`
public
static


interface
TelephonyCallback.ActiveDataSubscriptionIdListener
`  
`


`

|----------------------------------------------------------------------|
| android.telephony.TelephonyCallback.ActiveDataSubscriptionIdListener |

<br />

*** ** * ** ***

Interface for active data subscription ID listener.

## Summary

|                                                                                                                                   ### Public methods                                                                                                                                   ||
|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onActiveDataSubscriptionIdChanged](https://developer.android.com/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener#onActiveDataSubscriptionIdChanged(int))`(int subId) ` Callback invoked when active data subscription ID changes. |

## Public methods

### onActiveDataSubscriptionIdChanged

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void onActiveDataSubscriptionIdChanged (int subId)
```

Callback invoked when active data subscription ID changes. Note, this callback triggers regardless of registered subscription.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|                                                                                                                                                                                                                                                                                                                                     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](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())) if it does not have the[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE). <br /> |