Package com.amazon.A3L.location
Class A3LLocationRequest
- java.lang.Object
-
- com.amazon.A3L.location.A3LLocationRequest
-
- All Implemented Interfaces:
android.os.Parcelable
public class A3LLocationRequest extends java.lang.Object implements android.os.Parcelable
This class provides replication of LocationRequest .
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
A3LLocationRequest.Builder
Builder forA3LLocationRequest
.
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<A3LLocationRequest>
CREATOR
Creator used for fetching data from the parcel received by an activitystatic int
PRIORITY_BALANCED_POWER_ACCURACY
Deprecated.UseA3LPriority.PRIORITY_BALANCED_POWER_ACCURACY
instead.static int
PRIORITY_HIGH_ACCURACY
Deprecated.UseA3LPriority.PRIORITY_HIGH_ACCURACY
instead.static int
PRIORITY_LOW_POWER
Deprecated.UseA3LPriority.PRIORITY_LOW_POWER
instead.static int
PRIORITY_NO_POWER
Deprecated.UseA3LPriority.PRIORITY_PASSIVE
instead.
-
Constructor Summary
Constructors Constructor Description A3LLocationRequest()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static A3LLocationRequest
create()
Deprecated.UseA3LLocationRequest.Builder
instead.int
describeContents()
Needed for Parcellingboolean
equals(java.lang.Object o)
long
getDurationMillis()
long
getExpirationTime()
Deprecated.UsegetDurationMillis()
instead.long
getFastestInterval()
Deprecated.UsegetMinUpdateIntervalMillis()
instead.int
getGranularity()
long
getInterval()
Deprecated.UsegetIntervalMillis()
instead.long
getIntervalMillis()
long
getMaxUpdateAgeMillis()
long
getMaxUpdateDelayMillis()
The longest a location update may be delayed.int
getMaxUpdates()
long
getMaxWaitTime()
Deprecated.UsegetMaxUpdateDelayMillis()
instead.float
getMinUpdateDistanceMeters()
long
getMinUpdateIntervalMillis()
int
getNumUpdates()
Deprecated.UsegetMaxUpdates()
instead.int
getPriority()
float
getSmallestDisplacement()
Deprecated.UsegetMinUpdateDistanceMeters()
instead.int
hashCode()
boolean
isBatched()
boolean
isFastestIntervalExplicitlySet()
Deprecated.Do not use.boolean
isPassive()
boolean
isWaitForAccurateLocation()
If this request isA3LPriority.PRIORITY_HIGH_ACCURACY
, this will delay delivery of initial low accuracy locations for a small amount of time in case a high accuracy location can be delivered instead.A3LLocationRequest
setExpirationDuration(long durationMillis)
Deprecated.UseA3LLocationRequest.Builder.setDurationMillis(long)
instead.A3LLocationRequest
setExpirationTime(long elapsedRealtime)
Deprecated.UseA3LLocationRequest.Builder.setDurationMillis(long)
instead.A3LLocationRequest
setFastestInterval(long fastestIntervalMillis)
Deprecated.A3LLocationRequest
setInterval(long intervalMillis)
Deprecated.UseA3LLocationRequest.Builder.setIntervalMillis(long)
instead.A3LLocationRequest
setMaxWaitTime(long maxWaitTimeMillis)
Deprecated.A3LLocationRequest
setNumUpdates(int maxUpdates)
Deprecated.UseA3LLocationRequest.Builder.setMaxUpdates(int)
instead.A3LLocationRequest
setPriority(int priority)
Deprecated.UseA3LLocationRequest.Builder.setPriority(int)
instead.A3LLocationRequest
setSmallestDisplacement(float smallestDisplacementMeters)
Deprecated.A3LLocationRequest
setWaitForAccurateLocation(boolean waitForAccurateLocation)
Deprecated.java.lang.String
toString()
void
writeToParcel(android.os.Parcel dest, int flags)
Flatten this object in to a Parcel.
-
-
-
Field Detail
-
PRIORITY_BALANCED_POWER_ACCURACY
@Deprecated public static final int PRIORITY_BALANCED_POWER_ACCURACY
Deprecated.UseA3LPriority.PRIORITY_BALANCED_POWER_ACCURACY
instead.- See Also:
- Constant Field Values
-
PRIORITY_HIGH_ACCURACY
@Deprecated public static final int PRIORITY_HIGH_ACCURACY
Deprecated.UseA3LPriority.PRIORITY_HIGH_ACCURACY
instead.- See Also:
- Constant Field Values
-
PRIORITY_LOW_POWER
@Deprecated public static final int PRIORITY_LOW_POWER
Deprecated.UseA3LPriority.PRIORITY_LOW_POWER
instead.- See Also:
- Constant Field Values
-
PRIORITY_NO_POWER
@Deprecated public static final int PRIORITY_NO_POWER
Deprecated.UseA3LPriority.PRIORITY_PASSIVE
instead.- See Also:
- Constant Field Values
-
CREATOR
@NonNull public static final android.os.Parcelable.Creator<A3LLocationRequest> CREATOR
Creator used for fetching data from the parcel received by an activity
-
-
Method Detail
-
create
@Deprecated public static A3LLocationRequest create()
Deprecated.UseA3LLocationRequest.Builder
instead. May be removed in a future release.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
getDurationMillis
public long getDurationMillis()
- Returns:
- The duration of this request. A location request will not receive any locations after it has expired, and will be removed
shortly thereafter. A value of
Long.MAX_VALUE
implies an infinite duration.
-
getExpirationTime
@Deprecated public long getExpirationTime()
Deprecated.UsegetDurationMillis()
instead. Using this method will return the duration added to the current elapsed realtime, which may give unexpected results. May be removed in a future release.- Returns:
- long: Returns the duration added to the current elapsed realtime.
-
getFastestInterval
@Deprecated public long getFastestInterval()
Deprecated.UsegetMinUpdateIntervalMillis()
instead. May be removed in a future release.- Returns:
- The fastest allowed interval of location updates.
-
getGranularity
public int getGranularity()
- Returns:
A3LGranularity
of locations returned for this request. This controls whether fine or coarse locations may be returned.
-
getInterval
@Deprecated public long getInterval()
Deprecated.UsegetIntervalMillis()
instead. May be removed in a future release.- Returns:
- intervalMillis for the request.
-
getIntervalMillis
public long getIntervalMillis()
- Returns:
- The desired interval of location updates. Location updates may arrive faster than this interval (but no faster than
specified by
getMinUpdateIntervalMillis()
) or slower than this interval (if the request is being throttled for example).
-
getMaxUpdateAgeMillis
public long getMaxUpdateAgeMillis()
- Returns:
- The maximum age of an initial historical location delivered for this request. A value of 0 indicates that no initial historical
location will be delivered, only freshly derived locations. A value
Long.MAX_VALUE
represents an effectively unbounded maximum age.
-
getMaxUpdateDelayMillis
public long getMaxUpdateDelayMillis()
The longest a location update may be delayed. This parameter controls location batching behavior. If this is set to a value at least 2x larger than the interval specified bygetIntervalMillis()
, then a device may (but is not required to) save power by delivering locations in batches. If clients do not require immediate delivery, consider setting this value as high as is reasonable to allow for additional power savings.For example, if a request is made with a 2s interval and a 10s maximum update delay, this implies that the device may choose to deliver batches of 5 locations every 10s (where each location should represent a point in time ~2s after the previous).
Support for batching may vary by device type, so simply allowing batching via this parameter does not imply a client will receive batched results on all devices.
- Returns:
- The longest a location update may be delayed.
-
getMaxUpdates
public int getMaxUpdates()
- Returns:
- The maximum number of updates delivered to this request. A location request will not receive any locations after the
maximum number of updates has been reached, and will be removed shortly thereafter. A value of
Integer.MAX_VALUE
implies an unlimited number of updates.
-
getMaxWaitTime
@Deprecated public long getMaxWaitTime()
Deprecated.UsegetMaxUpdateDelayMillis()
instead. May be removed in a future release.- Returns:
- The longest a location update may be delayed.
-
getMinUpdateDistanceMeters
public float getMinUpdateDistanceMeters()
- Returns:
- The minimum distance required between consecutive location updates. If a derived location update is not at least the specified distance away from the previous location update delivered to the client, it will not be delivered. This may also allow additional power savings under some circumstances.
-
getMinUpdateIntervalMillis
public long getMinUpdateIntervalMillis()
- Returns:
- The fastest allowed interval of location updates. Location updates may arrive faster than the desired interval
(
getIntervalMillis()
), but will never arrive faster than specified here. FLP APIs make some allowance for jitter with the minimum update interval, so clients need not worry about location updates that arrive a couple milliseconds too early being rejected.
-
getNumUpdates
@Deprecated public int getNumUpdates()
Deprecated.UsegetMaxUpdates()
instead. May be removed in a future release.- Returns:
- The maximum number of updates delivered to this request.
-
getPriority
public int getPriority()
- Returns:
- The
A3LPriority
of the location request.
-
getSmallestDisplacement
@Deprecated public float getSmallestDisplacement()
Deprecated.UsegetMinUpdateDistanceMeters()
instead.- Returns:
- The minimum distance required between consecutive location updates. If a derived location update is not at least the specified distance away from the previous location update delivered to the client, it will not be delivered. This may also allow additional power savings under some circumstances.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
isBatched
public boolean isBatched()
- Returns:
- True if this request allows batching (i.e.
getMaxUpdateDelayMillis()
is at least 2xgetIntervalMillis()
).
-
isFastestIntervalExplicitlySet
@Deprecated public boolean isFastestIntervalExplicitlySet()
Deprecated.Do not use. May be removed in a future release.- Returns:
- True.
-
isPassive
public boolean isPassive()
- Returns:
- True if the priority is
A3LPriority.PRIORITY_PASSIVE
.
-
isWaitForAccurateLocation
public boolean isWaitForAccurateLocation()
If this request isA3LPriority.PRIORITY_HIGH_ACCURACY
, this will delay delivery of initial low accuracy locations for a small amount of time in case a high accuracy location can be delivered instead.- Returns:
- True if it is required to wait for high accuracy location.
-
setExpirationDuration
@Deprecated @NonNull public A3LLocationRequest setExpirationDuration(long durationMillis)
Deprecated.UseA3LLocationRequest.Builder.setDurationMillis(long)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
-
setExpirationTime
@Deprecated @NonNull public A3LLocationRequest setExpirationTime(long elapsedRealtime)
Deprecated.UseA3LLocationRequest.Builder.setDurationMillis(long)
instead. Using this method will express the expiration time in terms of duration, which may give unexpected results. May be removed in a future release.- Returns:
A3LLocationRequest
-
setFastestInterval
@Deprecated @NonNull public A3LLocationRequest setFastestInterval(long fastestIntervalMillis) throws java.lang.IllegalArgumentException
Deprecated.UseA3LLocationRequest.Builder.setMinUpdateIntervalMillis(long)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
- Throws:
java.lang.IllegalArgumentException
-
setInterval
@Deprecated @NonNull public A3LLocationRequest setInterval(long intervalMillis) throws java.lang.IllegalArgumentException
Deprecated.UseA3LLocationRequest.Builder.setIntervalMillis(long)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
- Throws:
java.lang.IllegalArgumentException
-
setMaxWaitTime
@Deprecated @NonNull public A3LLocationRequest setMaxWaitTime(long maxWaitTimeMillis) throws java.lang.IllegalArgumentException
Deprecated.UseA3LLocationRequest.Builder.setMaxUpdateDelayMillis(long)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
- Throws:
java.lang.IllegalArgumentException
-
setNumUpdates
@Deprecated @NonNull public A3LLocationRequest setNumUpdates(int maxUpdates) throws java.lang.IllegalArgumentException
Deprecated.UseA3LLocationRequest.Builder.setMaxUpdates(int)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
- Throws:
java.lang.IllegalArgumentException
-
setPriority
@Deprecated @NonNull public A3LLocationRequest setPriority(int priority)
Deprecated.UseA3LLocationRequest.Builder.setPriority(int)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
-
setSmallestDisplacement
@Deprecated @NonNull public A3LLocationRequest setSmallestDisplacement(float smallestDisplacementMeters)
Deprecated.UseA3LLocationRequest.Builder.setMinUpdateDistanceMeters(float)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
-
setWaitForAccurateLocation
@Deprecated @NonNull public A3LLocationRequest setWaitForAccurateLocation(boolean waitForAccurateLocation)
Deprecated.UseA3LLocationRequest.Builder.setWaitForAccurateLocation(boolean)
instead. May be removed in a future release.- Returns:
A3LLocationRequest
-
toString
@NonNull public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
describeContents
public int describeContents()
Needed for Parcelling- Specified by:
describeContents
in interfaceandroid.os.Parcelable
- Returns:
- int: 0
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
Flatten this object in to a Parcel.- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Parameters:
dest
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written. May be 0 orParcelable.PARCELABLE_WRITE_RETURN_VALUE
.
-
-