Added in API level 24

GnssClock


class GnssClock : Parcelable
kotlin.Any
   ↳ android.location.GnssClock

A class containing a GNSS clock timestamp.

It represents a measurement of the GNSS receiver's clock.

Summary

Inherited constants
Public methods
Int

Double

Gets the clock's sub-nanosecond bias.

Double

Gets the clock's Bias Uncertainty (1-Sigma) in nanoseconds.

Double

Gets the clock's Drift in nanoseconds per second.

Double

Gets the clock's Drift Uncertainty (1-Sigma) in nanoseconds per second.

Long

Returns the elapsed real-time of this clock since system boot, in nanoseconds.

Double

Gets the estimate of the relative precision of the alignment of the getElapsedRealtimeNanos() timestamp, with the reported measurements in nanoseconds (68% confidence).

Long

Gets the difference between hardware clock (getTimeNanos()) inside GPS receiver and the true GPS time since 0000Z, January 6, 1980, in nanoseconds.

Int

Gets count of hardware clock discontinuities.

Int

Gets the leap second associated with the clock's time.

Double

Returns the reference carrier frequency in Hz for inter-signal bias.

String

Returns the reference code type for inter-signal bias.

Int

Returns the reference constellation type for inter-signal bias.

Long

Gets the GNSS receiver internal hardware clock value in nanoseconds.

Double

Gets the clock's time Uncertainty (1-Sigma) in nanoseconds.

Boolean

Returns true if getBiasNanos() is available, false otherwise.

Boolean

Returns true if getBiasUncertaintyNanos() is available, false otherwise.

Boolean

Returns true if getDriftNanosPerSecond() is available, false otherwise.

Boolean

Returns true if getDriftUncertaintyNanosPerSecond() is available, false otherwise.

Boolean

Returns true if getElapsedRealtimeNanos() is available, false otherwise.

Boolean

Returns true if getElapsedRealtimeUncertaintyNanos() is available, false otherwise.

Boolean

Returns true if getFullBiasNanos() is available, false otherwise.

Boolean

Returns true if getLeapSecond() is available, false otherwise.

Boolean

Returns true if getReferenceCarrierFrequencyHzForIsb() is available, false otherwise.

Boolean

Returns true if getReferenceCodeTypeForIsb() is available, false otherwise.

Boolean

Returns true if getReferenceConstellationTypeForIsb() is available, false otherwise.

Boolean

Returns true if getTimeUncertaintyNanos() is available, false otherwise.

String

Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<GnssClock!>

Public methods

describeContents

Added in API level 24
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

getBiasNanos

Added in API level 24
fun getBiasNanos(): Double

Gets the clock's sub-nanosecond bias.

See the description of how this field is part of converting from hardware clock time, to GPS time, in getFullBiasNanos().

The error estimate for the sum of this field and getFullBiasNanos is getBiasUncertaintyNanos().

The value is only available if hasBiasNanos() is true.

getBiasUncertaintyNanos

Added in API level 24
fun getBiasUncertaintyNanos(): Double

Gets the clock's Bias Uncertainty (1-Sigma) in nanoseconds.

See the description of how this field provides the error estimate in the conversion from hardware clock time, to GPS time, in getFullBiasNanos().

The value is only available if hasBiasUncertaintyNanos() is true.

Return
Double Value is 0.0f or greater

getDriftNanosPerSecond

Added in API level 24
fun getDriftNanosPerSecond(): Double

Gets the clock's Drift in nanoseconds per second.

This value is the instantaneous time-derivative of the value provided by getBiasNanos().

A positive value indicates that the frequency is higher than the nominal (e.g. GPS master clock) frequency. The error estimate for this reported drift is getDriftUncertaintyNanosPerSecond().

The value is only available if hasDriftNanosPerSecond() is true.

getDriftUncertaintyNanosPerSecond

Added in API level 24
fun getDriftUncertaintyNanosPerSecond(): Double

