summaryrefslogtreecommitdiff
path: root/location
diff options
context:
space:
mode:
authorBrian Julian <bjj@google.com>2023-08-30 21:04:21 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-08-30 21:04:21 +0000
commit866291017c026d28be9473805bb4ead7e3b3f043 (patch)
tree41e63bfbba99d7786c835ce192a63b02b05ea9f4 /location
parentba465c1bcb46fd1c5aed55b76010262084620652 (diff)
parent92af27fadc9646693b432885499f0323f1ec8c83 (diff)
downloadbase-866291017c026d28be9473805bb4ead7e3b3f043.tar.gz
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: 2854796f6f am: 92af27fadc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24589148 Change-Id: I1963ffa3ac4ed60fd2b77f6d795120b351b530d9 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'location')
-rw-r--r--location/java/android/location/Location.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index 0eb657aba033..fd3e5a22e969 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -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;
}