TelephonyManager.CellInfoCallback


public static abstract class TelephonyManager.CellInfoCallback
extends Object

java.lang.Object
   ↳ android.telephony.TelephonyManager.CellInfoCallback


Callback for providing asynchronous CellInfo on request

Summary

Constants

int ERROR_MODEM_ERROR

The modem returned a failure.

int ERROR_TIMEOUT

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

Public constructors

CellInfoCallback()

Public methods

abstract void onCellInfo(List<CellInfo> cellInfo)

Success response to requestCellInfoUpdate().

void onError(int errorCode, Throwable detail)

Error response to requestCellInfoUpdate().

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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(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()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Constants

ERROR_MODEM_ERROR

Added in API level 29
public static final int ERROR_MODEM_ERROR

The modem returned a failure.

Constant Value: 2 (0x00000002)

ERROR_TIMEOUT

Added in API level 29
public static final int ERROR_TIMEOUT

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

Constant Value: 1 (0x00000001)

Public constructors

CellInfoCallback

public CellInfoCallback ()

Public methods

onCellInfo

Added in API level 29
public abstract void onCellInfo (List<CellInfo> cellInfo)

Success response to requestCellInfoUpdate(). Invoked when there is a response to requestCellInfoUpdate() to provide a list of CellInfo. If no 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 List: a list of CellInfo or an empty list. This value cannot be null.

onError

Added in API level 29
public void onError (int errorCode, 
                Throwable detail)

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.

Parameters
errorCode int: an error code indicating the type of failure. Value is ERROR_TIMEOUT, or ERROR_MODEM_ERROR

detail Throwable: a Throwable object with additional detail regarding the failure if available, otherwise null.