# PhoneStateListener

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Constants](https://developer.android.com/reference/android/telephony/PhoneStateListener#constants)\|[Ctors](https://developer.android.com/reference/android/telephony/PhoneStateListener#pubctors)\|[Methods](https://developer.android.com/reference/android/telephony/PhoneStateListener#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/telephony/PhoneStateListener#inhmethods)  

# PhoneStateListener

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/telephony/PhoneStateListener "View this page in Kotlin")\|Java

`
public


class
PhoneStateListener
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.PhoneStateListener |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 31.**   
Use[TelephonyCallback](https://developer.android.com/reference/android/telephony/TelephonyCallback)instead.

A listener class for monitoring changes in specific telephony states on the device, including service state, signal strength, message waiting indicator (voicemail), and others.

Override the methods for the state that you wish to receive updates for, and pass your PhoneStateListener object, along with bitwise-or of the LISTEN_ flags to[TelephonyManager.listen()](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). 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 LISTEN_ flags.

## Summary

|                                                                                                                                                                                              ### Constants                                                                                                                                                                                               ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE) *This constant was deprecated in API level 31. Use[TelephonyCallback.ActiveDataSubscriptionIdListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener)instead.* |
| `int` | [LISTEN_BARRING_INFO](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_BARRING_INFO) *This constant was deprecated in API level 31. Use[TelephonyCallback.BarringInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.BarringInfoListener)instead.*                                                                       |
| `int` | [LISTEN_CALL_DISCONNECT_CAUSES](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_CALL_DISCONNECT_CAUSES) *This constant was deprecated in API level 31. Use[TelephonyCallback.CallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallDisconnectCauseListener)instead.*                                   |
| `int` | [LISTEN_CALL_FORWARDING_INDICATOR](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_CALL_FORWARDING_INDICATOR) *This constant is deprecated. Use[TelephonyCallback.CallForwardingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallForwardingIndicatorListener)instead.*                                      |
| `int` | [LISTEN_CALL_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_CALL_STATE) *This constant is deprecated. Use[TelephonyCallback.CallStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallStateListener)instead.*                                                                                                |
| `int` | [LISTEN_CELL_INFO](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_CELL_INFO) *This constant was deprecated in API level 31. Use[TelephonyCallback.CellInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellInfoListener)instead.*                                                                                   |
| `int` | [LISTEN_CELL_LOCATION](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_CELL_LOCATION) *This constant is deprecated. Use[TelephonyCallback.CellLocationListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellLocationListener)instead.*                                                                                    |
| `int` | [LISTEN_DATA_ACTIVITY](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_DATA_ACTIVITY) *This constant is deprecated. Use[TelephonyCallback.DataActivityListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataActivityListener)instead.*                                                                                    |
| `int` | [LISTEN_DATA_CONNECTION_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_DATA_CONNECTION_STATE) *This constant is deprecated. Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.*                                                      |
| `int` | [LISTEN_DISPLAY_INFO_CHANGED](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_DISPLAY_INFO_CHANGED) *This constant was deprecated in API level 31. Use[TelephonyCallback.DisplayInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DisplayInfoListener)instead.*                                                       |
| `int` | [LISTEN_EMERGENCY_NUMBER_LIST](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_EMERGENCY_NUMBER_LIST) *This constant was deprecated in API level 31. Use[TelephonyCallback.EmergencyNumberListListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.EmergencyNumberListListener)instead.*                                     |
| `int` | [LISTEN_IMS_CALL_DISCONNECT_CAUSES](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_IMS_CALL_DISCONNECT_CAUSES) *This constant was deprecated in API level 31. Use[TelephonyCallback.ImsCallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ImsCallDisconnectCauseListener)instead.*                     |
| `int` | [LISTEN_MESSAGE_WAITING_INDICATOR](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_MESSAGE_WAITING_INDICATOR) *This constant is deprecated. Use[TelephonyCallback.MessageWaitingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.MessageWaitingIndicatorListener)instead.*                                      |
| `int` | [LISTEN_NONE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_NONE) Stop listening for updates.                                                                                                                                                                                                                                                               |
| `int` | [LISTEN_PRECISE_DATA_CONNECTION_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_PRECISE_DATA_CONNECTION_STATE) *This constant was deprecated in API level 31. Use[TelephonyCallback.PreciseDataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.PreciseDataConnectionStateListener)instead.*       |
| `int` | [LISTEN_REGISTRATION_FAILURE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_REGISTRATION_FAILURE) *This constant was deprecated in API level 31. Use[TelephonyCallback.RegistrationFailedListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.RegistrationFailedListener)instead.*                                         |
| `int` | [LISTEN_SERVICE_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_SERVICE_STATE) *This constant is deprecated. Use[TelephonyCallback.ServiceStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ServiceStateListener)instead.*                                                                                    |
| `int` | [LISTEN_SIGNAL_STRENGTH](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_SIGNAL_STRENGTH) *This constant was deprecated in API level 15. Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.*                                                         |
| `int` | [LISTEN_SIGNAL_STRENGTHS](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_SIGNAL_STRENGTHS) *This constant was deprecated in API level 31. Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.*                                                       |
| `int` | [LISTEN_USER_MOBILE_DATA_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_USER_MOBILE_DATA_STATE) *This constant was deprecated in API level 31. Use[TelephonyCallback.UserMobileDataStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.UserMobileDataStateListener)instead.*                                   |

|                                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                                   ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[PhoneStateListener](https://developer.android.com/reference/android/telephony/PhoneStateListener#PhoneStateListener())`() ` Create a PhoneStateListener for the Phone with the default subscription.                                                                                                                                                                                                                |
| ` `[PhoneStateListener](https://developer.android.com/reference/android/telephony/PhoneStateListener#PhoneStateListener(java.util.concurrent.Executor))`(`[Executor](https://developer.android.com/reference/java/util/concurrent/Executor)` executor) ` Create a PhoneStateListener for the Phone using the specified Executor Create a PhoneStateListener with a specified Executor for handling necessary callbacks. |

|                                                                                                                                                                                                                                                                                                                                                                                                ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onActiveDataSubscriptionIdChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onActiveDataSubscriptionIdChanged(int))`(int subId) ` *This method was deprecated in API level 31. Use[TelephonyCallback.ActiveDataSubscriptionIdListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` void` | ` `[onBarringInfoChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onBarringInfoChanged(android.telephony.BarringInfo))`(`[BarringInfo](https://developer.android.com/reference/android/telephony/BarringInfo)` barringInfo) ` *This method was deprecated in API level 31. Use[TelephonyCallback.BarringInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.BarringInfoListener)instead.*                                                                                                                                                                                                                                                                                                                                    |
| ` void` | ` `[onCallDisconnectCauseChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallDisconnectCauseChanged(int,%20int))`(int disconnectCause, int preciseDisconnectCause) ` *This method was deprecated in API level 31. Use[TelephonyCallback.CallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallDisconnectCauseListener)instead.*                                                                                                                                                                                                                                                                                                                                                                          |
| ` void` | ` `[onCallForwardingIndicatorChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallForwardingIndicatorChanged(boolean))`(boolean cfi) ` *This method is deprecated. Use[TelephonyCallback.CallForwardingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallForwardingIndicatorListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void` | ` `[onCallStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallStateChanged(int,%20java.lang.String))`(int state, `[String](https://developer.android.com/reference/java/lang/String)` phoneNumber) ` *This method is deprecated. Use[TelephonyCallback.CallStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallStateListener)instead.*                                                                                                                                                                                                                                                                                                                                                                          |
| ` void` | ` `[onCellInfoChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCellInfoChanged(java.util.List<android.telephony.CellInfo>))`(`[List](https://developer.android.com/reference/java/util/List)`<`[CellInfo](https://developer.android.com/reference/android/telephony/CellInfo)`> cellInfo) ` *This method was deprecated in API level 31. Use[TelephonyCallback.CellInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellInfoListener)instead.*                                                                                                                                                                                                                                                                          |
| ` void` | ` `[onCellLocationChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCellLocationChanged(android.telephony.CellLocation))`(`[CellLocation](https://developer.android.com/reference/android/telephony/CellLocation)` location) ` *This method is deprecated. Use[TelephonyCallback.CellLocationListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellLocationListener)instead.*                                                                                                                                                                                                                                                                                                                                                 |
| ` void` | ` `[onDataActivity](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDataActivity(int))`(int direction) ` *This method is deprecated. Use[TelephonyCallback.DataActivityListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataActivityListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` void` | ` `[onDataConnectionStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDataConnectionStateChanged(int,%20int))`(int state, int networkType) ` *This method was deprecated in API level 31. Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                               |
| ` void` | ` `[onDataConnectionStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDataConnectionStateChanged(int))`(int state) ` *This method is deprecated. Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` void` | ` `[onDisplayInfoChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDisplayInfoChanged(android.telephony.TelephonyDisplayInfo))`(`[TelephonyDisplayInfo](https://developer.android.com/reference/android/telephony/TelephonyDisplayInfo)` telephonyDisplayInfo) ` *This method was deprecated in API level 31. Use[TelephonyCallback.DisplayInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DisplayInfoListener)instead.*                                                                                                                                                                                                                                                                                                |
| ` void` | ` `[onEmergencyNumberListChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onEmergencyNumberListChanged(java.util.Map<java.lang.Integer,java.util.List<android.telephony.emergency.EmergencyNumber>>))`(`[Map](https://developer.android.com/reference/java/util/Map)`<`[Integer](https://developer.android.com/reference/java/lang/Integer)`, `[List](https://developer.android.com/reference/java/util/List)`<`[EmergencyNumber](https://developer.android.com/reference/android/telephony/emergency/EmergencyNumber)`>> emergencyNumberList) ` *This method was deprecated in API level 31. Use[TelephonyCallback.EmergencyNumberListListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.EmergencyNumberListListener)instead.* |
| ` void` | ` `[onImsCallDisconnectCauseChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onImsCallDisconnectCauseChanged(android.telephony.ims.ImsReasonInfo))`(`[ImsReasonInfo](https://developer.android.com/reference/android/telephony/ims/ImsReasonInfo)` imsReasonInfo) ` *This method was deprecated in API level 31. Use[TelephonyCallback.ImsCallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ImsCallDisconnectCauseListener)instead.*                                                                                                                                                                                                                                                                        |
| ` void` | ` `[onMessageWaitingIndicatorChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onMessageWaitingIndicatorChanged(boolean))`(boolean mwi) ` *This method is deprecated. Use[TelephonyCallback.MessageWaitingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.MessageWaitingIndicatorListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void` | ` `[onPreciseDataConnectionStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onPreciseDataConnectionStateChanged(android.telephony.PreciseDataConnectionState))`(`[PreciseDataConnectionState](https://developer.android.com/reference/android/telephony/PreciseDataConnectionState)` dataConnectionState) ` *This method was deprecated in API level 31. Use[TelephonyCallback.PreciseDataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.PreciseDataConnectionStateListener)instead.*                                                                                                                                                                                                                   |
| ` void` | ` `[onRegistrationFailed](https://developer.android.com/reference/android/telephony/PhoneStateListener#onRegistrationFailed(android.telephony.CellIdentity,%20java.lang.String,%20int,%20int,%20int))`(`[CellIdentity](https://developer.android.com/reference/android/telephony/CellIdentity)` cellIdentity, `[String](https://developer.android.com/reference/java/lang/String)` chosenPlmn, int domain, int causeCode, int additionalCauseCode) ` *This method was deprecated in API level 31. Use[TelephonyCallback.RegistrationFailedListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.RegistrationFailedListener)instead.*                                                                                                                                    |
| ` void` | ` `[onServiceStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onServiceStateChanged(android.telephony.ServiceState))`(`[ServiceState](https://developer.android.com/reference/android/telephony/ServiceState)` serviceState) ` *This method is deprecated. Use[TelephonyCallback.ServiceStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ServiceStateListener)instead.*                                                                                                                                                                                                                                                                                                                                             |
| ` void` | ` `[onSignalStrengthChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthChanged(int))`(int asu) ` *This method was deprecated in API level 15. Use[onSignalStrengthsChanged(android.telephony.SignalStrength)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthsChanged(android.telephony.SignalStrength))*                                                                                                                                                                                                                                                                                                                                                                                              |
| ` void` | ` `[onSignalStrengthsChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthsChanged(android.telephony.SignalStrength))`(`[SignalStrength](https://developer.android.com/reference/android/telephony/SignalStrength)` signalStrength) ` *This method was deprecated in API level 31. Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.*                                                                                                                                                                                                                                                                                                        |
| ` void` | ` `[onUserMobileDataStateChanged](https://developer.android.com/reference/android/telephony/PhoneStateListener#onUserMobileDataStateChanged(boolean))`(boolean enabled) ` *This method was deprecated in API level 31. Use[TelephonyCallback.UserMobileDataStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.UserMobileDataStateListener)instead.*                                                                                                                                                                                                                                                                                                                                                                                                             |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Constants

### LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.ActiveDataSubscriptionIdListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener)instead.

Listen for changes to active data subId. Active data subscription is the current subscription used to setup Cellular Internet data. For example, it could be the current active opportunistic subscription in use, or the subscription user selected as default data subscription in DSDS mode.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

**See also:**

- [onActiveDataSubscriptionIdChanged(int)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onActiveDataSubscriptionIdChanged(int))

Constant Value: 4194304 (0x00400000)  

### LISTEN_BARRING_INFO

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_BARRING_INFO
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.BarringInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.BarringInfoListener)instead.

Listen for Barring Information for the current registered / camped cell.

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).

Also requires the[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)permission, regardless of whether the calling app has carrier privileges.  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

**See also:**

- [onBarringInfoChanged(BarringInfo)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onBarringInfoChanged(android.telephony.BarringInfo))

Constant Value: -2147483648 (0x80000000)  

### LISTEN_CALL_DISCONNECT_CAUSES

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_CALL_DISCONNECT_CAUSES
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.CallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallDisconnectCauseListener)instead.

Listen for call disconnect causes which contains[DisconnectCause](https://developer.android.com/reference/android/telephony/DisconnectCause)and the precise disconnect cause.

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

Constant Value: 33554432 (0x02000000)  

### LISTEN_CALL_FORWARDING_INDICATOR

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_CALL_FORWARDING_INDICATOR
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.CallForwardingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallForwardingIndicatorListener)instead.

Listen for changes to the call-forwarding indicator.

Requires Permission:[READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or that the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

**See also:**

- [onCallForwardingIndicatorChanged(boolean)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallForwardingIndicatorChanged(boolean))

Constant Value: 8 (0x00000008)  

### LISTEN_CALL_STATE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_CALL_STATE
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.CallStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallStateListener)instead.

Listen for changes to the device call state.

<br />

<br />

**See also:**

- [onCallStateChanged(int, String)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCallStateChanged(int,%20java.lang.String))

Constant Value: 32 (0x00000020)  

### LISTEN_CELL_INFO

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_CELL_INFO
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.CellInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellInfoListener)instead.

Listen for changes to observed cell info. Listening to this event requires the[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)permission.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

**See also:**

- [onCellInfoChanged(List)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCellInfoChanged(java.util.List<android.telephony.CellInfo>))

Constant Value: 1024 (0x00000400)  

### LISTEN_CELL_LOCATION

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_CELL_LOCATION
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.CellLocationListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellLocationListener)instead.

Listen for changes to the device's cell location. Note that this will result in frequent callbacks to the listener.

Requires Permission:[ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

If you need regular location updates but want more control over the update interval or location precision, you can set up a listener through the[location manager](https://developer.android.com/reference/android/location/LocationManager)instead.  
Requires[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

**See also:**

- [onCellLocationChanged(CellLocation)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onCellLocationChanged(android.telephony.CellLocation))

Constant Value: 16 (0x00000010)  

### LISTEN_DATA_ACTIVITY

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_DATA_ACTIVITY
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.DataActivityListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataActivityListener)instead.

Listen for changes to the direction of data traffic on the data connection (cellular).

Example: The status bar uses this to display the appropriate data-traffic icon.

<br />

**See also:**

- [onDataActivity(int)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDataActivity(int))

Constant Value: 128 (0x00000080)  

### LISTEN_DATA_CONNECTION_STATE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_DATA_CONNECTION_STATE
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.

Listen for changes to the data connection state (cellular).

<br />

**See also:**

- [onDataConnectionStateChanged(int)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDataConnectionStateChanged(int))

Constant Value: 64 (0x00000040)  

### LISTEN_DISPLAY_INFO_CHANGED

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_DISPLAY_INFO_CHANGED
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.DisplayInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DisplayInfoListener)instead.

Listen for display info changed event. For clients compiled on Android 11 SDK, requires permission:[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or that the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())). For clients compiled on Android 12 SDK or newer,[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or carrier privileges is not required anymore.

<br />

**See also:**

- [onDisplayInfoChanged(TelephonyDisplayInfo)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onDisplayInfoChanged(android.telephony.TelephonyDisplayInfo))

Constant Value: 1048576 (0x00100000)  

### LISTEN_EMERGENCY_NUMBER_LIST

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_EMERGENCY_NUMBER_LIST
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.EmergencyNumberListListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.EmergencyNumberListListener)instead.

Listen for changes to emergency number list based on all active subscriptions.

Requires permission[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

Constant Value: 16777216 (0x01000000)  

### LISTEN_IMS_CALL_DISCONNECT_CAUSES

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_IMS_CALL_DISCONNECT_CAUSES
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.ImsCallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ImsCallDisconnectCauseListener)instead.

Listen for IMS call disconnect causes which contains[ImsReasonInfo](https://developer.android.com/reference/android/telephony/ims/ImsReasonInfo)

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

**See also:**

- [onImsCallDisconnectCauseChanged(ImsReasonInfo)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onImsCallDisconnectCauseChanged(android.telephony.ims.ImsReasonInfo))

Constant Value: 134217728 (0x08000000)  

### LISTEN_MESSAGE_WAITING_INDICATOR

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_MESSAGE_WAITING_INDICATOR
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.MessageWaitingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.MessageWaitingIndicatorListener)instead.

Listen for changes to the message-waiting indicator.

Requires Permission:[READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or that the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).

Example: The status bar uses this to determine when to display the voicemail icon.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

**See also:**

- [onMessageWaitingIndicatorChanged(boolean)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onMessageWaitingIndicatorChanged(boolean))

Constant Value: 4 (0x00000004)  

### LISTEN_NONE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_NONE
```

Stop listening for updates. The PhoneStateListener is not tied to any subscription and unregistered for any update.

<br />

Constant Value: 0 (0x00000000)  

### LISTEN_PRECISE_DATA_CONNECTION_STATE

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.PreciseDataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.PreciseDataConnectionStateListener)instead.

Listen for[PreciseDataConnectionState](https://developer.android.com/reference/android/telephony/PreciseDataConnectionState)on the data connection (cellular).

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

**See also:**

- [onPreciseDataConnectionStateChanged(PreciseDataConnectionState)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onPreciseDataConnectionStateChanged(android.telephony.PreciseDataConnectionState))

Constant Value: 4096 (0x00001000)  

### LISTEN_REGISTRATION_FAILURE

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_REGISTRATION_FAILURE
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.RegistrationFailedListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.RegistrationFailedListener)instead.

Listen for Registration Failures. Listen for indications that a registration procedure has failed in either the CS or PS domain. This indication does not necessarily indicate a change of service state, which should be tracked via[LISTEN_SERVICE_STATE](https://developer.android.com/reference/android/telephony/PhoneStateListener#LISTEN_SERVICE_STATE).

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).

Also requires the[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)permission, regardless of whether the calling app has carrier privileges.  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

**See also:**

- [onRegistrationFailed(CellIdentity, String, int, int, int)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onRegistrationFailed(android.telephony.CellIdentity,%20java.lang.String,%20int,%20int,%20int))

Constant Value: 1073741824 (0x40000000)  

### LISTEN_SERVICE_STATE

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_SERVICE_STATE
```

<br />

**This constant is deprecated.**   
Use[TelephonyCallback.ServiceStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ServiceStateListener)instead.

Listen for changes to the network service state (cellular).

<br />

**See also:**

- [onServiceStateChanged(ServiceState)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onServiceStateChanged(android.telephony.ServiceState))
- [ServiceState](https://developer.android.com/reference/android/telephony/ServiceState)

Constant Value: 1 (0x00000001)  

### LISTEN_SIGNAL_STRENGTH

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_SIGNAL_STRENGTH
```

<br />

**This constant was deprecated in API level 15.**   
Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.

Listen for changes to the network signal strength (cellular).

<br />

<br />

**See also:**

- [onSignalStrengthChanged(int)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthChanged(int))

Constant Value: 2 (0x00000002)  

### LISTEN_SIGNAL_STRENGTHS

Added in[API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_SIGNAL_STRENGTHS
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.

Listen for changes to the network signal strengths (cellular).

Example: The status bar uses this to control the signal-strength icon.

<br />

**See also:**

- [onSignalStrengthsChanged(SignalStrength)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthsChanged(android.telephony.SignalStrength))

Constant Value: 256 (0x00000100)  

### LISTEN_USER_MOBILE_DATA_STATE

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public static final int LISTEN_USER_MOBILE_DATA_STATE
```

<br />

**This constant was deprecated in API level 31.**   
Use[TelephonyCallback.UserMobileDataStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.UserMobileDataStateListener)instead.

Listen for changes to the user mobile data state

<br />

**See also:**

- [onUserMobileDataStateChanged(boolean)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onUserMobileDataStateChanged(boolean))

Constant Value: 524288 (0x00080000)

## Public constructors

### PhoneStateListener

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public PhoneStateListener ()
```

Create a PhoneStateListener for the Phone with the default subscription. This class requires Looper.myLooper() not return null.

<br />

### PhoneStateListener

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public PhoneStateListener (Executor executor)
```

Create a PhoneStateListener for the Phone using the specified Executor

Create a PhoneStateListener with a specified Executor for handling necessary callbacks. The Executor must not be null.

<br />

|                                                 Parameters                                                 ||
|------------|------------------------------------------------------------------------------------------------|
| `executor` | `Executor`: a non-null Executor that will execute callbacks for the PhoneStateListener. <br /> |

## Public methods

### onActiveDataSubscriptionIdChanged

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onActiveDataSubscriptionIdChanged (int subId)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.ActiveDataSubscriptionIdListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ActiveDataSubscriptionIdListener)instead.

Callback invoked when active data subId changes. Note, this callback triggers regardless of registered subscription. Requires the READ_PHONE_STATE permission.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|                                                                                                                  Parameters                                                                                                                   ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `subId` | `int`: current subscription used to setup Cellular Internet data. For example, it could be the current active opportunistic subscription in use, or the subscription user selected as default data subscription in DSDS mode. <br /> |

### onBarringInfoChanged

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onBarringInfoChanged (BarringInfo barringInfo)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.BarringInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.BarringInfoListener)instead.

Report updated barring information for the current camped/registered cell.

Barring info is provided for all services applicable to the current camped/registered cell, for the registered PLMN and current access class/access category.  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

|                                               Parameters                                               ||
|---------------|-----------------------------------------------------------------------------------------|
| `barringInfo` | `BarringInfo`: for all services on the current cell. This value cannot be`null`. <br /> |

**See also:**

- [BarringInfo](https://developer.android.com/reference/android/telephony/BarringInfo)  

### onCallDisconnectCauseChanged

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onCallDisconnectCauseChanged (int disconnectCause, 
                int preciseDisconnectCause)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.CallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallDisconnectCauseListener)instead.

Callback invoked when call disconnect cause changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ||
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `disconnectCause`        | `int`: the disconnect cause Value is[DisconnectCause.NOT_VALID](https://developer.android.com/reference/android/telephony/DisconnectCause#NOT_VALID),[DisconnectCause.NOT_DISCONNECTED](https://developer.android.com/reference/android/telephony/DisconnectCause#NOT_DISCONNECTED),[DisconnectCause.INCOMING_MISSED](https://developer.android.com/reference/android/telephony/DisconnectCause#INCOMING_MISSED),[DisconnectCause.NORMAL](https://developer.android.com/reference/android/telephony/DisconnectCause#NORMAL),[DisconnectCause.LOCAL](https://developer.android.com/reference/android/telephony/DisconnectCause#LOCAL),[DisconnectCause.BUSY](https://developer.android.com/reference/android/telephony/DisconnectCause#BUSY),[DisconnectCause.CONGESTION](https://developer.android.com/reference/android/telephony/DisconnectCause#CONGESTION),[DisconnectCause.MMI](https://developer.android.com/reference/android/telephony/DisconnectCause#MMI),[DisconnectCause.INVALID_NUMBER](https://developer.android.com/reference/android/telephony/DisconnectCause#INVALID_NUMBER),[DisconnectCause.NUMBER_UNREACHABLE](https://developer.android.com/reference/android/telephony/DisconnectCause#NUMBER_UNREACHABLE),[DisconnectCause.SERVER_UNREACHABLE](https://developer.android.com/reference/android/telephony/DisconnectCause#SERVER_UNREACHABLE),[DisconnectCause.INVALID_CREDENTIALS](https://developer.android.com/reference/android/telephony/DisconnectCause#INVALID_CREDENTIALS),[DisconnectCause.OUT_OF_NETWORK](https://developer.android.com/reference/android/telephony/DisconnectCause#OUT_OF_NETWORK),[DisconnectCause.SERVER_ERROR](https://developer.android.com/reference/android/telephony/DisconnectCause#SERVER_ERROR),[DisconnectCause.TIMED_OUT](https://developer.android.com/reference/android/telephony/DisconnectCause#TIMED_OUT),[DisconnectCause.LOST_SIGNAL](https://developer.android.com/reference/android/telephony/DisconnectCause#LOST_SIGNAL),[DisconnectCause.LIMIT_EXCEEDED](https://developer.android.com/reference/android/telephony/DisconnectCause#LIMIT_EXCEEDED),[DisconnectCause.INCOMING_REJECTED](https://developer.android.com/reference/android/telephony/DisconnectCause#INCOMING_REJECTED),[DisconnectCause.POWER_OFF](https://developer.android.com/reference/android/telephony/DisconnectCause#POWER_OFF),[DisconnectCause.OUT_OF_SERVICE](https://developer.android.com/reference/android/telephony/DisconnectCause#OUT_OF_SERVICE),[DisconnectCause.ICC_ERROR](https://developer.android.com/reference/android/telephony/DisconnectCause#ICC_ERROR),[DisconnectCause.CALL_BARRED](https://developer.android.com/reference/android/telephony/DisconnectCause#CALL_BARRED),[DisconnectCause.FDN_BLOCKED](https://developer.android.com/reference/android/telephony/DisconnectCause#FDN_BLOCKED),[DisconnectCause.CS_RESTRICTED](https://developer.android.com/reference/android/telephony/DisconnectCause#CS_RESTRICTED),[DisconnectCause.CS_RESTRICTED_NORMAL](https://developer.android.com/reference/android/telephony/DisconnectCause#CS_RESTRICTED_NORMAL),[DisconnectCause.CS_RESTRICTED_EMERGENCY](https://developer.android.com/reference/android/telephony/DisconnectCause#CS_RESTRICTED_EMERGENCY),[DisconnectCause.UNOBTAINABLE_NUMBER](https://developer.android.com/reference/android/telephony/DisconnectCause#UNOBTAINABLE_NUMBER),[DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_LOCKED_UNTIL_POWER_CYCLE),[DisconnectCause.CDMA_DROP](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_DROP),[DisconnectCause.CDMA_INTERCEPT](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_INTERCEPT),[DisconnectCause.CDMA_REORDER](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_REORDER),[DisconnectCause.CDMA_SO_REJECT](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_SO_REJECT),[DisconnectCause.CDMA_RETRY_ORDER](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_RETRY_ORDER),[DisconnectCause.CDMA_ACCESS_FAILURE](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_ACCESS_FAILURE),[DisconnectCause.CDMA_PREEMPTED](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_PREEMPTED),[DisconnectCause.CDMA_NOT_EMERGENCY](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_NOT_EMERGENCY),[DisconnectCause.CDMA_ACCESS_BLOCKED](https://developer.android.com/reference/android/telephony/DisconnectCause#CDMA_ACCESS_BLOCKED), or[DisconnectCause.ERROR_UNSPECIFIED](https://developer.android.com/reference/android/telephony/DisconnectCause#ERROR_UNSPECIFIED) <br /> |
| `preciseDisconnectCause` | `int`: the precise disconnect cause Value is android.telephony.PreciseDisconnectCause.NOT_VALID, android.telephony.PreciseDisconnectCause.NO_DISCONNECT_CAUSE_AVAILABLE, android.telephony.PreciseDisconnectCause.UNOBTAINABLE_NUMBER, android.telephony.PreciseDisconnectCause.NORMAL, android.telephony.PreciseDisconnectCause.BUSY, android.telephony.PreciseDisconnectCause.NUMBER_CHANGED, android.telephony.PreciseDisconnectCause.STATUS_ENQUIRY, android.telephony.PreciseDisconnectCause.NORMAL_UNSPECIFIED, android.telephony.PreciseDisconnectCause.NO_CIRCUIT_AVAIL, android.telephony.PreciseDisconnectCause.TEMPORARY_FAILURE, android.telephony.PreciseDisconnectCause.SWITCHING_CONGESTION, android.telephony.PreciseDisconnectCause.CHANNEL_NOT_AVAIL, android.telephony.PreciseDisconnectCause.QOS_NOT_AVAIL, android.telephony.PreciseDisconnectCause.BEARER_NOT_AVAIL, android.telephony.PreciseDisconnectCause.ACM_LIMIT_EXCEEDED, android.telephony.PreciseDisconnectCause.CALL_BARRED, android.telephony.PreciseDisconnectCause.FDN_BLOCKED, android.telephony.PreciseDisconnectCause.IMSI_UNKNOWN_IN_VLR, android.telephony.PreciseDisconnectCause.IMEI_NOT_ACCEPTED, android.telephony.PreciseDisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE, android.telephony.PreciseDisconnectCause.CDMA_DROP, android.telephony.PreciseDisconnectCause.CDMA_INTERCEPT, android.telephony.PreciseDisconnectCause.CDMA_REORDER, android.telephony.PreciseDisconnectCause.CDMA_SO_REJECT, android.telephony.PreciseDisconnectCause.CDMA_RETRY_ORDER, android.telephony.PreciseDisconnectCause.CDMA_ACCESS_FAILURE, android.telephony.PreciseDisconnectCause.CDMA_PREEMPTED, android.telephony.PreciseDisconnectCause.CDMA_NOT_EMERGENCY, android.telephony.PreciseDisconnectCause.CDMA_ACCESS_BLOCKED, or android.telephony.PreciseDisconnectCause.ERROR_UNSPECIFIED <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### onCallForwardingIndicatorChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onCallForwardingIndicatorChanged (boolean cfi)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.CallForwardingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallForwardingIndicatorListener)instead.

Callback invoked when the call-forwarding indicator changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|       Parameters        ||
|-------|------------------|
| `cfi` | `boolean` <br /> |

### onCallStateChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onCallStateChanged (int state, 
                String phoneNumber)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.CallStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CallStateListener)instead.

Callback invoked when device call state changes.

Reports the state of Telephony (mobile) calls on the device for the registered subscription.

Note: the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

Note: The state returned here may differ from that returned by[TelephonyManager.getCallState()](https://developer.android.com/reference/android/telephony/TelephonyManager#getCallState()). Receivers of this callback should be aware that calling[TelephonyManager.getCallState()](https://developer.android.com/reference/android/telephony/TelephonyManager#getCallState())from within this callback may return a different state than the callback reports. Requires Permission:[READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)for applications targeting API level 31+.

<br />

|                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                          ||
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `state`       | `int`: call state Value is[TelephonyManager.CALL_STATE_IDLE](https://developer.android.com/reference/android/telephony/TelephonyManager#CALL_STATE_IDLE),[TelephonyManager.CALL_STATE_RINGING](https://developer.android.com/reference/android/telephony/TelephonyManager#CALL_STATE_RINGING), or[TelephonyManager.CALL_STATE_OFFHOOK](https://developer.android.com/reference/android/telephony/TelephonyManager#CALL_STATE_OFFHOOK) <br /> |
| `phoneNumber` | `String`: call phone number. If application does not have[READ_CALL_LOG](https://developer.android.com/reference/android/Manifest.permission#READ_CALL_LOG)permission or carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())), an empty string will be passed as an argument. <br />                                           |

### onCellInfoChanged

Added in[API level 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onCellInfoChanged (List<CellInfo> cellInfo)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.CellInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellInfoListener)instead.

Callback invoked when a observed cell info has changed or new cells have been added or removed on the registered subscription. Note, the registration subId s from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

|                             Parameters                             ||
|------------|--------------------------------------------------------|
| `cellInfo` | `List`: is the list of currently visible cells. <br /> |

### onCellLocationChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onCellLocationChanged (CellLocation location)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.CellLocationListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.CellLocationListener)instead.

Callback invoked when device cell location changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

|            Parameters             ||
|------------|-----------------------|
| `location` | `CellLocation` <br /> |

### onDataActivity

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onDataActivity (int direction)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.DataActivityListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataActivityListener)instead.

Callback invoked when data activity state changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

<br />

|        Parameters         ||
|-------------|--------------|
| `direction` | `int` <br /> |

**See also:**

- [TelephonyManager.DATA_ACTIVITY_NONE](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_ACTIVITY_NONE)
- [TelephonyManager.DATA_ACTIVITY_IN](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_ACTIVITY_IN)
- [TelephonyManager.DATA_ACTIVITY_OUT](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_ACTIVITY_OUT)
- [TelephonyManager.DATA_ACTIVITY_INOUT](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_ACTIVITY_INOUT)
- [TelephonyManager.DATA_ACTIVITY_DORMANT](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_ACTIVITY_DORMANT)  

### onDataConnectionStateChanged

Added in[API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onDataConnectionStateChanged (int state, 
                int networkType)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.

same as above, but with the network type. Both called.

<br />

|         Parameters          ||
|---------------|--------------|
| `state`       | `int` <br /> |
| `networkType` | `int` <br /> |

### onDataConnectionStateChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onDataConnectionStateChanged (int state)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.DataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DataConnectionStateListener)instead.

Callback invoked when connection state changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

<br />

|      Parameters       ||
|---------|--------------|
| `state` | `int` <br /> |

**See also:**

- [TelephonyManager.DATA_DISCONNECTED](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_DISCONNECTED)
- [TelephonyManager.DATA_CONNECTING](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_CONNECTING)
- [TelephonyManager.DATA_CONNECTED](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_CONNECTED)
- [TelephonyManager.DATA_SUSPENDED](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_SUSPENDED)
- [TelephonyManager.DATA_HANDOVER_IN_PROGRESS](https://developer.android.com/reference/android/telephony/TelephonyManager#DATA_HANDOVER_IN_PROGRESS)  

### onDisplayInfoChanged

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onDisplayInfoChanged (TelephonyDisplayInfo telephonyDisplayInfo)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.DisplayInfoListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.DisplayInfoListener)instead.

Callback invoked when the display info has changed on the registered subscription.

The[TelephonyDisplayInfo](https://developer.android.com/reference/android/telephony/TelephonyDisplayInfo)contains status information shown to the user based on carrier policy. For clients compiled on Android 11 SDK, requires permission:[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or that the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())). For clients compiled on Android 12 SDK or newer,[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)or carrier privileges is not required anymore.  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|                                                 Parameters                                                  ||
|------------------------|-------------------------------------------------------------------------------------|
| `telephonyDisplayInfo` | `TelephonyDisplayInfo`: The display information. This value cannot be`null`. <br /> |

### onEmergencyNumberListChanged

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onEmergencyNumberListChanged (Map<Integer, List<EmergencyNumber>> emergencyNumberList)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.EmergencyNumberListListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.EmergencyNumberListListener)instead.

Callback invoked when the current emergency number list has changed on the registered subscription. Note, the registered subscription is associated with[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object on which[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int))was called. If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the given subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|                                                                                                                                                                                                                                                               Parameters                                                                                                                                                                                                                                                               ||
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `emergencyNumberList` | `Map`: Map associating all active subscriptions on the device with the list of emergency numbers originating from that subscription. If there are no active subscriptions, the map will contain a single entry with[SubscriptionManager.INVALID_SUBSCRIPTION_ID](https://developer.android.com/reference/android/telephony/SubscriptionManager#INVALID_SUBSCRIPTION_ID)as the key and a list of emergency numbers as the value. If no emergency number information is available, the value will be null. <br /> |

### onImsCallDisconnectCauseChanged

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onImsCallDisconnectCauseChanged (ImsReasonInfo imsReasonInfo)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.ImsCallDisconnectCauseListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ImsCallDisconnectCauseListener)instead.

Callback invoked when Ims call disconnect cause changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

|                                                                                                Parameters                                                                                                ||
|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `imsReasonInfo` | `ImsReasonInfo`:[ImsReasonInfo](https://developer.android.com/reference/android/telephony/ims/ImsReasonInfo)contains details on why IMS call failed. This value cannot be`null`. <br /> |

### onMessageWaitingIndicatorChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onMessageWaitingIndicatorChanged (boolean mwi)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.MessageWaitingIndicatorListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.MessageWaitingIndicatorListener)instead.

Callback invoked when the message-waiting indicator changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).  
Requires[Manifest.permission.READ_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PHONE_STATE)

<br />

|       Parameters        ||
|-------|------------------|
| `mwi` | `boolean` <br /> |

### onPreciseDataConnectionStateChanged

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onPreciseDataConnectionStateChanged (PreciseDataConnectionState dataConnectionState)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.PreciseDataConnectionStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.PreciseDataConnectionStateListener)instead.

Callback providing update about the default/internet data connection on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

Requires permission[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)or the calling app has carrier privileges (see[TelephonyManager.hasCarrierPrivileges](https://developer.android.com/reference/android/telephony/TelephonyManager#hasCarrierPrivileges())).  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)

<br />

|                                                                                                Parameters                                                                                                ||
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dataConnectionState` | `PreciseDataConnectionState`:[PreciseDataConnectionState](https://developer.android.com/reference/android/telephony/PreciseDataConnectionState)This value cannot be`null`. <br /> |

### onRegistrationFailed

Added in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onRegistrationFailed (CellIdentity cellIdentity, 
                String chosenPlmn, 
                int domain, 
                int causeCode, 
                int additionalCauseCode)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.RegistrationFailedListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.RegistrationFailedListener)instead.

Report that Registration or a Location/Routing/Tracking Area update has failed.

Indicate whenever a registration procedure, including a location, routing, or tracking area update fails. This includes procedures that do not necessarily result in a change of the modem's registration status. If the modem's registration status changes, that is reflected in the onNetworkStateChanged() and subsequent get{Voice/Data}RegistrationState().

Because registration failures are ephemeral, this callback is not sticky. Registrants will not receive the most recent past value when registering.  
Requires[Manifest.permission.READ_PRECISE_PHONE_STATE](https://developer.android.com/reference/android/Manifest.permission#READ_PRECISE_PHONE_STATE)and[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)

<br />

|                                                                                                                                                                         Parameters                                                                                                                                                                          ||
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cellIdentity`        | `CellIdentity`: the CellIdentity, which must include the globally unique identifier for the cell (for example, all components of the CGI or ECGI). This value cannot be`null`. <br />                                                                                                                                                |
| `chosenPlmn`          | `String`: a 5 or 6 digit alphanumeric PLMN (MCC\|MNC) among those broadcast by the cell that was chosen for the failed registration attempt. This value cannot be`null`. <br />                                                                                                                                                      |
| `domain`              | `int`: DOMAIN_CS, DOMAIN_PS or both in case of a combined procedure. <br />                                                                                                                                                                                                                                                          |
| `causeCode`           | `int`: the primary failure cause code of the procedure. For GSM/UMTS (MM), values are in TS 24.008 Sec 10.5.95 For GSM/UMTS (GMM), values are in TS 24.008 Sec 10.5.147 For LTE (EMM), cause codes are TS 24.301 Sec 9.9.3.9 For NR (5GMM), cause codes are TS 24.501 Sec 9.11.3.2 Integer.MAX_VALUE if this value is unused. <br /> |
| `additionalCauseCode` | `int`: the cause code of any secondary/combined procedure if appropriate. For UMTS, if a combined attach succeeds for PS only, then the GMM cause code shall be included as an additionalCauseCode. For LTE (ESM), cause codes are in TS 24.301 9.9.4.4. Integer.MAX_VALUE if this value is unused. <br />                           |

### onServiceStateChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onServiceStateChanged (ServiceState serviceState)
```

<br />

**This method is deprecated.**   
Use[TelephonyCallback.ServiceStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.ServiceStateListener)instead.

Callback invoked when device service state changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()). The instance of[ServiceState](https://developer.android.com/reference/android/telephony/ServiceState)passed as an argument here will have various levels of location information stripped from it depending on the location permissions that your app holds. Only apps holding the[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)permission will receive all the information in[ServiceState](https://developer.android.com/reference/android/telephony/ServiceState), otherwise the cellIdentity will be null if apps only holding the[Manifest.permission.ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION)permission. Network operator name in long/short alphanumeric format and numeric id will be null if apps holding neither[Manifest.permission.ACCESS_FINE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_FINE_LOCATION)nor[Manifest.permission.ACCESS_COARSE_LOCATION](https://developer.android.com/reference/android/Manifest.permission#ACCESS_COARSE_LOCATION).

<br />

|              Parameters               ||
|----------------|-----------------------|
| `serviceState` | `ServiceState` <br /> |

**See also:**

- [ServiceState.STATE_EMERGENCY_ONLY](https://developer.android.com/reference/android/telephony/ServiceState#STATE_EMERGENCY_ONLY)
- [ServiceState.STATE_IN_SERVICE](https://developer.android.com/reference/android/telephony/ServiceState#STATE_IN_SERVICE)
- [ServiceState.STATE_OUT_OF_SERVICE](https://developer.android.com/reference/android/telephony/ServiceState#STATE_OUT_OF_SERVICE)
- [ServiceState.STATE_POWER_OFF](https://developer.android.com/reference/android/telephony/ServiceState#STATE_POWER_OFF)  

### onSignalStrengthChanged

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onSignalStrengthChanged (int asu)
```

<br />

**This method was deprecated in API level 15.**   
Use[onSignalStrengthsChanged(android.telephony.SignalStrength)](https://developer.android.com/reference/android/telephony/PhoneStateListener#onSignalStrengthsChanged(android.telephony.SignalStrength))

Callback invoked when network signal strength changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

<br />

|     Parameters      ||
|-------|--------------|
| `asu` | `int` <br /> |

**See also:**

- [ServiceState.STATE_EMERGENCY_ONLY](https://developer.android.com/reference/android/telephony/ServiceState#STATE_EMERGENCY_ONLY)
- [ServiceState.STATE_IN_SERVICE](https://developer.android.com/reference/android/telephony/ServiceState#STATE_IN_SERVICE)
- [ServiceState.STATE_OUT_OF_SERVICE](https://developer.android.com/reference/android/telephony/ServiceState#STATE_OUT_OF_SERVICE)
- [ServiceState.STATE_POWER_OFF](https://developer.android.com/reference/android/telephony/ServiceState#STATE_POWER_OFF)  

### onSignalStrengthsChanged

Added in[API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onSignalStrengthsChanged (SignalStrength signalStrength)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.SignalStrengthsListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.SignalStrengthsListener)instead.

Callback invoked when network signal strengths changes on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

<br />

|                Parameters                 ||
|------------------|-------------------------|
| `signalStrength` | `SignalStrength` <br /> |

### onUserMobileDataStateChanged

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public void onUserMobileDataStateChanged (boolean enabled)
```

<br />

**This method was deprecated in API level 31.**   
Use[TelephonyCallback.UserMobileDataStateListener](https://developer.android.com/reference/android/telephony/TelephonyCallback.UserMobileDataStateListener)instead.

Callback invoked when the user mobile data state has changed on the registered subscription. Note, the registration subId comes from[TelephonyManager](https://developer.android.com/reference/android/telephony/TelephonyManager)object which registers PhoneStateListener by[TelephonyManager.listen(PhoneStateListener, int)](https://developer.android.com/reference/android/telephony/TelephonyManager#listen(android.telephony.PhoneStateListener,%20int)). If this TelephonyManager object was created with[TelephonyManager.createForSubscriptionId(int)](https://developer.android.com/reference/android/telephony/TelephonyManager#createForSubscriptionId(int)), then the callback applies to the subId. Otherwise, this callback applies to[SubscriptionManager.getDefaultSubscriptionId()](https://developer.android.com/reference/android/telephony/SubscriptionManager#getDefaultSubscriptionId()).

<br />

|                                                Parameters                                                 ||
|-----------|------------------------------------------------------------------------------------------------|
| `enabled` | `boolean`: indicates whether the current user mobile data state is enabled or disabled. <br /> |