Class A3LCurrentLocationRequest.Builder

    • Method Detail

      • setDurationMillis

        @NonNull
        public A3LCurrentLocationRequest.Builder setDurationMillis​(long durationMillis)
        Sets 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. The current location request may fail and return a null location after a shorter duration, but never a longer duration.

        NOTE: Internally, this duration may be 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 usually around roughly 30 seconds.

        The default value is Long.MAX_VALUE.

        Parameters:
        durationMillis - : Duration in milliseconds of the location request used to derive the current location
        Returns:
        A3LCurrentLocationRequest.Builder
      • setGranularity

        @NonNull
        public A3LCurrentLocationRequest.Builder setGranularity​(int granularity)
        Sets the Granularity of locations returned for this request. This controls whether fine or coarse locations may be returned. The default value is A3LGranularity.GRANULARITY_PERMISSION_LEVEL.
        Parameters:
        granularity - : Granularity of locations to be returned for this request.
        Returns:
        A3LCurrentLocationRequest.Builder
      • setMaxUpdateAgeMillis

        @NonNull
        public A3LCurrentLocationRequest.Builder setMaxUpdateAgeMillis​(long maxUpdateAgeMillis)
        Sets 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.

        The default value is 1 minute. Do not rely on the default value always being 1 minute as this may change without notice.

        Parameters:
        maxUpdateAgeMillis - : Maximum age of any location to be returned for this request.
        Returns:
        A3LCurrentLocationRequest.Builder
      • setPriority

        @NonNull
        public A3LCurrentLocationRequest.Builder setPriority​(int priority)
        Sets the Priority of the location request used to derive the current location if no historical location satisfies the current location request.

        The default value is Priority.PRIORITY_BALANCED_POWER_ACCURACY

        Parameters:
        priority - : A3LPriority to be set for the current location request.
        Returns:
        A3LCurrentLocationRequest.Builder