diff --git a/api/current.txt b/api/current.txt index bc41d65f7c2de..aa09085ba0f0e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -19681,6 +19681,7 @@ package android.location { method public double getAccumulatedDeltaRangeMeters(); method public int getAccumulatedDeltaRangeState(); method public double getAccumulatedDeltaRangeUncertaintyMeters(); + method public double getAutomaticGainControlLevelInDb(); method public long getCarrierCycles(); method public float getCarrierFrequencyHz(); method public double getCarrierPhase(); @@ -19696,6 +19697,7 @@ package android.location { method public int getState(); method public int getSvid(); method public double getTimeOffsetNanos(); + method public boolean hasAutomaticGainControlLevelInDb(); method public boolean hasCarrierCycles(); method public boolean hasCarrierFrequencyHz(); method public boolean hasCarrierPhase(); @@ -19719,11 +19721,13 @@ package android.location { field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800 field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40 field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80 + field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000 field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10 field public static final int STATE_SBAS_SYNC = 8192; // 0x2000 field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4 field public static final int STATE_SYMBOL_SYNC = 32; // 0x20 field public static final int STATE_TOW_DECODED = 8; // 0x8 + field public static final int STATE_TOW_KNOWN = 16384; // 0x4000 field public static final int STATE_UNKNOWN = 0; // 0x0 } @@ -19780,12 +19784,14 @@ package android.location { public final class GnssStatus { method public float getAzimuthDegrees(int); + method public float getCarrierFrequencyHz(int); method public float getCn0DbHz(int); method public int getConstellationType(int); method public float getElevationDegrees(int); method public int getSatelliteCount(); method public int getSvid(int); method public boolean hasAlmanacData(int); + method public boolean hasCarrierFrequency(int); method public boolean hasEphemerisData(int); method public boolean usedInFix(int); field public static final int CONSTELLATION_BEIDOU = 5; // 0x5 @@ -19846,34 +19852,46 @@ package android.location { method public float getAccuracy(); method public double getAltitude(); method public float getBearing(); + method public float getBearingAccuracyDegrees(); method public long getElapsedRealtimeNanos(); method public android.os.Bundle getExtras(); method public double getLatitude(); method public double getLongitude(); method public java.lang.String getProvider(); method public float getSpeed(); + method public float getSpeedAccuracyMetersPerSecond(); method public long getTime(); + method public float getVerticalAccuracyMeters(); method public boolean hasAccuracy(); method public boolean hasAltitude(); method public boolean hasBearing(); + method public boolean hasBearingAccuracy(); method public boolean hasSpeed(); + method public boolean hasSpeedAccuracy(); + method public boolean hasVerticalAccuracy(); method public boolean isFromMockProvider(); method public void removeAccuracy(); method public void removeAltitude(); method public void removeBearing(); + method public void removeBearingAccuracy(); method public void removeSpeed(); + method public void removeSpeedAccuracy(); + method public void removeVerticalAccuracy(); method public void reset(); method public void set(android.location.Location); method public void setAccuracy(float); method public void setAltitude(double); method public void setBearing(float); + method public void setBearingAccuracyDegrees(float); method public void setElapsedRealtimeNanos(long); method public void setExtras(android.os.Bundle); method public void setLatitude(double); method public void setLongitude(double); method public void setProvider(java.lang.String); method public void setSpeed(float); + method public void setSpeedAccuracyMetersPerSecond(float); method public void setTime(long); + method public void setVerticalAccuracyMeters(float); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int FORMAT_DEGREES = 0; // 0x0 diff --git a/api/system-current.txt b/api/system-current.txt index 24f9aadb4aeb7..de350390d9f28 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -20907,6 +20907,7 @@ package android.location { method public double getAccumulatedDeltaRangeMeters(); method public int getAccumulatedDeltaRangeState(); method public double getAccumulatedDeltaRangeUncertaintyMeters(); + method public double getAutomaticGainControlLevelInDb(); method public long getCarrierCycles(); method public float getCarrierFrequencyHz(); method public double getCarrierPhase(); @@ -20922,6 +20923,7 @@ package android.location { method public int getState(); method public int getSvid(); method public double getTimeOffsetNanos(); + method public boolean hasAutomaticGainControlLevelInDb(); method public boolean hasCarrierCycles(); method public boolean hasCarrierFrequencyHz(); method public boolean hasCarrierPhase(); @@ -20945,11 +20947,13 @@ package android.location { field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800 field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40 field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80 + field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000 field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10 field public static final int STATE_SBAS_SYNC = 8192; // 0x2000 field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4 field public static final int STATE_SYMBOL_SYNC = 32; // 0x20 field public static final int STATE_TOW_DECODED = 8; // 0x8 + field public static final int STATE_TOW_KNOWN = 16384; // 0x4000 field public static final int STATE_UNKNOWN = 0; // 0x0 } @@ -21006,12 +21010,14 @@ package android.location { public final class GnssStatus { method public float getAzimuthDegrees(int); + method public float getCarrierFrequencyHz(int); method public float getCn0DbHz(int); method public int getConstellationType(int); method public float getElevationDegrees(int); method public int getSatelliteCount(); method public int getSvid(int); method public boolean hasAlmanacData(int); + method public boolean hasCarrierFrequency(int); method public boolean hasEphemerisData(int); method public boolean usedInFix(int); field public static final int CONSTELLATION_BEIDOU = 5; // 0x5 @@ -21297,29 +21303,39 @@ package android.location { method public float getAccuracy(); method public double getAltitude(); method public float getBearing(); + method public float getBearingAccuracyDegrees(); method public long getElapsedRealtimeNanos(); method public android.os.Bundle getExtras(); method public double getLatitude(); method public double getLongitude(); method public java.lang.String getProvider(); method public float getSpeed(); + method public float getSpeedAccuracyMetersPerSecond(); method public long getTime(); + method public float getVerticalAccuracyMeters(); method public boolean hasAccuracy(); method public boolean hasAltitude(); method public boolean hasBearing(); + method public boolean hasBearingAccuracy(); method public boolean hasSpeed(); + method public boolean hasSpeedAccuracy(); + method public boolean hasVerticalAccuracy(); method public boolean isComplete(); method public boolean isFromMockProvider(); method public void makeComplete(); method public void removeAccuracy(); method public void removeAltitude(); method public void removeBearing(); + method public void removeBearingAccuracy(); method public void removeSpeed(); + method public void removeSpeedAccuracy(); + method public void removeVerticalAccuracy(); method public void reset(); method public void set(android.location.Location); method public void setAccuracy(float); method public void setAltitude(double); method public void setBearing(float); + method public void setBearingAccuracyDegrees(float); method public void setElapsedRealtimeNanos(long); method public void setExtras(android.os.Bundle); method public void setIsFromMockProvider(boolean); @@ -21327,7 +21343,9 @@ package android.location { method public void setLongitude(double); method public void setProvider(java.lang.String); method public void setSpeed(float); + method public void setSpeedAccuracyMetersPerSecond(float); method public void setTime(long); + method public void setVerticalAccuracyMeters(float); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int FORMAT_DEGREES = 0; // 0x0 diff --git a/api/test-current.txt b/api/test-current.txt index 4c277e4732e61..7f62d5141e82a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -19733,6 +19733,7 @@ package android.location { method public double getAccumulatedDeltaRangeMeters(); method public int getAccumulatedDeltaRangeState(); method public double getAccumulatedDeltaRangeUncertaintyMeters(); + method public double getAutomaticGainControlLevelInDb(); method public long getCarrierCycles(); method public float getCarrierFrequencyHz(); method public double getCarrierPhase(); @@ -19748,12 +19749,14 @@ package android.location { method public int getState(); method public int getSvid(); method public double getTimeOffsetNanos(); + method public boolean hasAutomaticGainControlLevelInDb(); method public boolean hasCarrierCycles(); method public boolean hasCarrierFrequencyHz(); method public boolean hasCarrierPhase(); method public boolean hasCarrierPhaseUncertainty(); method public boolean hasSnrInDb(); method public void reset(); + method public void resetAutomaticGainControlLevel(); method public void resetCarrierCycles(); method public void resetCarrierFrequencyHz(); method public void resetCarrierPhase(); @@ -19763,6 +19766,7 @@ package android.location { method public void setAccumulatedDeltaRangeMeters(double); method public void setAccumulatedDeltaRangeState(int); method public void setAccumulatedDeltaRangeUncertaintyMeters(double); + method public void setAutomaticGainControlLevelInDb(double); method public void setCarrierCycles(long); method public void setCarrierFrequencyHz(float); method public void setCarrierPhase(double); @@ -19796,11 +19800,13 @@ package android.location { field public static final int STATE_GAL_E1C_2ND_CODE_LOCK = 2048; // 0x800 field public static final int STATE_GLO_STRING_SYNC = 64; // 0x40 field public static final int STATE_GLO_TOD_DECODED = 128; // 0x80 + field public static final int STATE_GLO_TOD_KNOWN = 32768; // 0x8000 field public static final int STATE_MSEC_AMBIGUOUS = 16; // 0x10 field public static final int STATE_SBAS_SYNC = 8192; // 0x2000 field public static final int STATE_SUBFRAME_SYNC = 4; // 0x4 field public static final int STATE_SYMBOL_SYNC = 32; // 0x20 field public static final int STATE_TOW_DECODED = 8; // 0x8 + field public static final int STATE_TOW_KNOWN = 16384; // 0x4000 field public static final int STATE_UNKNOWN = 0; // 0x0 } @@ -19867,12 +19873,14 @@ package android.location { public final class GnssStatus { method public float getAzimuthDegrees(int); + method public float getCarrierFrequencyHz(int); method public float getCn0DbHz(int); method public int getConstellationType(int); method public float getElevationDegrees(int); method public int getSatelliteCount(); method public int getSvid(int); method public boolean hasAlmanacData(int); + method public boolean hasCarrierFrequency(int); method public boolean hasEphemerisData(int); method public boolean usedInFix(int); field public static final int CONSTELLATION_BEIDOU = 5; // 0x5 @@ -19933,34 +19941,46 @@ package android.location { method public float getAccuracy(); method public double getAltitude(); method public float getBearing(); + method public float getBearingAccuracyDegrees(); method public long getElapsedRealtimeNanos(); method public android.os.Bundle getExtras(); method public double getLatitude(); method public double getLongitude(); method public java.lang.String getProvider(); method public float getSpeed(); + method public float getSpeedAccuracyMetersPerSecond(); method public long getTime(); + method public float getVerticalAccuracyMeters(); method public boolean hasAccuracy(); method public boolean hasAltitude(); method public boolean hasBearing(); + method public boolean hasBearingAccuracy(); method public boolean hasSpeed(); + method public boolean hasSpeedAccuracy(); + method public boolean hasVerticalAccuracy(); method public boolean isFromMockProvider(); method public void removeAccuracy(); method public void removeAltitude(); method public void removeBearing(); + method public void removeBearingAccuracy(); method public void removeSpeed(); + method public void removeSpeedAccuracy(); + method public void removeVerticalAccuracy(); method public void reset(); method public void set(android.location.Location); method public void setAccuracy(float); method public void setAltitude(double); method public void setBearing(float); + method public void setBearingAccuracyDegrees(float); method public void setElapsedRealtimeNanos(long); method public void setExtras(android.os.Bundle); method public void setLatitude(double); method public void setLongitude(double); method public void setProvider(java.lang.String); method public void setSpeed(float); + method public void setSpeedAccuracyMetersPerSecond(float); method public void setTime(long); + method public void setVerticalAccuracyMeters(float); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int FORMAT_DEGREES = 0; // 0x0 diff --git a/location/java/android/location/GnssMeasurement.java b/location/java/android/location/GnssMeasurement.java index d2873e968e33b..ce23176dd7dbc 100644 --- a/location/java/android/location/GnssMeasurement.java +++ b/location/java/android/location/GnssMeasurement.java @@ -47,7 +47,7 @@ public final class GnssMeasurement implements Parcelable { private double mCarrierPhaseUncertainty; private int mMultipathIndicator; private double mSnrInDb; - private double mAgcLevelDb; + private double mAutomaticGainControlLevelInDb; // The following enumerations must be in sync with the values declared in gps.h @@ -117,14 +117,12 @@ public final class GnssMeasurement implements Parcelable { * This GNSS measurement's tracking state has time-of-week known, possibly not decoded * over the air but has been determined from other sources. If TOW decoded is set then TOW Known * will also be set. - * @hide */ public static final int STATE_TOW_KNOWN = (1<<14); /** * This Glonass measurement's tracking state has time-of-day known, possibly not decoded * over the air but has been determined from other sources. If TOD decoded is set then TOD Known * will also be set. - * @hide */ public static final int STATE_GLO_TOD_KNOWN = (1<<15); @@ -196,7 +194,7 @@ public final class GnssMeasurement implements Parcelable { mCarrierPhaseUncertainty = measurement.mCarrierPhaseUncertainty; mMultipathIndicator = measurement.mMultipathIndicator; mSnrInDb = measurement.mSnrInDb; - mAgcLevelDb = measurement.mAgcLevelDb; + mAutomaticGainControlLevelInDb = measurement.mAutomaticGainControlLevelInDb; } /** @@ -884,10 +882,10 @@ public final class GnssMeasurement implements Parcelable { } /** - * Returns {@code true} if {@link #getAgcLevelDb()} is available, {@code false} otherwise. - * @hide + * Returns {@code true} if {@link #getAutomaticGainControlLevelInDb()} is available, + * {@code false} otherwise. */ - public boolean hasAgcLevelDb() { + public boolean hasAutomaticGainControlLevelInDb() { return isFlagSet(HAS_AUTOMATIC_GAIN_CONTROL); } @@ -903,29 +901,30 @@ public final class GnssMeasurement implements Parcelable { * components) may also affect the typical output of of this value on any given hardware design * in an open sky test - the important aspect of this output is that changes in this value are * indicative of changes on input signal power in the frequency band for this measurement. - *

The value is only available if {@link #hasAgcLevelDb()} is {@code true}. - * @hide + *

The value is only available if {@link #hasAutomaticGainControlLevelInDb()} is {@code true} */ - public double getAgcLevelDb() { - return mAgcLevelDb; + public double getAutomaticGainControlLevelInDb() { + return mAutomaticGainControlLevelInDb; } /** * Sets the Automatic Gain Control level in dB. * @hide */ - public void setAgcLevelDb(double agcLevelDb) { + @TestApi + public void setAutomaticGainControlLevelInDb(double agcLevelDb) { setFlag(HAS_AUTOMATIC_GAIN_CONTROL); - mAgcLevelDb = agcLevelDb; + mAutomaticGainControlLevelInDb = agcLevelDb; } /** * Resets the Automatic Gain Control level. * @hide */ - public void resetAgcLevel() { + @TestApi + public void resetAutomaticGainControlLevel() { resetFlag(HAS_AUTOMATIC_GAIN_CONTROL); - mAgcLevelDb = Double.NaN; + mAutomaticGainControlLevelInDb = Double.NaN; } public static final Creator CREATOR = new Creator() { @@ -952,7 +951,7 @@ public final class GnssMeasurement implements Parcelable { gnssMeasurement.mCarrierPhaseUncertainty = parcel.readDouble(); gnssMeasurement.mMultipathIndicator = parcel.readInt(); gnssMeasurement.mSnrInDb = parcel.readDouble(); - gnssMeasurement.mAgcLevelDb = parcel.readDouble(); + gnssMeasurement.mAutomaticGainControlLevelInDb = parcel.readDouble(); return gnssMeasurement; } @@ -984,7 +983,7 @@ public final class GnssMeasurement implements Parcelable { parcel.writeDouble(mCarrierPhaseUncertainty); parcel.writeInt(mMultipathIndicator); parcel.writeDouble(mSnrInDb); - parcel.writeDouble(mAgcLevelDb); + parcel.writeDouble(mAutomaticGainControlLevelInDb); } @Override @@ -1058,7 +1057,7 @@ public final class GnssMeasurement implements Parcelable { builder.append(String.format( format, "AgcLevelDb", - hasAgcLevelDb() ? mAgcLevelDb : null)); + hasAutomaticGainControlLevelInDb() ? mAutomaticGainControlLevelInDb : null)); return builder.toString(); } @@ -1082,7 +1081,7 @@ public final class GnssMeasurement implements Parcelable { resetCarrierPhaseUncertainty(); setMultipathIndicator(MULTIPATH_INDICATOR_UNKNOWN); resetSnrInDb(); - resetAgcLevel(); + resetAutomaticGainControlLevel(); } private void setFlag(int flag) { diff --git a/location/java/android/location/GnssStatus.java b/location/java/android/location/GnssStatus.java index 6565042cc95f8..78dbc71268acc 100644 --- a/location/java/android/location/GnssStatus.java +++ b/location/java/android/location/GnssStatus.java @@ -223,7 +223,6 @@ public final class GnssStatus { * frequency is available for the satellite at the specified index). * * @param satIndex the index of the satellite in the list. - * @hide */ public boolean hasCarrierFrequency(int satIndex) { return (mSvidWithFlags[satIndex] & GNSS_SV_FLAGS_HAS_CARRIER_FREQUENCY) != 0; @@ -236,7 +235,6 @@ public final class GnssStatus { * the field is not set, it is the primary common use frequency, e.g. L1 for GPS. * *

The value is only available if {@link #hasCarrierFrequency(int satIndex)} is {@code true}. - * @hide */ public float getCarrierFrequencyHz(int satIndex) { return mCarrierFrequencies[satIndex]; diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java index f5f437e0bbe58..b222a6da9a983 100644 --- a/location/java/android/location/Location.java +++ b/location/java/android/location/Location.java @@ -798,7 +798,6 @@ public class Location implements Parcelable { /** * True if this location has a vertical accuracy. - * @hide */ public boolean hasVerticalAccuracy() { return (mFieldsMask & HAS_VERTICAL_ACCURACY_MASK) != 0; @@ -818,7 +817,6 @@ public class Location implements Parcelable { * errors do not always follow such a simple distribution. * *

If this location does not have a vertical accuracy, then 0.0 is returned. - * @hide */ public float getVerticalAccuracyMeters() { return mVerticalAccuracyMeters; @@ -830,7 +828,6 @@ public class Location implements Parcelable { *

See {@link #getVerticalAccuracyMeters} for the definition of vertical accuracy. * *

Following this call {@link #hasVerticalAccuracy} will return true. - * @hide */ public void setVerticalAccuracyMeters(float verticalAccuracyMeters) { mVerticalAccuracyMeters = verticalAccuracyMeters; @@ -842,7 +839,6 @@ public class Location implements Parcelable { * *

Following this call {@link #hasVerticalAccuracy} will return false, and * {@link #getVerticalAccuracyMeters} will return 0.0. - * @hide */ public void removeVerticalAccuracy() { mVerticalAccuracyMeters = 0.0f; @@ -851,7 +847,6 @@ public class Location implements Parcelable { /** * True if this location has a speed accuracy. - * @hide */ public boolean hasSpeedAccuracy() { return (mFieldsMask & HAS_SPEED_ACCURACY_MASK) != 0; @@ -866,7 +861,6 @@ public class Location implements Parcelable { * inside the circle. * *

If this location does not have a speed accuracy, then 0.0 is returned. - * @hide */ public float getSpeedAccuracyMetersPerSecond() { return mSpeedAccuracyMetersPerSecond; @@ -878,7 +872,6 @@ public class Location implements Parcelable { *

See {@link #getSpeedAccuracyMetersPerSecond} for the definition of speed accuracy. * *

Following this call {@link #hasSpeedAccuracy} will return true. - * @hide */ public void setSpeedAccuracyMetersPerSecond(float speedAccuracyMeterPerSecond) { mSpeedAccuracyMetersPerSecond = speedAccuracyMeterPerSecond; @@ -890,7 +883,6 @@ public class Location implements Parcelable { * *

Following this call {@link #hasSpeedAccuracy} will return false, and * {@link #getSpeedAccuracyMetersPerSecond} will return 0.0. - * @hide */ public void removeSpeedAccuracy() { mSpeedAccuracyMetersPerSecond = 0.0f; @@ -899,7 +891,6 @@ public class Location implements Parcelable { /** * True if this location has a bearing accuracy. - * @hide */ public boolean hasBearingAccuracy() { return (mFieldsMask & HAS_BEARING_ACCURACY_MASK) != 0; @@ -914,7 +905,6 @@ public class Location implements Parcelable { * inside the circle. * *

If this location does not have a bearing accuracy, then 0.0 is returned. - * @hide */ public float getBearingAccuracyDegrees() { return mBearingAccuracyDegrees; @@ -926,7 +916,6 @@ public class Location implements Parcelable { *

See {@link #getBearingAccuracyDegrees} for the definition of bearing accuracy. * *

Following this call {@link #hasBearingAccuracy} will return true. - * @hide */ public void setBearingAccuracyDegrees(float bearingAccuracyDegrees) { mBearingAccuracyDegrees = bearingAccuracyDegrees; @@ -938,7 +927,6 @@ public class Location implements Parcelable { * *

Following this call {@link #hasBearingAccuracy} will return false, and * {@link #getBearingAccuracyDegrees} will return 0.0. - * @hide */ public void removeBearingAccuracy() { mBearingAccuracyDegrees = 0.0f; diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp index 5a20bed04d6e9..01a1efc3506ed 100644 --- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp +++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp @@ -673,7 +673,7 @@ jobject GnssMeasurementCallback::translateGnssMeasurement( } if (flags & static_cast(GnssMeasurementFlags::HAS_AUTOMATIC_GAIN_CONTROL)) { - SET(AgcLevelDb, measurement->agcLevelDb); + SET(AutomaticGainControlLevelInDb, measurement->agcLevelDb); } return object.get();