GnssMeasurementRequest.Builder

public static final class GnssMeasurementRequest.Builder
extends Object

java.lang.Object
   ↳ android.location.GnssMeasurementRequest.Builder


Builder for GnssMeasurementRequest

Summary

Public constructors

Builder()

Constructs a Builder instance.

Builder(GnssMeasurementRequest request)

Constructs a Builder instance by copying a GnssMeasurementRequest.

Public methods

GnssMeasurementRequest build()

Builds a GnssMeasurementRequest instance as specified by this builder.

GnssMeasurementRequest.Builder setFullTracking(boolean value)

Set the value of whether to enable full GNSS tracking, which is false by default.

GnssMeasurementRequest.Builder setIntervalMillis(int value)

Set the time interval between the reported measurements in milliseconds, which is 0 by default.

Inherited methods

Public constructors

Builder

Added in API level 31
public Builder ()

Constructs a Builder instance.

Builder

Added in API level 31
public Builder (GnssMeasurementRequest request)

Constructs a Builder instance by copying a GnssMeasurementRequest.

Parameters
request GnssMeasurementRequest: This value cannot be null.

Public methods

build

Added in API level 31
public GnssMeasurementRequest build ()

Builds a GnssMeasurementRequest instance as specified by this builder.

Returns
GnssMeasurementRequest This value cannot be null.

setFullTracking

Added in API level 31
public GnssMeasurementRequest.Builder setFullTracking (boolean value)

Set the value of whether to enable full GNSS tracking, which is false by default.

If true, GNSS chipset switches off duty cycling. In such a mode, no clock discontinuities are expected, and when supported, carrier phase should be continuous in good signal conditions. All non-blocklisted, healthy constellations, satellites and frequency bands that the chipset supports must be reported in this mode. The GNSS chipset will consume more power in full tracking mode than in duty cycling mode. If false, GNSS chipset optimizes power via duty cycling, constellations and frequency limits, etc.

Full GNSS tracking mode affects GnssMeasurement and other GNSS functionalities including GNSS location.

Full tracking requests always override non-full tracking requests. If any full tracking request occurs, all listeners on the device will receive full tracking GNSS measurements.

Parameters
value boolean

Returns
GnssMeasurementRequest.Builder This value cannot be null.

setIntervalMillis

Added in API level 33
public GnssMeasurementRequest.Builder setIntervalMillis (int value)

Set the time interval between the reported measurements in milliseconds, which is 0 by default. The request interval may be set to GnssMeasurementRequest.PASSIVE_INTERVAL which indicates this request will not actively generate GNSS measurement updates, but may receive GNSS measurement updates generated as a result of other GNSS measurement requests.

An interval of 0 milliseconds means the fastest rate the chipset can report.

The GNSS chipset may report measurements with a rate faster than requested.

Note that on Android T, a request interval of GnssMeasurementRequest.PASSIVE_INTERVAL will first trigger one GNSS measurement. Another GNSS measurement will be triggered after GnssMeasurementRequest.PASSIVE_INTERVAL milliseconds and so on.

Parameters
value int: Value is 0 or greater

Returns
GnssMeasurementRequest.Builder This value cannot be null.