Gets the clock's Drift Uncertainty (1-Sigma) in nanoseconds per second.

The value is only available if hasDriftUncertaintyNanosPerSecond() is true.

Return
Double Value is 0.0f or greater

getElapsedRealtimeNanos

Added in API level 29
fun getElapsedRealtimeNanos(): Long

Returns the elapsed real-time of this clock since system boot, in nanoseconds.

The value is only available if hasElapsedRealtimeNanos() is true.

getElapsedRealtimeUncertaintyNanos

Added in API level 29
fun getElapsedRealtimeUncertaintyNanos(): Double

Gets the estimate of the relative precision of the alignment of the getElapsedRealtimeNanos() timestamp, with the reported measurements in nanoseconds (68% confidence).

The value is only available if hasElapsedRealtimeUncertaintyNanos() is true.

Return
Double Value is 0.0f or greater

getFullBiasNanos

Added in API level 24
fun getFullBiasNanos(): Long

Gets the difference between hardware clock (getTimeNanos()) inside GPS receiver and the true GPS time since 0000Z, January 6, 1980, in nanoseconds.

This value is available if the receiver has estimated GPS time. If the computed time is for a non-GPS constellation, the time offset of that constellation to GPS has to be applied to fill this value. The value is only available if hasFullBiasNanos() is true.

The error estimate for the sum of this field and getBiasNanos is getBiasUncertaintyNanos().

The sign of the value is defined by the following equation:

local estimate of GPS time = TimeNanos - (FullBiasNanos + BiasNanos)

getHardwareClockDiscontinuityCount

Added in API level 24
fun getHardwareClockDiscontinuityCount(): Int

Gets count of hardware clock discontinuities.

When this value stays the same, vs. a value in a previously reported GnssClock, it can be safely assumed that the TimeNanos value has been derived from a clock that has been running continuously - e.g. a single continuously powered crystal oscillator, and thus the (FullBiasNanos + BiasNanos) offset can be modelled with traditional clock bias & drift models.

Each time this value changes, vs. the value in a previously reported GnssClock, that suggests the hardware clock may have experienced a discontinuity (e.g. a power cycle or other anomaly), so that any assumptions about modelling a smoothly changing (FullBiasNanos + BiasNanos) offset, and a smoothly growing (TimeNanos) between this and the previously reported GnssClock, should be reset.

getLeapSecond

Added in API level 24
fun getLeapSecond(): Int

Gets the leap second associated with the clock's time.

The sign of the value is defined by the following equation:

UtcTimeNanos = TimeNanos - (FullBiasNanos + BiasNanos) - LeapSecond * 1,000,000,000

The value is only available if hasLeapSecond() is true.

getReferenceCarrierFrequencyHzForIsb

Added in API level 30
fun getReferenceCarrierFrequencyHzForIsb(): Double

Returns the reference carrier frequency in Hz for inter-signal bias.

The value is only available if hasReferenceCarrierFrequencyHzForIsb() is true.

Return
Double Value is 0.0 or greater

getReferenceCodeTypeForIsb

Added in API level 30
fun getReferenceCodeTypeForIsb(): String

Returns the reference code type for inter-signal bias.

The value is only available if hasReferenceCodeTypeForIsb() is true.

The return value is one of those constants defined in GnssMeasurement#getCodeType().

Return
String This value cannot be null.

getReferenceConstellationTypeForIsb

Added in API level 30
fun getReferenceConstellationTypeForIsb(): Int

Returns the reference constellation type for inter-signal bias.

The value is only available if hasReferenceConstellationTypeForIsb() is true.

The return value is one of those constants with CONSTELLATION_ prefix in GnssStatus.

