Stay organized with collections
Save and categorize content based on your preferences.
CarrierConfigChangeListener
interface CarrierConfigChangeListener
Listener interface to get a notification when the carrier configurations have changed. Use this listener to receive timely updates when the carrier configuration changes. System components should prefer this listener over ACTION_CARRIER_CONFIG_CHANGED
whenever possible. To register the listener, call registerCarrierConfigChangeListener(java.util.concurrent.Executor,android.telephony.CarrierConfigManager.CarrierConfigChangeListener)
. To unregister, call unregisterCarrierConfigChangeListener(android.telephony.CarrierConfigManager.CarrierConfigChangeListener)
. Note that on registration, registrants will NOT receive a notification on last carrier config change. Only carrier configs change AFTER the registration will be sent to registrants. And unlike ACTION_CARRIER_CONFIG_CHANGED
, notification wouldn't send when the device is unlocked. Registrants only receive the notification when there has been real carrier config changes.
Summary
Public methods |
abstract Unit |
Called when carrier configurations have changed.
|
Public methods
onCarrierConfigChanged
abstract fun onCarrierConfigChanged(
logicalSlotIndex: Int,
subscriptionId: Int,
carrierId: Int,
specificCarrierId: Int
): Unit
Called when carrier configurations have changed.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# CarrierConfigManager.CarrierConfigChangeListener\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCarrierConfigChangeListener\n===========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telephony/CarrierConfigManager.CarrierConfigChangeListener \"View this page in Java\") \n\n```\ninterface CarrierConfigChangeListener\n```\n\n|-------------------------------------------------------------------------|\n| [android.telephony.CarrierConfigManager.CarrierConfigChangeListener](#) |\n\nListener interface to get a notification when the carrier configurations have changed. Use this listener to receive timely updates when the carrier configuration changes. System components should prefer this listener over [ACTION_CARRIER_CONFIG_CHANGED](/reference/kotlin/android/telephony/CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED:kotlin.String) whenever possible. To register the listener, call [registerCarrierConfigChangeListener(java.util.concurrent.Executor,android.telephony.CarrierConfigManager.CarrierConfigChangeListener)](/reference/kotlin/android/telephony/CarrierConfigManager#registerCarrierConfigChangeListener(java.util.concurrent.Executor,%20android.telephony.CarrierConfigManager.CarrierConfigChangeListener)). To unregister, call [unregisterCarrierConfigChangeListener(android.telephony.CarrierConfigManager.CarrierConfigChangeListener)](/reference/kotlin/android/telephony/CarrierConfigManager#unregisterCarrierConfigChangeListener(android.telephony.CarrierConfigManager.CarrierConfigChangeListener)). Note that on registration, registrants will NOT receive a notification on last carrier config change. Only carrier configs change AFTER the registration will be sent to registrants. And unlike [ACTION_CARRIER_CONFIG_CHANGED](/reference/kotlin/android/telephony/CarrierConfigManager#ACTION_CARRIER_CONFIG_CHANGED:kotlin.String), notification wouldn't send when the device is unlocked. Registrants only receive the notification when there has been real carrier config changes.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCarrierConfigChanged](#onCarrierConfigChanged(kotlin.Int,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int))`(`logicalSlotIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `subscriptionId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `carrierId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `specificCarrierId:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called when carrier configurations have changed. |\n\nPublic methods\n--------------\n\n### onCarrierConfigChanged\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onCarrierConfigChanged(\n logicalSlotIndex: Int, \n subscriptionId: Int, \n carrierId: Int, \n specificCarrierId: Int\n): Unit\n```\n\nCalled when carrier configurations have changed.\n\n| Parameters ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `logicalSlotIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The logical SIM slot index on which to monitor and get notification. It is guaranteed to be valid. |\n| `subscriptionId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The subscription on the SIM slot. May be [SubscriptionManager.INVALID_SUBSCRIPTION_ID](/reference/kotlin/android/telephony/SubscriptionManager#INVALID_SUBSCRIPTION_ID:kotlin.Int). |\n| `carrierId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The optional carrier Id, may be [TelephonyManager.UNKNOWN_CARRIER_ID](/reference/kotlin/android/telephony/TelephonyManager#UNKNOWN_CARRIER_ID:kotlin.Int). See [TelephonyManager.getSimCarrierId()](/reference/kotlin/android/telephony/TelephonyManager#getSimCarrierId()). |\n| `specificCarrierId` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The optional fine-grained carrierId, may be [android.telephony.TelephonyManager#UNKNOWN_CARRIER_ID](/reference/kotlin/android/telephony/TelephonyManager#UNKNOWN_CARRIER_ID:kotlin.Int). A specific carrierId may be different from the carrierId above in a MVNO scenario. See detail in [TelephonyManager.getSimSpecificCarrierId()](/reference/kotlin/android/telephony/TelephonyManager#getSimSpecificCarrierId()). |"]]