Stay organized with collections
Save and categorize content based on your preferences.
CellInfoCallback
abstract class CellInfoCallback
Callback for providing asynchronous CellInfo
on request
Summary
Constants |
static Int |
The modem returned a failure.
|
static Int |
The system timed out waiting for a response from the Radio.
|
Constants
ERROR_MODEM_ERROR
static val ERROR_MODEM_ERROR: Int
The modem returned a failure.
Value: 2
ERROR_TIMEOUT
static val ERROR_TIMEOUT: Int
The system timed out waiting for a response from the Radio.
Value: 1
Public constructors
CellInfoCallback
CellInfoCallback()
Public methods
onError
open fun onError(
errorCode: Int,
detail: Throwable?
): Unit
Error response to requestCellInfoUpdate()
. Invoked when an error condition prevents updated 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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# TelephonyManager.CellInfoCallback\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCellInfoCallback\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telephony/TelephonyManager.CellInfoCallback \"View this page in Java\") \n\n```\nabstract class CellInfoCallback\n```\n\n|---|----------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.telephony.TelephonyManager.CellInfoCallback](#) |\n\nCallback for providing asynchronous [CellInfo](/reference/kotlin/android/telephony/CellInfo) on request\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_MODEM_ERROR](#ERROR_MODEM_ERROR:kotlin.Int) The modem returned a failure. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [ERROR_TIMEOUT](#ERROR_TIMEOUT:kotlin.Int) The system timed out waiting for a response from the Radio. |\n\n| Public constructors ||\n|----------------------------------------------------|---|\n| [CellInfoCallback](#CellInfoCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCellInfo](#onCellInfo(kotlin.collections.MutableList))`(`cellInfo:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[CellInfo](/reference/kotlin/android/telephony/CellInfo)!\u003e`)` Success response to [requestCellInfoUpdate()](/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#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()](/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). |\n\nConstants\n---------\n\n### ERROR_MODEM_ERROR\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_MODEM_ERROR: Int\n```\n\nThe modem returned a failure. \n\n Value: 2\n\n### ERROR_TIMEOUT\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_TIMEOUT: Int\n```\n\nThe system timed out waiting for a response from the Radio. \n\n Value: 1\n\nPublic constructors\n-------------------\n\n### CellInfoCallback\n\n```\nCellInfoCallback()\n```\n\nPublic methods\n--------------\n\n### onCellInfo\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onCellInfo(cellInfo: MutableList\u003cCellInfo!\u003e): Unit\n```\n\nSuccess response to [requestCellInfoUpdate()](/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). Invoked when there is a response to [requestCellInfoUpdate()](/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)) to provide a list of [CellInfo](/reference/kotlin/android/telephony/CellInfo). If no [CellInfo](/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.\n\n| Parameters ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `cellInfo` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[CellInfo](/reference/kotlin/android/telephony/CellInfo)!\\\u003e: a list of [CellInfo](/reference/kotlin/android/telephony/CellInfo) or an empty list. {@see android.telephony.TelephonyManager#getAllCellInfo getAllCellInfo()} This value cannot be `null`. |\n\n### onError\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(\n errorCode: Int, \n detail: Throwable?\n): Unit\n```\n\nError response to [requestCellInfoUpdate()](/reference/kotlin/android/telephony/TelephonyManager#requestCellInfoUpdate(java.util.concurrent.Executor,%20android.telephony.TelephonyManager.CellInfoCallback)). Invoked when an error condition prevents updated [CellInfo](/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.\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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](#ERROR_TIMEOUT:kotlin.Int), or [android.telephony.TelephonyManager.CellInfoCallback#ERROR_MODEM_ERROR](#ERROR_MODEM_ERROR:kotlin.Int) |\n| `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. |"]]