Added in API level 1
Deprecated in API level 31

GsmCellLocation


open class GsmCellLocation : CellLocation

Represents the cell location on a GSM phone.

Summary

Public constructors

Empty constructor.

Initialize the object from a bundle.

Public methods
open Boolean
equals(other: Any?)

open Unit

Set intent notifier Bundle based on service state

open Int

open Int

open Int

On a UMTS network, returns the primary scrambling code of the serving cell.

open Int

open Unit
setLacAndCid(lac: Int, cid: Int)

Set the location area code and the cell id.

open Unit

Invalidate this object.

open String

Inherited functions
CellLocation! getEmpty()

Return a new CellLocation object representing an unknown location, or null for unknown/none phone radio types.

Unit requestLocationUpdate()

Request an updated CellLocation for callers targeting SDK 30 or older. Whenever Android is aware of location changes, a callback will automatically be sent to all registrants of PhoneStateListener.LISTEN_CELL_LOCATION. This API requests an additional location update for cases where power saving might cause location updates to be missed.

This method is a no-op for callers targeting SDK level 31 or greater.

This method is a no-op for callers that target SDK level 29 or 30 and lack android.Manifest.permission#ACCESS_FINE_LOCATION.

This method is a no-op for callers that target SDK level 28 or below and lack android.Manifest.permission#ACCESS_COARSE_LOCATION.

Public constructors

GsmCellLocation

Added in API level 1
GsmCellLocation()

Empty constructor. Initializes the LAC and CID to -1.

GsmCellLocation

Added in API level 1
GsmCellLocation(bundle: Bundle!)

Initialize the object from a bundle.

Public methods

equals

Added in API level 1
open fun equals(other: Any?): Boolean

Deprecated: Deprecated in Java.

Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

fillInNotifierBundle

Added in API level 1
open fun fillInNotifierBundle(m: Bundle!): Unit

Deprecated: Deprecated in Java.

Set intent notifier Bundle based on service state

Parameters
m Bundle!: intent notifier Bundle

getCid

Added in API level 1
open fun getCid(): Int

Deprecated: Deprecated in Java.

Return
Int gsm cell id, -1 if unknown or invalid, 0xffff max legal value

getLac

Added in API level 1
open fun getLac(): Int

Deprecated: Deprecated in Java.

Return
Int gsm location area code, -1 if unknown, 0xffff max legal value

getPsc

Added in API level 9
Deprecated in API level 31
open fun getPsc(): Int

Deprecated: Deprecated in Java.

On a UMTS network, returns the primary scrambling code of the serving cell.

Return
Int primary scrambling code for UMTS, -1 if unknown or GSM

hashCode

Added in API level 1
open fun hashCode(): Int

Deprecated: Deprecated in Java.

Return
Int a hash code value for this object.

setLacAndCid

Added in API level 1
open fun setLacAndCid(
    lac: Int,
    cid: Int
): Unit

Deprecated: Deprecated in Java.

Set the location area code and the cell id.

setStateInvalid

Added in API level 1
open fun setStateInvalid(): Unit

Deprecated: Deprecated in Java.

Invalidate this object. The location area code and the cell id are set to -1.

toString

Added in API level 1
open fun toString(): String

Deprecated: Deprecated in Java.

Return
String a string representation of the object.