# TelephonyManager.CellInfoCallback

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

# CellInfoCallback

*** ** * ** ***

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

```
abstract class CellInfoCallback
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                             ||
| ↳ | [android.telephony.TelephonyManager.CellInfoCallback](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#) |

Callback for providing asynchronous[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)on request

## Summary

|                                                                                                                                         Constants                                                                                                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_MODEM_ERROR](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#ERROR_MODEM_ERROR:kotlin.Int) The modem returned a failure.                       |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_TIMEOUT](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#ERROR_TIMEOUT:kotlin.Int) The system timed out waiting for a response from the Radio. |

|                                                                   Public constructors                                                                   ||
|------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [CellInfoCallback](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#CellInfoCallback())`()` <br /> |

|                                                                                                                                                                                                                                                                                                                                                 Public methods                                                                                                                                                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCellInfo](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#onCellInfo(kotlin.collections.MutableList))`(`cellInfo:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)!>`)` Success response to[requestCellInfoUpdate()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)     | [onError](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#onError(kotlin.Int,%20kotlin.Throwable))`(`errorCode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `detail:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?`)` Error response to[requestCellInfoUpdate()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)).                        |

## Constants

### ERROR_MODEM_ERROR

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

```
static val ERROR_MODEM_ERROR: Int
```

The modem returned a failure.  

    Value: 2

### ERROR_TIMEOUT

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

```
static val ERROR_TIMEOUT: Int
```

The system timed out waiting for a response from the Radio.  

    Value: 1

## Public constructors

### CellInfoCallback

```
CellInfoCallback()
```

## Public methods

### onCellInfo

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

```
abstract fun onCellInfo(cellInfo: MutableList<CellInfo!>): Unit
```

Success response to[requestCellInfoUpdate()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). Invoked when there is a response to[requestCellInfoUpdate()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback))to provide a list of[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo). If no[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)is available then an empty list will be provided. If an error occurs, null will be provided unless the onError callback is overridden.

|                                                                                                                                                                                                             Parameters                                                                                                                                                                                                              ||
|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `cellInfo` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)!\>:a list of[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)or an empty list. {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} This value cannot be`null`. |

### onError

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

```
open fun onError(
    errorCode: Int, 
    detail: Throwable?
): Unit
```

Error response to[requestCellInfoUpdate()](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). Invoked when an error condition prevents updated[CellInfo](https://developer.android.com/reference/kotlin/android/telephony/CellInfo)from being fetched and returned from the modem. Callers of requestCellInfoUpdate() should override this function to receive detailed status information in the event of an error. By default, this function will invoke onCellInfo() with null.

|                                                                                                                                                                                                                                                                         Parameters                                                                                                                                                                                                                                                                         ||
|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `errorCode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):an error code indicating the type of failure. Value is[android.telephony.TelephonyManager.CellInfoCallback#ERROR_TIMEOUT](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#ERROR_TIMEOUT:kotlin.Int), or[android.telephony.TelephonyManager.CellInfoCallback#ERROR_MODEM_ERROR](https://developer.android.com/reference/kotlin/android/telephony/TelephonyManager.CellInfoCallback#ERROR_MODEM_ERROR:kotlin.Int) |
| `detail`    | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?:a Throwable object with additional detail regarding the failure if available, otherwise null.                                                                                                                                                                                                                                                                                                                                                         |