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

Commit 3b989d0f authored by Mohammed Khider's avatar Mohammed Khider Committed by Android (Google) Code Review
Browse files

Merge "Bluesky: Handle null correction objects gracefully."

parents 7885c846 5716ab88
Loading
Loading
Loading
Loading
+42 −48
Original line number Diff line number Diff line
@@ -3056,81 +3056,75 @@ package android.location {
  public final class GnssMeasurementCorrections implements android.os.Parcelable {
    method public int describeContents();
    method public double getAltitudeMeters();
    method public double getHorizontalPositionUncertaintyMeters();
    method public double getLatitudeDegrees();
    method public double getLongitudeDegrees();
    method @Nullable public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
    method public long getToaGpsNanosecondsOfWeek();
    method public double getVerticalPositionUncertaintyMeters();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
    method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
    method @FloatRange(from=0.0f) public double getHorizontalPositionUncertaintyMeters();
    method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
    method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
    method @NonNull public java.util.List<android.location.GnssSingleSatCorrection> getSingleSatelliteCorrectionList();
    method @IntRange(from=0) public long getToaGpsNanosecondsOfWeek();
    method @FloatRange(from=0.0f) public double getVerticalPositionUncertaintyMeters();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssMeasurementCorrections> CREATOR;
  }
  public static final class GnssMeasurementCorrections.Builder {
    ctor public GnssMeasurementCorrections.Builder();
    method public android.location.GnssMeasurementCorrections build();
    method public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(double);
    method public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(double);
    method public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(double);
    method public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(double);
    method public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@Nullable java.util.List<android.location.GnssSingleSatCorrection>);
    method public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(long);
    method public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(double);
    method @NonNull public android.location.GnssMeasurementCorrections build();
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setHorizontalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setSingleSatelliteCorrectionList(@NonNull java.util.List<android.location.GnssSingleSatCorrection>);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setToaGpsNanosecondsOfWeek(@IntRange(from=0) long);
    method @NonNull public android.location.GnssMeasurementCorrections.Builder setVerticalPositionUncertaintyMeters(@FloatRange(from=0.0f) double);
  }
  public final class GnssReflectingPlane implements android.os.Parcelable {
    method public int describeContents();
    method public double getAltitudeMeters();
    method public double getAzimuthDegrees();
    method public double getLatitudeDegrees();
    method public double getLongitudeDegrees();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
    method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
    method @FloatRange(from=0.0f, to=360.0f) public double getAzimuthDegrees();
    method @FloatRange(from=-90.0F, to=90.0f) public double getLatitudeDegrees();
    method @FloatRange(from=-180.0F, to=180.0f) public double getLongitudeDegrees();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssReflectingPlane> CREATOR;
  }
  public static final class GnssReflectingPlane.Builder {
    ctor public GnssReflectingPlane.Builder();
    method public android.location.GnssReflectingPlane build();
    method public android.location.GnssReflectingPlane.Builder setAltitudeMeters(double);
    method public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(double);
    method public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(double);
    method public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(double);
    method @NonNull public android.location.GnssReflectingPlane build();
    method @NonNull public android.location.GnssReflectingPlane.Builder setAltitudeMeters(@FloatRange(from=-1000.0F, to=10000.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setAzimuthDegrees(@FloatRange(from=0.0f, to=360.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setLatitudeDegrees(@FloatRange(from=-90.0F, to=90.0f) double);
    method @NonNull public android.location.GnssReflectingPlane.Builder setLongitudeDegrees(@FloatRange(from=-180.0F, to=180.0f) double);
  }
  public final class GnssSingleSatCorrection implements android.os.Parcelable {
    method public int describeContents();
    method public float getCarrierFrequencyHz();
    method @FloatRange(from=0.0f, fromInclusive=false) public float getCarrierFrequencyHz();
    method public int getConstellationType();
    method public float getExcessPathLengthMeters();
    method public float getExcessPathLengthUncertaintyMeters();
    method @FloatRange(from=0.0f) public float getExcessPathLengthMeters();
    method @FloatRange(from=0.0f) public float getExcessPathLengthUncertaintyMeters();
    method @FloatRange(from=0.0f, to=1.0f) public float getProbabilityLineOfSight();
    method @Nullable public android.location.GnssReflectingPlane getReflectingPlane();
    method public int getSatelliteId();
    method public int getSingleSatelliteCorrectionFlags();
    method @IntRange(from=0) public int getSatelliteId();
    method public boolean hasExcessPathLength();
    method public boolean hasExcessPathLengthUncertainty();
    method public boolean hasReflectingPlane();
    method public boolean hasValidSatelliteLineOfSight();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
    field public static final int HAS_EXCESS_PATH_LENGTH_MASK = 2; // 0x2
    field public static final int HAS_EXCESS_PATH_LENGTH_UNC_MASK = 4; // 0x4
    field public static final int HAS_PROB_SAT_IS_LOS_MASK = 1; // 0x1
    field public static final int HAS_REFLECTING_PLANE_MASK = 8; // 0x8
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.location.GnssSingleSatCorrection> CREATOR;
  }
  public static final class GnssSingleSatCorrection.Builder {
    ctor public GnssSingleSatCorrection.Builder();
    method public android.location.GnssSingleSatCorrection build();
    method public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(float);
    method public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
    method public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(float);
    method public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(float);
    method public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
    method public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(android.location.GnssReflectingPlane);
    method public android.location.GnssSingleSatCorrection.Builder setSatelliteId(int);
    method public android.location.GnssSingleSatCorrection.Builder setSingleSatelliteCorrectionFlags(int);
    method @NonNull public android.location.GnssSingleSatCorrection build();
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setCarrierFrequencyHz(@FloatRange(from=0.0f, fromInclusive=false) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setConstellationType(int);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthMeters(@FloatRange(from=0.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setExcessPathLengthUncertaintyMeters(@FloatRange(from=0.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setProbabilityLineOfSight(@FloatRange(from=0.0f, to=1.0f) float);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setReflectingPlane(@Nullable android.location.GnssReflectingPlane);
    method @NonNull public android.location.GnssSingleSatCorrection.Builder setSatelliteId(@IntRange(from=0) int);
  }
  public class GpsClock implements android.os.Parcelable {
+52 −35
Original line number Diff line number Diff line
@@ -16,11 +16,16 @@

package android.location;

import android.annotation.FloatRange;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.internal.util.Preconditions;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -35,37 +40,44 @@ import java.util.List;
public final class GnssMeasurementCorrections implements Parcelable {

    /** Represents latitude in degrees at which the corrections are computed. */
    private double mLatitudeDegrees;
    @FloatRange(from = -90.0f, to = 90.0f)
    private final double mLatitudeDegrees;
    /** Represents longitude in degrees at which the corrections are computed. */
    private double mLongitudeDegrees;
    @FloatRange(from = -180.0f, to = 180.0f)
    private final double mLongitudeDegrees;
    /**
     * Represents altitude in meters above the WGS 84 reference ellipsoid at which the corrections
     * are computed.
     */
    private double mAltitudeMeters;
    @FloatRange(from = -1000.0, to = 10000.0f)
    private final double mAltitudeMeters;
    /**
     * Represents the horizontal uncertainty (68% confidence) in meters on the device position at
     * which the corrections are provided.
     *
     * <p> This value is useful for example to judge how accurate the provided corrections are.
     */
    private double mHorizontalPositionUncertaintyMeters;
    @FloatRange(from = 0.0f)
    private final double mHorizontalPositionUncertaintyMeters;
    /**
     * Represents the vertical uncertainty (68% confidence) in meters on the device position at
     * which the corrections are provided.
     *
     * <p> This value is useful for example to judge how accurate the provided corrections are.
     */
    private double mVerticalPositionUncertaintyMeters;
    @FloatRange(from = 0.0f)
    private final double mVerticalPositionUncertaintyMeters;

    /** Time Of Applicability, GPS time of week in nanoseconds. */
    private long mToaGpsNanosecondsOfWeek;
    @IntRange(from = 0)
    private final long mToaGpsNanosecondsOfWeek;

    /**
     * A set of {@link GnssSingleSatCorrection} each containing measurement corrections for a
     * satellite in view.
     */
    private @Nullable List<GnssSingleSatCorrection> mSingleSatCorrectionList;
    @NonNull
    private final List<GnssSingleSatCorrection> mSingleSatCorrectionList;

    private GnssMeasurementCorrections(Builder builder) {
        mLatitudeDegrees = builder.mLatitudeDegrees;
@@ -74,19 +86,19 @@ public final class GnssMeasurementCorrections implements Parcelable {
        mHorizontalPositionUncertaintyMeters = builder.mHorizontalPositionUncertaintyMeters;
        mVerticalPositionUncertaintyMeters = builder.mVerticalPositionUncertaintyMeters;
        mToaGpsNanosecondsOfWeek = builder.mToaGpsNanosecondsOfWeek;
        mSingleSatCorrectionList =
                builder.mSingleSatCorrectionList == null
                        ? null
                        : Collections.unmodifiableList(
                                new ArrayList<>(builder.mSingleSatCorrectionList));
        final List<GnssSingleSatCorrection> singleSatCorrList =  builder.mSingleSatCorrectionList;
        Preconditions.checkArgument(singleSatCorrList != null && !singleSatCorrList.isEmpty());
        mSingleSatCorrectionList = Collections.unmodifiableList(new ArrayList<>(singleSatCorrList));
    }

    /** Gets the latitude in degrees at which the corrections are computed. */
    @FloatRange(from = -90.0f, to = 90.0f)
    public double getLatitudeDegrees() {
        return mLatitudeDegrees;
    }

    /** Gets the longitude in degrees at which the corrections are computed. */
    @FloatRange(from = -180.0f, to = 180.0f)
    public double getLongitudeDegrees() {
        return mLongitudeDegrees;
    }
@@ -95,6 +107,7 @@ public final class GnssMeasurementCorrections implements Parcelable {
     * Gets the altitude in meters above the WGS 84 reference ellipsoid at which the corrections are
     * computed.
     */
    @FloatRange(from = -1000.0f, to = 10000.0f)
    public double getAltitudeMeters() {
        return mAltitudeMeters;
    }
@@ -103,6 +116,7 @@ public final class GnssMeasurementCorrections implements Parcelable {
     * Gets the horizontal uncertainty (68% confidence) in meters on the device position at
     * which the corrections are provided.
     */
    @FloatRange(from = 0.0f)
    public double getHorizontalPositionUncertaintyMeters() {
        return mHorizontalPositionUncertaintyMeters;
    }
@@ -111,11 +125,13 @@ public final class GnssMeasurementCorrections implements Parcelable {
     * Gets the vertical uncertainty (68% confidence) in meters on the device position at
     * which the corrections are provided.
     */
    @FloatRange(from = 0.0f)
    public double getVerticalPositionUncertaintyMeters() {
        return mVerticalPositionUncertaintyMeters;
    }

    /** Gets the time of applicability, GPS time of week in nanoseconds. */
    @IntRange(from = 0)
    public long getToaGpsNanosecondsOfWeek() {
        return mToaGpsNanosecondsOfWeek;
    }
@@ -124,7 +140,8 @@ public final class GnssMeasurementCorrections implements Parcelable {
     * Gets a set of {@link GnssSingleSatCorrection} each containing measurement corrections for a
     * satellite in view
     */
    public @Nullable List<GnssSingleSatCorrection> getSingleSatelliteCorrectionList() {
    @NonNull
    public List<GnssSingleSatCorrection> getSingleSatelliteCorrectionList() {
        return mSingleSatCorrectionList;
    }

@@ -133,10 +150,11 @@ public final class GnssMeasurementCorrections implements Parcelable {
        return 0;
    }

    public static final @android.annotation.NonNull Creator<GnssMeasurementCorrections> CREATOR =
    public static final Creator<GnssMeasurementCorrections> CREATOR =
            new Creator<GnssMeasurementCorrections>() {
                @Override
                public GnssMeasurementCorrections createFromParcel(Parcel parcel) {
                @NonNull
                public GnssMeasurementCorrections createFromParcel(@NonNull Parcel parcel) {
                    final GnssMeasurementCorrections.Builder gnssMeasurementCorrectons =
                            new Builder()
                                    .setLatitudeDegrees(parcel.readDouble())
@@ -148,7 +166,7 @@ public final class GnssMeasurementCorrections implements Parcelable {
                    List<GnssSingleSatCorrection> singleSatCorrectionList = new ArrayList<>();
                    parcel.readTypedList(singleSatCorrectionList, GnssSingleSatCorrection.CREATOR);
                    gnssMeasurementCorrectons.setSingleSatelliteCorrectionList(
                            singleSatCorrectionList.isEmpty() ? null : singleSatCorrectionList);
                            singleSatCorrectionList);
                    return gnssMeasurementCorrectons.build();
                }

@@ -177,7 +195,7 @@ public final class GnssMeasurementCorrections implements Parcelable {
    }

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
    public void writeToParcel(@NonNull Parcel parcel, int flags) {
        parcel.writeDouble(mLatitudeDegrees);
        parcel.writeDouble(mLongitudeDegrees);
        parcel.writeDouble(mAltitudeMeters);
@@ -199,16 +217,18 @@ public final class GnssMeasurementCorrections implements Parcelable {
        private double mHorizontalPositionUncertaintyMeters;
        private double mVerticalPositionUncertaintyMeters;
        private long mToaGpsNanosecondsOfWeek;
        private List<GnssSingleSatCorrection> mSingleSatCorrectionList;
        @Nullable private List<GnssSingleSatCorrection> mSingleSatCorrectionList;

        /** Sets the latitude in degrees at which the corrections are computed. */
        public Builder setLatitudeDegrees(double latitudeDegrees) {
        @NonNull public Builder setLatitudeDegrees(
                @FloatRange(from = -90.0f, to = 90.0f) double latitudeDegrees) {
            mLatitudeDegrees = latitudeDegrees;
            return this;
        }

        /** Sets the longitude in degrees at which the corrections are computed. */
        public Builder setLongitudeDegrees(double longitudeDegrees) {
        @NonNull public Builder setLongitudeDegrees(
                @FloatRange(from = -180.0f, to = 180.0f) double longitudeDegrees) {
            mLongitudeDegrees = longitudeDegrees;
            return this;
        }
@@ -217,7 +237,8 @@ public final class GnssMeasurementCorrections implements Parcelable {
         * Sets the altitude in meters above the WGS 84 reference ellipsoid at which the corrections
         * are computed.
         */
        public Builder setAltitudeMeters(double altitudeMeters) {
        @NonNull public Builder setAltitudeMeters(
                @FloatRange(from = -1000.0f, to = 10000.0f) double altitudeMeters) {
            mAltitudeMeters = altitudeMeters;
            return this;
        }
@@ -227,8 +248,8 @@ public final class GnssMeasurementCorrections implements Parcelable {
         * Sets the horizontal uncertainty (68% confidence) in meters on the device position at
         * which the corrections are provided.
         */
        public Builder setHorizontalPositionUncertaintyMeters(
                double horizontalPositionUncertaintyMeters) {
        @NonNull public Builder setHorizontalPositionUncertaintyMeters(
                @FloatRange(from = 0.0f) double horizontalPositionUncertaintyMeters) {
            mHorizontalPositionUncertaintyMeters = horizontalPositionUncertaintyMeters;
            return this;
        }
@@ -237,14 +258,15 @@ public final class GnssMeasurementCorrections implements Parcelable {
         * Sets the vertical uncertainty (68% confidence) in meters on the device position at which
         * the corrections are provided.
         */
        public Builder setVerticalPositionUncertaintyMeters(
                double verticalPositionUncertaintyMeters) {
        @NonNull public Builder setVerticalPositionUncertaintyMeters(
                @FloatRange(from = 0.0f) double verticalPositionUncertaintyMeters) {
            mVerticalPositionUncertaintyMeters = verticalPositionUncertaintyMeters;
            return this;
        }

        /** Sets the time of applicability, GPS time of week in nanoseconds. */
        public Builder setToaGpsNanosecondsOfWeek(long toaGpsNanosecondsOfWeek) {
        @NonNull public Builder setToaGpsNanosecondsOfWeek(
                @IntRange(from = 0) long toaGpsNanosecondsOfWeek) {
            mToaGpsNanosecondsOfWeek = toaGpsNanosecondsOfWeek;
            return this;
        }
@@ -253,19 +275,14 @@ public final class GnssMeasurementCorrections implements Parcelable {
         * Sets a the list of {@link GnssSingleSatCorrection} containing measurement corrections for
         * a satellite in view
         */
        public Builder setSingleSatelliteCorrectionList(
                @Nullable List<GnssSingleSatCorrection> singleSatCorrectionList) {
            if (singleSatCorrectionList == null) {
                mSingleSatCorrectionList = null;
            } else {
                mSingleSatCorrectionList =
                        Collections.unmodifiableList(new ArrayList<>(singleSatCorrectionList));
            }
        @NonNull public Builder setSingleSatelliteCorrectionList(
                @NonNull List<GnssSingleSatCorrection> singleSatCorrectionList) {
            mSingleSatCorrectionList = singleSatCorrectionList;
            return this;
        }

        /** Builds a {@link GnssMeasurementCorrections} instance as specified by this builder. */
        public GnssMeasurementCorrections build() {
        @NonNull public GnssMeasurementCorrections build() {
            return new GnssMeasurementCorrections(this);
        }
    }
+27 −13

File changed.

Preview size limit exceeded, changes collapsed.

+77 −42

File changed.

Preview size limit exceeded, changes collapsed.

+77 −84

File changed.

Preview size limit exceeded, changes collapsed.