TelephonyCallback
open class TelephonyCallback
kotlin.Any | |
↳ | android.telephony.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 | |
---|---|
Public constructors
TelephonyCallback
TelephonyCallback()