Stay organized with collections
Save and categorize content based on your preferences.
TelephonyCallback
open class TelephonyCallback
A callback class for monitoring changes in specific telephony states on the device, including service state, signal strength, message waiting indicator (voicemail), and others.
To register a callback, use a TelephonyCallback
which implements interfaces regarding EVENT_*. For example, FakeServiceStateCallback extends TelephonyCallback
implements TelephonyCallback.ServiceStateListener
.
Then override the methods for the state that you wish to receive updates for, and pass the executor and your TelephonyCallback object to android.telephony.TelephonyManager#registerTelephonyCallback. Methods are called when the state changes, as well as once on initial registration.
Note that access to some telephony information is permission-protected. Your application won't receive updates for protected information unless it has the appropriate permissions declared in its manifest file. Where permissions apply, they are noted in the appropriate sub-interfaces.
Summary
Nested classes |
abstract |
Interface for active data subscription ID listener.
|
abstract |
Interface for barring information listener.
|
abstract |
Interface for call disconnect cause listener.
|
abstract |
Interface for call-forwarding indicator listener.
|
abstract |
Interface for call state listener.
|
abstract |
Interface for carrier network listener.
|
abstract |
Interface for cell info listener.
|
abstract |
Interface for device cell location listener.
|
abstract |
Interface for SIM data activation state listener.
|
abstract |
Interface for data activity state listener.
|
abstract |
Interface for data connection state listener.
|
abstract |
Interface for display info listener.
|
abstract |
Interface for the current emergency number list listener.
|
abstract |
Interface for IMS call disconnect cause listener.
|
abstract |
Interface for message waiting indicator listener.
|
abstract |
Interface for current physical channel configuration listener.
|
abstract |
Interface for precise data connection state listener.
|
abstract |
Interface for registration failures listener.
|
abstract |
Interface for service state listener.
|
abstract |
Interface for network signal strengths listener.
|
abstract |
Interface for user mobile data state listener.
|
Public constructors
TelephonyCallback
TelephonyCallback()
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\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTelephonyCallback\n=================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telephony/TelephonyCallback \"View this page in Java\") \n\n```\nopen class TelephonyCallback\n```\n\n|---|------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.telephony.TelephonyCallback](#) |\n\nA callback class for monitoring changes in specific telephony states on the device, including service state, signal strength, message waiting indicator (voicemail), and others.\n\nTo register a callback, use a [TelephonyCallback](#) which implements interfaces regarding EVENT_\\*. For example, FakeServiceStateCallback extends [TelephonyCallback](#) implements [TelephonyCallback.ServiceStateListener](/reference/kotlin/android/telephony/TelephonyCallback.ServiceStateListener).\n\nThen override the methods for the state that you wish to receive updates for, and pass the executor and your TelephonyCallback object to android.telephony.TelephonyManager#registerTelephonyCallback. Methods are called when the state changes, as well as once on initial registration.\n\nNote that access to some telephony information is permission-protected. Your application won't receive updates for protected information unless it has the appropriate permissions declared in its manifest file. Where permissions apply, they are noted in the appropriate sub-interfaces.\n\nSummary\n-------\n\n| Nested classes ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract | [ActiveDataSubscriptionIdListener](/reference/kotlin/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener) Interface for active data subscription ID listener. |\n| abstract | [BarringInfoListener](/reference/kotlin/android/telephony/TelephonyCallback.BarringInfoListener) Interface for barring information listener. |\n| abstract | [CallDisconnectCauseListener](/reference/kotlin/android/telephony/TelephonyCallback.CallDisconnectCauseListener) Interface for call disconnect cause listener. |\n| abstract | [CallForwardingIndicatorListener](/reference/kotlin/android/telephony/TelephonyCallback.CallForwardingIndicatorListener) Interface for call-forwarding indicator listener. |\n| abstract | [CallStateListener](/reference/kotlin/android/telephony/TelephonyCallback.CallStateListener) Interface for call state listener. |\n| abstract | [CarrierNetworkListener](/reference/kotlin/android/telephony/TelephonyCallback.CarrierNetworkListener) Interface for carrier network listener. |\n| abstract | [CellInfoListener](/reference/kotlin/android/telephony/TelephonyCallback.CellInfoListener) Interface for cell info listener. |\n| abstract | [CellLocationListener](/reference/kotlin/android/telephony/TelephonyCallback.CellLocationListener) Interface for device cell location listener. |\n| abstract | [DataActivationStateListener](/reference/kotlin/android/telephony/TelephonyCallback.DataActivationStateListener) Interface for SIM data activation state listener. |\n| abstract | [DataActivityListener](/reference/kotlin/android/telephony/TelephonyCallback.DataActivityListener) Interface for data activity state listener. |\n| abstract | [DataConnectionStateListener](/reference/kotlin/android/telephony/TelephonyCallback.DataConnectionStateListener) Interface for data connection state listener. |\n| abstract | [DisplayInfoListener](/reference/kotlin/android/telephony/TelephonyCallback.DisplayInfoListener) Interface for display info listener. |\n| abstract | [EmergencyNumberListListener](/reference/kotlin/android/telephony/TelephonyCallback.EmergencyNumberListListener) Interface for the current emergency number list listener. |\n| abstract | [ImsCallDisconnectCauseListener](/reference/kotlin/android/telephony/TelephonyCallback.ImsCallDisconnectCauseListener) Interface for IMS call disconnect cause listener. |\n| abstract | [MessageWaitingIndicatorListener](/reference/kotlin/android/telephony/TelephonyCallback.MessageWaitingIndicatorListener) Interface for message waiting indicator listener. |\n| abstract | [PhysicalChannelConfigListener](/reference/kotlin/android/telephony/TelephonyCallback.PhysicalChannelConfigListener) Interface for current physical channel configuration listener. |\n| abstract | [PreciseDataConnectionStateListener](/reference/kotlin/android/telephony/TelephonyCallback.PreciseDataConnectionStateListener) Interface for precise data connection state listener. |\n| abstract | [RegistrationFailedListener](/reference/kotlin/android/telephony/TelephonyCallback.RegistrationFailedListener) Interface for registration failures listener. |\n| abstract | [ServiceStateListener](/reference/kotlin/android/telephony/TelephonyCallback.ServiceStateListener) Interface for service state listener. |\n| abstract | [SignalStrengthsListener](/reference/kotlin/android/telephony/TelephonyCallback.SignalStrengthsListener) Interface for network signal strengths listener. |\n| abstract | [UserMobileDataStateListener](/reference/kotlin/android/telephony/TelephonyCallback.UserMobileDataStateListener) Interface for user mobile data state listener. |\n\n| Public constructors ||\n|------------------------------------------------------|---|\n| [TelephonyCallback](#TelephonyCallback())`()` \u003cbr /\u003e |\n\nPublic constructors\n-------------------\n\n### TelephonyCallback\n\n```\nTelephonyCallback()\n```"]]