Return
Int Value is android.location.GnssStatus#CONSTELLATION_UNKNOWN, android.location.GnssStatus#CONSTELLATION_GPS, android.location.GnssStatus#CONSTELLATION_SBAS, android.location.GnssStatus#CONSTELLATION_GLONASS, android.location.GnssStatus#CONSTELLATION_QZSS, android.location.GnssStatus#CONSTELLATION_BEIDOU, android.location.GnssStatus#CONSTELLATION_GALILEO, or android.location.GnssStatus#CONSTELLATION_IRNSS

getTimeNanos

Added in API level 24
fun getTimeNanos(): Long

Gets the GNSS receiver internal hardware clock value in nanoseconds.

This value is expected to be monotonically increasing while the hardware clock remains powered on. For the case of a hardware clock that is not continuously on, see the getHardwareClockDiscontinuityCount field. The GPS time can be derived by subtracting the sum of getFullBiasNanos() and getBiasNanos() (when they are available) from this value. Sub-nanosecond accuracy can be provided by means of getBiasNanos().

The error estimate for this value (if applicable) is getTimeUncertaintyNanos().

getTimeUncertaintyNanos

Added in API level 24
fun getTimeUncertaintyNanos(): Double

Gets the clock's time Uncertainty (1-Sigma) in nanoseconds.

The uncertainty is represented as an absolute (single sided) value.

The value is only available if hasTimeUncertaintyNanos() is true.

This value is often effectively zero (it is the reference clock by which all other times and time uncertainties are measured), and thus this field may often be 0, or not provided.

Return
Double Value is 0.0f or greater

hasBiasNanos

Added in API level 24
fun hasBiasNanos(): Boolean

Returns true if getBiasNanos() is available, false otherwise.

hasBiasUncertaintyNanos

Added in API level 24
fun hasBiasUncertaintyNanos(): Boolean

Returns true if getBiasUncertaintyNanos() is available, false otherwise.

hasDriftNanosPerSecond

Added in API level 24
fun hasDriftNanosPerSecond(): Boolean

Returns true if getDriftNanosPerSecond() is available, false otherwise.

hasDriftUncertaintyNanosPerSecond

Added in API level 24
fun hasDriftUncertaintyNanosPerSecond(): Boolean

Returns true if getDriftUncertaintyNanosPerSecond() is available, false otherwise.

hasElapsedRealtimeNanos

Added in API level 29
fun hasElapsedRealtimeNanos(): Boolean

Returns true if getElapsedRealtimeNanos() is available, false otherwise.

hasElapsedRealtimeUncertaintyNanos

Added in API level 29
fun hasElapsedRealtimeUncertaintyNanos(): Boolean

Returns true if getElapsedRealtimeUncertaintyNanos() is available, false otherwise.

hasFullBiasNanos

Added in API level 24
fun hasFullBiasNanos(): Boolean

Returns true if getFullBiasNanos() is available, false otherwise.

hasLeapSecond

Added in API level 24
fun hasLeapSecond(): Boolean

Returns true if getLeapSecond() is available, false otherwise.

hasReferenceCarrierFrequencyHzForIsb

Added in API level 30
fun hasReferenceCarrierFrequencyHzForIsb(): Boolean

Returns true if getReferenceCarrierFrequencyHzForIsb() is available, false otherwise.

hasReferenceCodeTypeForIsb

Added in API level 30
fun hasReferenceCodeTypeForIsb(): Boolean

Returns true if getReferenceCodeTypeForIsb() is available, false otherwise.

hasReferenceConstellationTypeForIsb

Added in API level 30
fun hasReferenceConstellationTypeForIsb(): Boolean

Returns true if getReferenceConstellationTypeForIsb() is available, false otherwise.

hasTimeUncertaintyNanos

Added in API level 24
fun hasTimeUncertaintyNanos(): Boolean

Returns true if getTimeUncertaintyNanos() is available, false otherwise.

toString

Added in API level 24
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 24
fun writeToParcel(
    parcel: Parcel,
    flags: Int
): Unit
Parameters
dest The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 24
static val CREATOR: Parcelable.Creator<GnssClock!>