Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3035ebc0 authored by Oleksii Kislinskyi's avatar Oleksii Kislinskyi Committed by Android (Google) Code Review
Browse files

Merge "Update the default fastest interval factor" into main

parents ee08f6fa e324fd74
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.annotation.SystemApi;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
import android.content.pm.PackageManager;
import android.location.flags.Flags;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
@@ -181,7 +182,8 @@ public final class LocationRequest implements Parcelable {
    public static final int POWER_HIGH = 203;

    private static final long IMPLICIT_MIN_UPDATE_INTERVAL = -1;
    private static final double IMPLICIT_MIN_UPDATE_INTERVAL_FACTOR = 1D / 6D;
    private static final double LEGACY_IMPLICIT_MIN_UPDATE_INTERVAL_FACTOR = 1D / 6D;
    private static final double IMPLICIT_MIN_UPDATE_INTERVAL_FACTOR = 1D / 2D;

    private @Nullable String mProvider;
    private @Quality int mQuality;
@@ -553,7 +555,10 @@ public final class LocationRequest implements Parcelable {
     */
    public @IntRange(from = 0) long getMinUpdateIntervalMillis() {
        if (mMinUpdateIntervalMillis == IMPLICIT_MIN_UPDATE_INTERVAL) {
            if (Flags.updateMinLocationRequestInterval()) {
                return (long) (mIntervalMillis * IMPLICIT_MIN_UPDATE_INTERVAL_FACTOR);
            }
            return (long) (mIntervalMillis * LEGACY_IMPLICIT_MIN_UPDATE_INTERVAL_FACTOR);
        } else {
            // the min is only necessary in case someone use a deprecated function to mess with the
            // interval or min update interval
+11 −0
Original line number Diff line number Diff line
@@ -168,3 +168,14 @@ flag {
    description: "Flag for GNSS assistance interface"
    bug: "209078566"
}

flag {
    name: "update_min_location_request_interval"
    namespace: "location"
    description: "Flag for updating the default logic for the minimal interval for location request"
    bug: "397444378"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}