An encapsulation of various parameters for requesting the current location through
FusedLocationProviderClient
.
Nested Class Summary
class | CurrentLocationRequest.Builder | A builder for CurrentLocationRequest . |
Inherited Constant Summary
Field Summary
public static final Creator<CurrentLocationRequest> | CREATOR |
Public Method Summary
boolean | |
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()
The
Granularity
of locations returned for this request.
|
long |
getMaxUpdateAgeMillis()
The maximum age of any location returned for this request.
|
int |
getPriority()
The
Priority
of the location request used to derive the current location if no historical
location satisfies the current location request.
|
int |
hashCode()
|
String |
toString()
|
void |
writeToParcel(Parcel parcel, int
flags)
|
Inherited Method Summary
Fields
public static final Creator<CurrentLocationRequest> CREATOR
Public Methods
public boolean equals (Object object)
public 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. 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 int getGranularity ()
The Granularity
of locations returned for this request. This controls whether fine or coarse locations
may be returned.
public long getMaxUpdateAgeMillis ()
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 value Long.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 int getPriority ()
The Priority
of the location request used to derive the current location if no historical location
satisfies the current location request.