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

Commit 4cdd728e authored by Brian Julian's avatar Brian Julian Committed by Android (Google) Code Review
Browse files

Merge "Unhide AltitudeConverter method to perform non-blocking geoid height...

Merge "Unhide AltitudeConverter method to perform non-blocking geoid height calculations." into main
parents 7284cd67 3e353ea2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -682,6 +682,7 @@ package android.location.altitude {
  public final class AltitudeConverter {
    ctor public AltitudeConverter();
    method @WorkerThread public void addMslAltitudeToLocation(@NonNull android.content.Context, @NonNull android.location.Location) throws java.io.IOException;
    method @FlaggedApi(Flags.FLAG_GEOID_HEIGHTS_VIA_ALTITUDE_HAL) public boolean addMslAltitudeToLocation(@NonNull android.location.Location);
  }

}
+7 −5
Original line number Diff line number Diff line
@@ -16,12 +16,14 @@

package android.location.altitude;

import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.WorkerThread;
import android.content.Context;
import android.frameworks.location.altitude.GetGeoidHeightRequest;
import android.frameworks.location.altitude.GetGeoidHeightResponse;
import android.location.Location;
import android.location.flags.Flags;

import com.android.internal.location.altitude.GeoidMap;
import com.android.internal.location.altitude.S2CellIdUtils;
@@ -213,12 +215,12 @@ public final class AltitudeConverter {
    }

    /**
     * Same as {@link #addMslAltitudeToLocation(Context, Location)} except that data will not be
     * loaded from raw assets. Returns true if a Mean Sea Level altitude is added to the
     * {@code location}; otherwise, returns false and leaves the {@code location} unchanged.
     *
     * @hide
     * Same as {@link #addMslAltitudeToLocation(Context, Location)} except that this method can be
     * called on the main thread as data will not be loaded from raw assets. Returns true if a Mean
     * Sea Level altitude is added to the {@code location}; otherwise, returns false and leaves the
     * {@code location} unchanged.
     */
    @FlaggedApi(Flags.FLAG_GEOID_HEIGHTS_VIA_ALTITUDE_HAL)
    public boolean addMslAltitudeToLocation(@NonNull Location location) {
        validate(location);
        MapParamsProto geoidHeightParams = GeoidMap.getGeoidHeightParams();
+7 −0
Original line number Diff line number Diff line
@@ -7,6 +7,13 @@ flag {
    bug: "311210517"
}

flag {
    name: "geoid_heights_via_altitude_hal"
    namespace: "location"
    description: "Flag for making geoid heights available via the Altitude HAL"
    bug: "304375846"
}

flag {
    name: "gnss_api_navic_l1"
    namespace: "location"