From 3796ab1bf32b417c570a445a7cb810088f2a15e2 Mon Sep 17 00:00:00 2001 From: gomo Date: Wed, 20 Feb 2019 23:21:11 -0800 Subject: Bluesky API council review Making method names clearer and adding more annotations. Bug: 124882841 Test: Current Tests Pass. Change-Id: Ic36f9ac6e69280f3efa9f812fee1ff6e4e4b1773 --- .../location/GnssMeasurementCorrections.java | 10 ++++---- .../java/android/location/GnssReflectingPlane.java | 2 +- .../android/location/GnssSingleSatCorrection.java | 30 ++++++++++++---------- 3 files changed, 22 insertions(+), 20 deletions(-) (limited to 'location/java/android') diff --git a/location/java/android/location/GnssMeasurementCorrections.java b/location/java/android/location/GnssMeasurementCorrections.java index 3ce48b4f7627..9d3211d1b4f8 100644 --- a/location/java/android/location/GnssMeasurementCorrections.java +++ b/location/java/android/location/GnssMeasurementCorrections.java @@ -124,7 +124,7 @@ public final class GnssMeasurementCorrections implements Parcelable { * Gets a set of {@link GnssSingleSatCorrection} each containing measurement corrections for a * satellite in view */ - public @Nullable List getSingleSatCorrectionList() { + public @Nullable List getSingleSatelliteCorrectionList() { return mSingleSatCorrectionList; } @@ -137,7 +137,7 @@ public final class GnssMeasurementCorrections implements Parcelable { new Creator() { @Override public GnssMeasurementCorrections createFromParcel(Parcel parcel) { - GnssMeasurementCorrections.Builder gnssMeasurementCorrectons = + final GnssMeasurementCorrections.Builder gnssMeasurementCorrectons = new Builder() .setLatitudeDegrees(parcel.readDouble()) .setLongitudeDegrees(parcel.readDouble()) @@ -147,7 +147,7 @@ public final class GnssMeasurementCorrections implements Parcelable { .setToaGpsNanosecondsOfWeek(parcel.readLong()); List singleSatCorrectionList = new ArrayList<>(); parcel.readTypedList(singleSatCorrectionList, GnssSingleSatCorrection.CREATOR); - gnssMeasurementCorrectons.setSingleSatCorrectionList( + gnssMeasurementCorrectons.setSingleSatelliteCorrectionList( singleSatCorrectionList.isEmpty() ? null : singleSatCorrectionList); return gnssMeasurementCorrectons.build(); } @@ -188,7 +188,7 @@ public final class GnssMeasurementCorrections implements Parcelable { } /** Builder for {@link GnssMeasurementCorrections} */ - public static class Builder { + public static final class Builder { /** * For documentation of below fields, see corresponding fields in {@link * GnssMeasurementCorrections}. @@ -253,7 +253,7 @@ public final class GnssMeasurementCorrections implements Parcelable { * Sets a the list of {@link GnssSingleSatCorrection} containing measurement corrections for * a satellite in view */ - public Builder setSingleSatCorrectionList( + public Builder setSingleSatelliteCorrectionList( @Nullable List singleSatCorrectionList) { if (singleSatCorrectionList == null) { mSingleSatCorrectionList = null; diff --git a/location/java/android/location/GnssReflectingPlane.java b/location/java/android/location/GnssReflectingPlane.java index 64b37524e37f..9a106a760ec4 100644 --- a/location/java/android/location/GnssReflectingPlane.java +++ b/location/java/android/location/GnssReflectingPlane.java @@ -116,7 +116,7 @@ public final class GnssReflectingPlane implements Parcelable { } /** Builder for {@link GnssReflectingPlane} */ - public static class Builder { + public static final class Builder { /** For documentation, see corresponding fields in {@link GnssReflectingPlane}. */ private double mLatitudeDegrees; diff --git a/location/java/android/location/GnssSingleSatCorrection.java b/location/java/android/location/GnssSingleSatCorrection.java index 4d5303f18b81..f719e1a985b8 100644 --- a/location/java/android/location/GnssSingleSatCorrection.java +++ b/location/java/android/location/GnssSingleSatCorrection.java @@ -60,6 +60,7 @@ public final class GnssSingleSatCorrection implements Parcelable { private int mSingleSatCorrectionFlags; /** Defines the constellation of the given satellite as defined in {@link GnssStatus}. */ + @GnssStatus.ConstellationType private int mConstellationType; /** @@ -115,7 +116,7 @@ public final class GnssSingleSatCorrection implements Parcelable { } /** Gets a bitmask of fields present in this object */ - public int getSingleSatCorrectionFlags() { + public int getSingleSatelliteCorrectionFlags() { return mSingleSatCorrectionFlags; } @@ -136,7 +137,7 @@ public final class GnssSingleSatCorrection implements Parcelable { *

Interpretation depends on {@link #getConstellationType()}. See {@link * GnssStatus#getSvid(int)}. */ - public int getSatId() { + public int getSatelliteId() { return mSatId; } @@ -162,7 +163,7 @@ public final class GnssSingleSatCorrection implements Parcelable { * location. */ @FloatRange(from = 0f, to = 1f) - public float getProbSatIsLos() { + public float getProbabilityLineOfSight() { return mProbSatIsLos; } @@ -189,8 +190,8 @@ public final class GnssSingleSatCorrection implements Parcelable { return mReflectingPlane; } - /** Returns {@code true} if {@link #getProbSatIsLos()} is valid. */ - public boolean hasSatelliteLineOfSight() { + /** Returns {@code true} if {@link #getProbabilityLineOfSight()} is valid. */ + public boolean hasValidSatelliteLineOfSight() { return (mSingleSatCorrectionFlags & HAS_PROB_SAT_IS_LOS_MASK) != 0; } @@ -220,11 +221,11 @@ public final class GnssSingleSatCorrection implements Parcelable { public GnssSingleSatCorrection createFromParcel(Parcel parcel) { GnssSingleSatCorrection singleSatCorrection = new Builder() - .setSingleSatCorrectionFlags(parcel.readInt()) + .setSingleSatelliteCorrectionFlags(parcel.readInt()) .setConstellationType(parcel.readInt()) - .setSatId(parcel.readInt()) + .setSatelliteId(parcel.readInt()) .setCarrierFrequencyHz(parcel.readFloat()) - .setProbSatIsLos(parcel.readFloat()) + .setProbabilityLineOfSight(parcel.readFloat()) .setExcessPathLengthMeters(parcel.readFloat()) .setExcessPathLengthUncertaintyMeters(parcel.readFloat()) .setReflectingPlane( @@ -272,7 +273,7 @@ public final class GnssSingleSatCorrection implements Parcelable { } /** Builder for {@link GnssSingleSatCorrection} */ - public static class Builder { + public static final class Builder { /** * For documentation of below fields, see corresponding fields in {@link @@ -289,19 +290,19 @@ public final class GnssSingleSatCorrection implements Parcelable { private GnssReflectingPlane mReflectingPlane; /** Sets a bitmask of fields present in this object */ - public Builder setSingleSatCorrectionFlags(int singleSatCorrectionFlags) { + public Builder setSingleSatelliteCorrectionFlags(int singleSatCorrectionFlags) { mSingleSatCorrectionFlags = singleSatCorrectionFlags; return this; } /** Sets the constellation type. */ - public Builder setConstellationType(int constellationType) { + public Builder setConstellationType(@GnssStatus.ConstellationType int constellationType) { mConstellationType = constellationType; return this; } - /** Sets the Satellite ID. */ - public Builder setSatId(int satId) { + /** Sets the Satellite ID defined in the ICD of the given constellation. */ + public Builder setSatelliteId(int satId) { mSatId = satId; return this; } @@ -316,7 +317,8 @@ public final class GnssSingleSatCorrection implements Parcelable { * Sets the line-of-sight probability of the satellite at the given location in the range * between 0 and 1. */ - public Builder setProbSatIsLos(@FloatRange(from = 0f, to = 1f) float probSatIsLos) { + public Builder setProbabilityLineOfSight( + @FloatRange(from = 0f, to = 1f) float probSatIsLos) { Preconditions.checkArgumentInRange( probSatIsLos, 0, 1, "probSatIsLos should be between 0 and 1."); mProbSatIsLos = probSatIsLos; -- cgit v1.2.3-59-g8ed1b