Unhide AltitudeConverter method to perform non-blocking geoid height calculations.
Test: CtsLocationNoneTestCases
Bug: 304375846
Change-Id: I8db2db2a36a247c8e1f626d590a94c46a275c216
diff --git a/location/api/current.txt b/location/api/current.txt
index c55676b..c7954fe 100644
--- a/location/api/current.txt
+++ b/location/api/current.txt
@@ -682,6 +682,7 @@
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);
}
}
diff --git a/location/java/android/location/altitude/AltitudeConverter.java b/location/java/android/location/altitude/AltitudeConverter.java
index 6f88912..461dafb 100644
--- a/location/java/android/location/altitude/AltitudeConverter.java
+++ b/location/java/android/location/altitude/AltitudeConverter.java
@@ -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 @@
}
/**
- * 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();
diff --git a/location/java/android/location/flags/location.aconfig b/location/java/android/location/flags/location.aconfig
index 32ad09c..a96fe47 100644
--- a/location/java/android/location/flags/location.aconfig
+++ b/location/java/android/location/flags/location.aconfig
@@ -8,6 +8,13 @@
}
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"
description: "Flag for GNSS API for NavIC L1"