CurrentLocationRequest

public final classCurrentLocationRequestextendsObject
implementsParcelable

An encapsulation of various parameters for requesting the current location through FusedLocationProviderClient.

Nested Class Summary

class CurrentLocationRequest.Builder A builder forCurrentLocationRequest.

Inherited Constant Summary

Field Summary

public static finalCreator<CurrentLocationRequest> CREATOR

Public Method Summary

boolean
equals(Objectobject)
long
getDurationMillis()
The duration in milliseconds of the location request used to derive the current location if no historical location satisfies the current location request.
int
getGranularity()
TheGranularity of locations returned for this request.
long
getMaxUpdateAgeMillis()
The maximum age of any location returned for this request.
int
getPriority()
ThePriority of the location request used to derive the current location if no historical location satisfies the current location request.
int
String
void
writeToParcel(Parcelparcel, int flags)

Inherited Method Summary

Fields

public static finalCreator<CurrentLocationRequest> CREATOR

Public Methods

public booleanequals(Objectobject)

public longgetDurationMillis()

The duration in milliseconds of the location request used to derive the current location if no historical location satisfies the current location request. If this duration expires with no location, the current location request will return a null location.

NOTE: Internally, this duration is capped with what the Fused Location Provider believes is a reasonable maximum duration until it is unlikely that any current location can be derived. This value is currently roughly 30 seconds, but clients should expect this value could change at any time in the future.

public intgetGranularity()

TheGranularity of locations returned for this request. This controls whether fine or coarse locations may be returned.

public longgetMaxUpdateAgeMillis()

The maximum age of any location returned for this request. A value of 0 indicates that only freshly derived locations will be returned, and no historical locations will ever be returned. A valueLong.MAX_VALUE represents an effectively unbounded maximum age.

NOTE: This parameter applies only to historical locations. Freshly derived locations should almost always have timestamps close to the present time - however it is possible under unlikely conditions for location derivation to take longer than expected, in which case freshly derived locations may have slightly older timestamps, but will still be delivered.

public intgetPriority()

ThePriority of the location request used to derive the current location if no historical location satisfies the current location request.

public inthashCode()

publicStringtoString()

public voidwriteToParcel(Parcelparcel, int flags)