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

# ImsStateCallback

*** ** * ** ***


`
public


abstract
class
ImsStateCallback
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

A callback class used for monitoring changes in IMS service connection states
for a specific subscription.

<br />

**See also:**

- `https://developer.android.com/reference/android/telephony/ims/ImsMmTelManager#registerImsStateCallback(java.util.concurrent.Executor,%20android.telephony.ims.ImsStateCallback)`
- `https://developer.android.com/reference/android/telephony/ims/ImsRcsManager#registerImsStateCallback(java.util.concurrent.Executor,%20android.telephony.ims.ImsStateCallback)`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_IMS_SERVICE_DISCONNECTED` The underlying IMS service has died, is reconfiguring, or has never come up yet and as a result is currently unavailable. |
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_IMS_SERVICE_NOT_READY` The IMS service is connected, but in a NOT_READY state. |
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_NO_IMS_SERVICE_CONFIGURED` There is no IMS service configured for the subscription ID specified. |
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_SUBSCRIPTION_INACTIVE` The subscription associated with this Manager has moved to an inactive state (e.g. SIM removed) and the IMS service has torn down the resources related to this subscription. |
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_UNKNOWN_PERMANENT_ERROR` The underlying IMS service is permanently unavailable for the associated subscription and there will be no Manager available for this subscription. |
| `int` | `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_UNKNOWN_TEMPORARY_ERROR` The underlying IMS service is temporarily unavailable for the associated subscription. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#ImsStateCallback()() ` |

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onAvailable()() ` The IMS service is connected and is ready for communication over the provided Manager. |
| ` abstract void` | ` https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onError()() ` An unexpected error has occurred and the Telephony process has crashed. |
| ` abstract void` | ` https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onUnavailable(int)(int reason) ` The IMS service has disconnected or is reporting NOT_READY and is no longer available to users. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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

### REASON_IMS_SERVICE_DISCONNECTED

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

```
public static final int REASON_IMS_SERVICE_DISCONNECTED
```

The underlying IMS service has died, is reconfiguring, or has never
come up yet and as a result is currently unavailable.
`https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onAvailable()` will be called when the IMS service becomes
available. All callbacks should be unregistered now and registered again
if the IMS service moves back to available.

<br />

Constant Value:

3
(0x00000003)


### REASON_IMS_SERVICE_NOT_READY

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

```
public static final int REASON_IMS_SERVICE_NOT_READY
```

The IMS service is connected, but in a NOT_READY state. Once the
service moves to ready, `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onAvailable()` will be called.

<br />

Constant Value:

6
(0x00000006)


### REASON_NO_IMS_SERVICE_CONFIGURED

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

```
public static final int REASON_NO_IMS_SERVICE_CONFIGURED
```

There is no IMS service configured for the subscription ID specified.
This is a permanent error and there will be no Manager available for
this subscription.

<br />

Constant Value:

4
(0x00000004)


### REASON_SUBSCRIPTION_INACTIVE

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

```
public static final int REASON_SUBSCRIPTION_INACTIVE
```

The subscription associated with this Manager has moved to an inactive
state (e.g. SIM removed) and the IMS service has torn down the resources
related to this subscription. This has caused this callback
to be deregistered. The callback must be re-registered when this subscription
becomes active in order to continue listening to the IMS service state.

<br />

Constant Value:

5
(0x00000005)


### REASON_UNKNOWN_PERMANENT_ERROR

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

```
public static final int REASON_UNKNOWN_PERMANENT_ERROR
```

The underlying IMS service is permanently unavailable for the
associated subscription and there will be no Manager available for
this subscription.

<br />

Constant Value:

2
(0x00000002)


### REASON_UNKNOWN_TEMPORARY_ERROR

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

```
public static final int REASON_UNKNOWN_TEMPORARY_ERROR
```

The underlying IMS service is temporarily unavailable for the
associated subscription.
`https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onAvailable()` will be called when the IMS service becomes
available again.

<br />

Constant Value:

1
(0x00000001)


## Public constructors

### ImsStateCallback

```
public ImsStateCallback ()
```

<br />

<br />

## Public methods

### onAvailable

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

```
public abstract void onAvailable ()
```

The IMS service is connected and is ready for communication over the
provided Manager.

<br />

### onError

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

```
public abstract void onError ()
```

An unexpected error has occurred and the Telephony process has crashed. This
has caused this callback to be deregistered. The callback must be
re-registered in order to continue listening to the IMS service state.

<br />

### onUnavailable

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

```
public abstract void onUnavailable (int reason)
```

The IMS service has disconnected or is reporting NOT_READY and is no longer
available to users. The user should clean up all related state and
unregister callbacks. If it is a temporary error, `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#onAvailable()` will
be called when the IMS service becomes available again.

<br />

| Parameters ||
|---|---|
| `reason` | `int`: the specified reason. Value is one of the following: - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_UNKNOWN_TEMPORARY_ERROR` - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_UNKNOWN_PERMANENT_ERROR` - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_IMS_SERVICE_DISCONNECTED` - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_NO_IMS_SERVICE_CONFIGURED` - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_SUBSCRIPTION_INACTIVE` - `https://developer.android.com/reference/android/telephony/ims/ImsStateCallback#REASON_IMS_SERVICE_NOT_READY` |