Added in API level 34

CarrierConfigChangeListener


interface CarrierConfigChangeListener
android.telephony.CarrierConfigManager.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
onCarrierConfigChanged(logicalSlotIndex: Int, subscriptionId: Int, carrierId: Int, specificCarrierId: Int)

Called when carrier configurations have changed.

Public methods

onCarrierConfigChanged

Added in API level 34
abstract fun onCarrierConfigChanged(
    logicalSlotIndex: Int,
    subscriptionId: Int,
    carrierId: Int,
    specificCarrierId: Int
): Unit

Called when carrier configurations have changed.

Parameters
logicalSlotIndex Int: The logical SIM slot index on which to monitor and get notification. It is guaranteed to be valid.
subscriptionId Int: The subscription on the SIM slot. May be SubscriptionManager#INVALID_SUBSCRIPTION_ID.
carrierId Int: The optional carrier Id, may be TelephonyManager#UNKNOWN_CARRIER_ID. See TelephonyManager#getSimCarrierId().
specificCarrierId Int: The optional fine-grained carrierId, may be android.telephony.TelephonyManager#UNKNOWN_CARRIER_ID. A specific carrierId may be different from the carrierId above in a MVNO scenario. See detail in TelephonyManager#getSimSpecificCarrierId().