Stay organized with collections
Save and categorize content based on your preferences.
TelephonyCallback.ActiveDataSubscriptionIdListener
public
static
interface
TelephonyCallback.ActiveDataSubscriptionIdListener
android.telephony.TelephonyCallback.ActiveDataSubscriptionIdListener
|
Interface for active data subscription ID listener.
Summary
Public methods
onActiveDataSubscriptionIdChanged
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
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
Manifest.permission.READ_PHONE_STATE . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TelephonyCallback.ActiveDataSubscriptionIdListener\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nTelephonyCallback.ActiveDataSubscriptionIdListener\n==================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nTelephonyCallback.ActiveDataSubscriptionIdListener\n`\n\n\n`\n\n\n`\n\n|----------------------------------------------------------------------|\n| android.telephony.TelephonyCallback.ActiveDataSubscriptionIdListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface for active data subscription ID listener.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onActiveDataSubscriptionIdChanged](/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener#onActiveDataSubscriptionIdChanged(int))`(int subId) ` Callback invoked when active data subscription ID changes. |\n\nPublic methods\n--------------\n\n### onActiveDataSubscriptionIdChanged\n\nAdded in [API level 31](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onActiveDataSubscriptionIdChanged (int subId)\n```\n\nCallback invoked when active data subscription ID changes.\nNote, this callback triggers regardless of registered subscription.\n\n\u003cbr /\u003e\n\n\nRequires [Manifest.permission.READ_PHONE_STATE](/reference/android/Manifest.permission#READ_PHONE_STATE)\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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](/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())) if it does not have the [Manifest.permission.READ_PHONE_STATE](/reference/android/Manifest.permission#READ_PHONE_STATE). \u003cbr /\u003e |"]]