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

Commit 92af27fa authored by Brian Julian's avatar Brian Julian Committed by Automerger Merge Worker
Browse files

Merge "Modifies getMslAltitudeMeters and getMslAltitudeAccuracyMeters in...

Merge "Modifies getMslAltitudeMeters and getMslAltitudeAccuracyMeters in android.location.Location to no longer throw IllegalStateExceptions when corresponding values are not set." into udc-qpr-dev am: 2854796f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24589148



Change-Id: I5a38b93741e957db4effeb72910ec2006d8a406d
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f65bda57 2854796f
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -709,11 +709,9 @@ public class Location implements Parcelable {
    /**
     * Returns the Mean Sea Level altitude of this location in meters.
     *
     * @throws IllegalStateException if {@link #hasMslAltitude()} is false.
     * <p>This is only valid if {@link #hasMslAltitude()} is true.
     */
    public @FloatRange double getMslAltitudeMeters() {
        Preconditions.checkState(hasMslAltitude(),
                "The Mean Sea Level altitude of this location is not set.");
        return mMslAltitudeMeters;
    }

@@ -744,11 +742,9 @@ public class Location implements Parcelable {
     * percentile confidence level. This means that there is 68% chance that the true Mean Sea Level
     * altitude of this location falls within {@link #getMslAltitudeMeters()} +/- this uncertainty.
     *
     * @throws IllegalStateException if {@link #hasMslAltitudeAccuracy()} is false.
     * <p>This is only valid if {@link #hasMslAltitudeAccuracy()} is true.
     */
    public @FloatRange(from = 0.0) float getMslAltitudeAccuracyMeters() {
        Preconditions.checkState(hasMslAltitudeAccuracy(),
                "The Mean Sea Level altitude accuracy of this location is not set.");
        return mMslAltitudeAccuracyMeters;
    }