diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 9bcfe11bfe322..c44ee8d9717c4 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -4450,6 +4450,7 @@ package android.location { method public boolean hasLowPowerMode(); method public boolean hasMeasurementCorrections(); method public boolean hasMeasurementCorrectionsExcessPathLength(); + method public boolean hasMeasurementCorrectionsForDriving(); method public boolean hasMeasurementCorrectionsLosSats(); method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane(); method public boolean hasMeasurementCorrectionsReflectingPlane(); @@ -4465,6 +4466,7 @@ package android.location { method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean); method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean); method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean); + method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsForDriving(boolean); method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean); method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean); method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrelationVectors(boolean); diff --git a/location/java/android/location/GnssCapabilities.java b/location/java/android/location/GnssCapabilities.java index a5e28158ab788..fdf0f59c13dcd 100644 --- a/location/java/android/location/GnssCapabilities.java +++ b/location/java/android/location/GnssCapabilities.java @@ -61,6 +61,8 @@ public final class GnssCapabilities implements Parcelable { public static final int TOP_HAL_CAPABILITY_CORRELATION_VECTOR = 4096; /** @hide */ public static final int TOP_HAL_CAPABILITY_SATELLITE_PVT = 8192; + /** @hide */ + public static final int TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 16384; /** @hide */ @IntDef(flag = true, prefix = {"TOP_HAL_CAPABILITY_"}, value = {TOP_HAL_CAPABILITY_SCHEDULING, @@ -69,7 +71,8 @@ public final class GnssCapabilities implements Parcelable { TOP_HAL_CAPABILITY_MEASUREMENTS, TOP_HAL_CAPABILITY_NAV_MESSAGES, TOP_HAL_CAPABILITY_LOW_POWER_MODE, TOP_HAL_CAPABILITY_SATELLITE_BLOCKLIST, TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS, TOP_HAL_CAPABILITY_ANTENNA_INFO, - TOP_HAL_CAPABILITY_CORRELATION_VECTOR, TOP_HAL_CAPABILITY_SATELLITE_PVT}) + TOP_HAL_CAPABILITY_CORRELATION_VECTOR, TOP_HAL_CAPABILITY_SATELLITE_PVT, + TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING}) @Retention(RetentionPolicy.SOURCE) public @interface TopHalCapabilityFlags {} @@ -350,6 +353,17 @@ public final class GnssCapabilities implements Parcelable { return (mTopFlags & TOP_HAL_CAPABILITY_CORRELATION_VECTOR) != 0; } + /** + * Returns {@code true} if GNSS chipset will benefit from measurement corrections for driving + * use case if provided, {@code false} otherwise. + * + * @hide + */ + @SystemApi + public boolean hasMeasurementCorrectionsForDriving() { + return (mTopFlags & TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING) != 0; + } + /** * Returns {@code true} if GNSS chipset supports line-of-sight satellite identification * measurement corrections, {@code false} otherwise. @@ -550,6 +564,9 @@ public final class GnssCapabilities implements Parcelable { if (hasMeasurementCorrelationVectors()) { builder.append("MEASUREMENT_CORRELATION_VECTORS "); } + if (hasMeasurementCorrectionsForDriving()) { + builder.append("MEASUREMENT_CORRECTIONS_FOR_DRIVING "); + } if (hasMeasurementCorrectionsLosSats()) { builder.append("LOS_SATS "); } @@ -747,6 +764,18 @@ public final class GnssCapabilities implements Parcelable { return this; } + /** + * Sets measurement corrections for driving capability. + * + * @hide + */ + @SystemApi + public @NonNull Builder setHasMeasurementCorrectionsForDriving(boolean capable) { + mTopFlags = setFlag(mTopFlags, TOP_HAL_CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING, + capable); + return this; + } + /** * Sets measurement corrections line-of-sight satellites capabilitity. *