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

Commit ba56ba03 authored by Shinru Han's avatar Shinru Han Committed by Android (Google) Code Review
Browse files

Merge "Add capability bit for Bluesky driving" into sc-dev

parents f4315edf 2bd63047
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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);
+30 −1
Original line number Diff line number Diff line
@@ -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.
         *