Merge "Finalized GPS=>GNSS changes with documents" into nyc-dev

This commit is contained in:
Lifu Tang
2016-02-20 04:58:15 +00:00
committed by Android (Google) Code Review
13 changed files with 395 additions and 335 deletions

View File

@@ -19164,9 +19164,9 @@ package android.location {
method public double getDriftInNsPerSec();
method public double getDriftUncertaintyInNsPerSec();
method public long getFullBiasInNs();
method public int getHardwareClockDiscontinuityCount();
method public short getLeapSecond();
method public long getTimeInNs();
method public long getTimeOfLastHwClockDiscontinuityInNs();
method public double getTimeUncertaintyInNs();
method public byte getType();
method public boolean hasBiasInNs();
@@ -19190,9 +19190,9 @@ package android.location {
method public void setDriftInNsPerSec(double);
method public void setDriftUncertaintyInNsPerSec(double);
method public void setFullBiasInNs(long);
method public void setHardwareClockDiscontinuityCount(int);
method public void setLeapSecond(short);
method public void setTimeInNs(long);
method public void setTimeOfLastHwClockDiscontinuityInNs(long);
method public void setTimeUncertaintyInNs(double);
method public void setType(byte);
method public void writeToParcel(android.os.Parcel, int);
@@ -19220,6 +19220,7 @@ package android.location {
method public double getCn0InDbHz();
method public double getCodePhaseInChips();
method public double getCodePhaseUncertaintyInChips();
method public byte getConstellationType();
method public double getDopplerShiftInHz();
method public double getDopplerShiftUncertaintyInHz();
method public double getElevationInDeg();
@@ -19227,13 +19228,11 @@ package android.location {
method public byte getLossOfLock();
method public byte getMultipathIndicator();
method public double getPseudorangeInMeters();
method public double getPseudorangeRateCarrierInMetersPerSec();
method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
method public double getPseudorangeRateInMetersPerSec();
method public double getPseudorangeRateUncertaintyInMetersPerSec();
method public double getPseudorangeUncertaintyInMeters();
method public long getReceivedGpsTowInNs();
method public long getReceivedGpsTowUncertaintyInNs();
method public long getReceivedSvTimeInNs();
method public long getReceivedSvTimeUncertaintyInNs();
method public double getSnrInDb();
method public short getState();
method public short getSvid();
@@ -19290,6 +19289,7 @@ package android.location {
method public void setCn0InDbHz(double);
method public void setCodePhaseInChips(double);
method public void setCodePhaseUncertaintyInChips(double);
method public void setConstellationType(byte);
method public void setDopplerShiftInHz(double);
method public void setDopplerShiftUncertaintyInHz(double);
method public void setElevationInDeg(double);
@@ -19297,13 +19297,11 @@ package android.location {
method public void setLossOfLock(byte);
method public void setMultipathIndicator(byte);
method public void setPseudorangeInMeters(double);
method public void setPseudorangeRateCarrierInMetersPerSec(double);
method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
method public void setPseudorangeRateInMetersPerSec(double);
method public void setPseudorangeRateUncertaintyInMetersPerSec(double);
method public void setPseudorangeUncertaintyInMeters(double);
method public void setReceivedGpsTowInNs(long);
method public void setReceivedGpsTowUncertaintyInNs(long);
method public void setReceivedSvTimeInNs(long);
method public void setReceivedSvTimeUncertaintyInNs(long);
method public void setSnrInDb(double);
method public void setState(short);
method public void setSvid(short);
@@ -19364,7 +19362,7 @@ package android.location {
method public short getStatus();
method public short getSubmessageId();
method public short getSvid();
method public byte getType();
method public short getType();
method public void reset();
method public void set(android.location.GnssNavigationMessage);
method public void setData(byte[]);
@@ -19372,14 +19370,19 @@ package android.location {
method public void setStatus(short);
method public void setSubmessageId(short);
method public void setSvid(short);
method public void setType(byte);
method public void setType(short);
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
field public static final byte MESSAGE_TYPE_CNAV2 = 4; // 0x4
field public static final byte MESSAGE_TYPE_L1CA = 1; // 0x1
field public static final byte MESSAGE_TYPE_L2CNAV = 2; // 0x2
field public static final byte MESSAGE_TYPE_L5CNAV = 3; // 0x3
field public static final byte MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short MESSAGE_TYPE_BDS_D1 = 1281; // 0x501
field public static final short MESSAGE_TYPE_BDS_D2 = 1282; // 0x502
field public static final short MESSAGE_TYPE_GAL_F = 1538; // 0x602
field public static final short MESSAGE_TYPE_GAL_I = 1537; // 0x601
field public static final short MESSAGE_TYPE_GLO_L1CA = 769; // 0x301
field public static final short MESSAGE_TYPE_GPS_CNAV2 = 260; // 0x104
field public static final short MESSAGE_TYPE_GPS_L1CA = 257; // 0x101
field public static final short MESSAGE_TYPE_GPS_L2CNAV = 258; // 0x102
field public static final short MESSAGE_TYPE_GPS_L5CNAV = 259; // 0x103
field public static final short MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short STATUS_PARITY_PASSED = 1; // 0x1
field public static final short STATUS_PARITY_REBUILT = 2; // 0x2
field public static final short STATUS_UNKNOWN = 0; // 0x0
@@ -19414,7 +19417,7 @@ package android.location {
public final class GnssStatus {
method public float getAzimuth(int);
method public int getConstellationType(int);
method public byte getConstellationType(int);
method public float getElevation(int);
method public int getNumSatellites();
method public float getSnr(int);
@@ -19422,13 +19425,16 @@ package android.location {
method public boolean hasAlmanac(int);
method public boolean hasEphemeris(int);
method public boolean usedInFix(int);
field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
field public static final int CONSTELLATION_GALILEO = 6; // 0x6
field public static final int CONSTELLATION_GLONASS = 3; // 0x3
field public static final int CONSTELLATION_GPS = 1; // 0x1
field public static final int CONSTELLATION_QZSS = 4; // 0x4
field public static final int CONSTELLATION_SBAS = 2; // 0x2
field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
field public static final byte CONSTELLATION_BEIDOU = 5; // 0x5
field public static final byte CONSTELLATION_GALILEO = 6; // 0x6
field public static final byte CONSTELLATION_GLONASS = 3; // 0x3
field public static final byte CONSTELLATION_GPS = 1; // 0x1
field public static final byte CONSTELLATION_QZSS = 4; // 0x4
field public static final byte CONSTELLATION_SBAS = 2; // 0x2
field public static final byte CONSTELLATION_UNKNOWN = 0; // 0x0
}
public static abstract class GnssStatus.ConstellationType implements java.lang.annotation.Annotation {
}
public abstract class GnssStatusCallback {

View File

@@ -20345,9 +20345,9 @@ package android.location {
method public double getDriftInNsPerSec();
method public double getDriftUncertaintyInNsPerSec();
method public long getFullBiasInNs();
method public int getHardwareClockDiscontinuityCount();
method public short getLeapSecond();
method public long getTimeInNs();
method public long getTimeOfLastHwClockDiscontinuityInNs();
method public double getTimeUncertaintyInNs();
method public byte getType();
method public boolean hasBiasInNs();
@@ -20371,9 +20371,9 @@ package android.location {
method public void setDriftInNsPerSec(double);
method public void setDriftUncertaintyInNsPerSec(double);
method public void setFullBiasInNs(long);
method public void setHardwareClockDiscontinuityCount(int);
method public void setLeapSecond(short);
method public void setTimeInNs(long);
method public void setTimeOfLastHwClockDiscontinuityInNs(long);
method public void setTimeUncertaintyInNs(double);
method public void setType(byte);
method public void writeToParcel(android.os.Parcel, int);
@@ -20401,6 +20401,7 @@ package android.location {
method public double getCn0InDbHz();
method public double getCodePhaseInChips();
method public double getCodePhaseUncertaintyInChips();
method public byte getConstellationType();
method public double getDopplerShiftInHz();
method public double getDopplerShiftUncertaintyInHz();
method public double getElevationInDeg();
@@ -20408,13 +20409,11 @@ package android.location {
method public byte getLossOfLock();
method public byte getMultipathIndicator();
method public double getPseudorangeInMeters();
method public double getPseudorangeRateCarrierInMetersPerSec();
method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
method public double getPseudorangeRateInMetersPerSec();
method public double getPseudorangeRateUncertaintyInMetersPerSec();
method public double getPseudorangeUncertaintyInMeters();
method public long getReceivedGpsTowInNs();
method public long getReceivedGpsTowUncertaintyInNs();
method public long getReceivedSvTimeInNs();
method public long getReceivedSvTimeUncertaintyInNs();
method public double getSnrInDb();
method public short getState();
method public short getSvid();
@@ -20471,6 +20470,7 @@ package android.location {
method public void setCn0InDbHz(double);
method public void setCodePhaseInChips(double);
method public void setCodePhaseUncertaintyInChips(double);
method public void setConstellationType(byte);
method public void setDopplerShiftInHz(double);
method public void setDopplerShiftUncertaintyInHz(double);
method public void setElevationInDeg(double);
@@ -20478,13 +20478,11 @@ package android.location {
method public void setLossOfLock(byte);
method public void setMultipathIndicator(byte);
method public void setPseudorangeInMeters(double);
method public void setPseudorangeRateCarrierInMetersPerSec(double);
method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
method public void setPseudorangeRateInMetersPerSec(double);
method public void setPseudorangeRateUncertaintyInMetersPerSec(double);
method public void setPseudorangeUncertaintyInMeters(double);
method public void setReceivedGpsTowInNs(long);
method public void setReceivedGpsTowUncertaintyInNs(long);
method public void setReceivedSvTimeInNs(long);
method public void setReceivedSvTimeUncertaintyInNs(long);
method public void setSnrInDb(double);
method public void setState(short);
method public void setSvid(short);
@@ -20545,7 +20543,7 @@ package android.location {
method public short getStatus();
method public short getSubmessageId();
method public short getSvid();
method public byte getType();
method public short getType();
method public void reset();
method public void set(android.location.GnssNavigationMessage);
method public void setData(byte[]);
@@ -20553,14 +20551,19 @@ package android.location {
method public void setStatus(short);
method public void setSubmessageId(short);
method public void setSvid(short);
method public void setType(byte);
method public void setType(short);
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
field public static final byte MESSAGE_TYPE_CNAV2 = 4; // 0x4
field public static final byte MESSAGE_TYPE_L1CA = 1; // 0x1
field public static final byte MESSAGE_TYPE_L2CNAV = 2; // 0x2
field public static final byte MESSAGE_TYPE_L5CNAV = 3; // 0x3
field public static final byte MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short MESSAGE_TYPE_BDS_D1 = 1281; // 0x501
field public static final short MESSAGE_TYPE_BDS_D2 = 1282; // 0x502
field public static final short MESSAGE_TYPE_GAL_F = 1538; // 0x602
field public static final short MESSAGE_TYPE_GAL_I = 1537; // 0x601
field public static final short MESSAGE_TYPE_GLO_L1CA = 769; // 0x301
field public static final short MESSAGE_TYPE_GPS_CNAV2 = 260; // 0x104
field public static final short MESSAGE_TYPE_GPS_L1CA = 257; // 0x101
field public static final short MESSAGE_TYPE_GPS_L2CNAV = 258; // 0x102
field public static final short MESSAGE_TYPE_GPS_L5CNAV = 259; // 0x103
field public static final short MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short STATUS_PARITY_PASSED = 1; // 0x1
field public static final short STATUS_PARITY_REBUILT = 2; // 0x2
field public static final short STATUS_UNKNOWN = 0; // 0x0
@@ -20595,7 +20598,7 @@ package android.location {
public final class GnssStatus {
method public float getAzimuth(int);
method public int getConstellationType(int);
method public byte getConstellationType(int);
method public float getElevation(int);
method public int getNumSatellites();
method public float getSnr(int);
@@ -20603,13 +20606,16 @@ package android.location {
method public boolean hasAlmanac(int);
method public boolean hasEphemeris(int);
method public boolean usedInFix(int);
field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
field public static final int CONSTELLATION_GALILEO = 6; // 0x6
field public static final int CONSTELLATION_GLONASS = 3; // 0x3
field public static final int CONSTELLATION_GPS = 1; // 0x1
field public static final int CONSTELLATION_QZSS = 4; // 0x4
field public static final int CONSTELLATION_SBAS = 2; // 0x2
field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
field public static final byte CONSTELLATION_BEIDOU = 5; // 0x5
field public static final byte CONSTELLATION_GALILEO = 6; // 0x6
field public static final byte CONSTELLATION_GLONASS = 3; // 0x3
field public static final byte CONSTELLATION_GPS = 1; // 0x1
field public static final byte CONSTELLATION_QZSS = 4; // 0x4
field public static final byte CONSTELLATION_SBAS = 2; // 0x2
field public static final byte CONSTELLATION_UNKNOWN = 0; // 0x0
}
public static abstract class GnssStatus.ConstellationType implements java.lang.annotation.Annotation {
}
public abstract class GnssStatusCallback {

View File

@@ -19172,9 +19172,9 @@ package android.location {
method public double getDriftInNsPerSec();
method public double getDriftUncertaintyInNsPerSec();
method public long getFullBiasInNs();
method public int getHardwareClockDiscontinuityCount();
method public short getLeapSecond();
method public long getTimeInNs();
method public long getTimeOfLastHwClockDiscontinuityInNs();
method public double getTimeUncertaintyInNs();
method public byte getType();
method public boolean hasBiasInNs();
@@ -19198,9 +19198,9 @@ package android.location {
method public void setDriftInNsPerSec(double);
method public void setDriftUncertaintyInNsPerSec(double);
method public void setFullBiasInNs(long);
method public void setHardwareClockDiscontinuityCount(int);
method public void setLeapSecond(short);
method public void setTimeInNs(long);
method public void setTimeOfLastHwClockDiscontinuityInNs(long);
method public void setTimeUncertaintyInNs(double);
method public void setType(byte);
method public void writeToParcel(android.os.Parcel, int);
@@ -19228,6 +19228,7 @@ package android.location {
method public double getCn0InDbHz();
method public double getCodePhaseInChips();
method public double getCodePhaseUncertaintyInChips();
method public byte getConstellationType();
method public double getDopplerShiftInHz();
method public double getDopplerShiftUncertaintyInHz();
method public double getElevationInDeg();
@@ -19235,13 +19236,11 @@ package android.location {
method public byte getLossOfLock();
method public byte getMultipathIndicator();
method public double getPseudorangeInMeters();
method public double getPseudorangeRateCarrierInMetersPerSec();
method public double getPseudorangeRateCarrierUncertaintyInMetersPerSec();
method public double getPseudorangeRateInMetersPerSec();
method public double getPseudorangeRateUncertaintyInMetersPerSec();
method public double getPseudorangeUncertaintyInMeters();
method public long getReceivedGpsTowInNs();
method public long getReceivedGpsTowUncertaintyInNs();
method public long getReceivedSvTimeInNs();
method public long getReceivedSvTimeUncertaintyInNs();
method public double getSnrInDb();
method public short getState();
method public short getSvid();
@@ -19298,6 +19297,7 @@ package android.location {
method public void setCn0InDbHz(double);
method public void setCodePhaseInChips(double);
method public void setCodePhaseUncertaintyInChips(double);
method public void setConstellationType(byte);
method public void setDopplerShiftInHz(double);
method public void setDopplerShiftUncertaintyInHz(double);
method public void setElevationInDeg(double);
@@ -19305,13 +19305,11 @@ package android.location {
method public void setLossOfLock(byte);
method public void setMultipathIndicator(byte);
method public void setPseudorangeInMeters(double);
method public void setPseudorangeRateCarrierInMetersPerSec(double);
method public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double);
method public void setPseudorangeRateInMetersPerSec(double);
method public void setPseudorangeRateUncertaintyInMetersPerSec(double);
method public void setPseudorangeUncertaintyInMeters(double);
method public void setReceivedGpsTowInNs(long);
method public void setReceivedGpsTowUncertaintyInNs(long);
method public void setReceivedSvTimeInNs(long);
method public void setReceivedSvTimeUncertaintyInNs(long);
method public void setSnrInDb(double);
method public void setState(short);
method public void setSvid(short);
@@ -19372,7 +19370,7 @@ package android.location {
method public short getStatus();
method public short getSubmessageId();
method public short getSvid();
method public byte getType();
method public short getType();
method public void reset();
method public void set(android.location.GnssNavigationMessage);
method public void setData(byte[]);
@@ -19380,14 +19378,19 @@ package android.location {
method public void setStatus(short);
method public void setSubmessageId(short);
method public void setSvid(short);
method public void setType(byte);
method public void setType(short);
method public void writeToParcel(android.os.Parcel, int);
field public static final android.os.Parcelable.Creator<android.location.GnssNavigationMessage> CREATOR;
field public static final byte MESSAGE_TYPE_CNAV2 = 4; // 0x4
field public static final byte MESSAGE_TYPE_L1CA = 1; // 0x1
field public static final byte MESSAGE_TYPE_L2CNAV = 2; // 0x2
field public static final byte MESSAGE_TYPE_L5CNAV = 3; // 0x3
field public static final byte MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short MESSAGE_TYPE_BDS_D1 = 1281; // 0x501
field public static final short MESSAGE_TYPE_BDS_D2 = 1282; // 0x502
field public static final short MESSAGE_TYPE_GAL_F = 1538; // 0x602
field public static final short MESSAGE_TYPE_GAL_I = 1537; // 0x601
field public static final short MESSAGE_TYPE_GLO_L1CA = 769; // 0x301
field public static final short MESSAGE_TYPE_GPS_CNAV2 = 260; // 0x104
field public static final short MESSAGE_TYPE_GPS_L1CA = 257; // 0x101
field public static final short MESSAGE_TYPE_GPS_L2CNAV = 258; // 0x102
field public static final short MESSAGE_TYPE_GPS_L5CNAV = 259; // 0x103
field public static final short MESSAGE_TYPE_UNKNOWN = 0; // 0x0
field public static final short STATUS_PARITY_PASSED = 1; // 0x1
field public static final short STATUS_PARITY_REBUILT = 2; // 0x2
field public static final short STATUS_UNKNOWN = 0; // 0x0
@@ -19422,7 +19425,7 @@ package android.location {
public final class GnssStatus {
method public float getAzimuth(int);
method public int getConstellationType(int);
method public byte getConstellationType(int);
method public float getElevation(int);
method public int getNumSatellites();
method public float getSnr(int);
@@ -19430,13 +19433,16 @@ package android.location {
method public boolean hasAlmanac(int);
method public boolean hasEphemeris(int);
method public boolean usedInFix(int);
field public static final int CONSTELLATION_BEIDOU = 5; // 0x5
field public static final int CONSTELLATION_GALILEO = 6; // 0x6
field public static final int CONSTELLATION_GLONASS = 3; // 0x3
field public static final int CONSTELLATION_GPS = 1; // 0x1
field public static final int CONSTELLATION_QZSS = 4; // 0x4
field public static final int CONSTELLATION_SBAS = 2; // 0x2
field public static final int CONSTELLATION_UNKNOWN = 0; // 0x0
field public static final byte CONSTELLATION_BEIDOU = 5; // 0x5
field public static final byte CONSTELLATION_GALILEO = 6; // 0x6
field public static final byte CONSTELLATION_GLONASS = 3; // 0x3
field public static final byte CONSTELLATION_GPS = 1; // 0x1
field public static final byte CONSTELLATION_QZSS = 4; // 0x4
field public static final byte CONSTELLATION_SBAS = 2; // 0x2
field public static final byte CONSTELLATION_UNKNOWN = 0; // 0x0
}
public static abstract class GnssStatus.ConstellationType implements java.lang.annotation.Annotation {
}
public abstract class GnssStatusCallback {
@@ -19542,8 +19548,8 @@ package android.location {
method public void clearTestProviderStatus(java.lang.String);
method public java.util.List<java.lang.String> getAllProviders();
method public java.lang.String getBestProvider(android.location.Criteria, boolean);
method public int getGnssYearOfHardware();
method public deprecated android.location.GpsStatus getGpsStatus(android.location.GpsStatus);
method public int getGpsYearOfHardware();
method public android.location.Location getLastKnownLocation(java.lang.String);
method public android.location.LocationProvider getProvider(java.lang.String);
method public java.util.List<java.lang.String> getProviders(boolean);

View File

@@ -73,7 +73,7 @@ public final class GnssClock implements Parcelable {
private double mBiasUncertaintyInNs;
private double mDriftInNsPerSec;
private double mDriftUncertaintyInNsPerSec;
private long mTimeOfLastHwClockDiscontinuityInNs;
private int mHardwareClockDiscontinuityCount;
GnssClock() {
initialize();
@@ -93,7 +93,7 @@ public final class GnssClock implements Parcelable {
mBiasUncertaintyInNs = clock.mBiasUncertaintyInNs;
mDriftInNsPerSec = clock.mDriftInNsPerSec;
mDriftUncertaintyInNsPerSec = clock.mDriftUncertaintyInNsPerSec;
mTimeOfLastHwClockDiscontinuityInNs = clock.mTimeOfLastHwClockDiscontinuityInNs;
mHardwareClockDiscontinuityCount = clock.mHardwareClockDiscontinuityCount;
}
/**
@@ -395,17 +395,17 @@ public final class GnssClock implements Parcelable {
}
/**
* Gets time of last hardware clock discontinuity.
* Gets count of last hardware clock discontinuity.
*/
public long getTimeOfLastHwClockDiscontinuityInNs() {
return mTimeOfLastHwClockDiscontinuityInNs;
public int getHardwareClockDiscontinuityCount() {
return mHardwareClockDiscontinuityCount;
}
/**
* Sets time of last hardware clock discontinuity.
* Sets count of last hardware clock discontinuity.
*/
public void setTimeOfLastHwClockDiscontinuityInNs(long timeOfLastHwClockDiscontinuityInNs) {
mTimeOfLastHwClockDiscontinuityInNs = timeOfLastHwClockDiscontinuityInNs;
public void setHardwareClockDiscontinuityCount(int value) {
mHardwareClockDiscontinuityCount = value;
}
/**
@@ -431,7 +431,7 @@ public final class GnssClock implements Parcelable {
gpsClock.mBiasUncertaintyInNs = parcel.readDouble();
gpsClock.mDriftInNsPerSec = parcel.readDouble();
gpsClock.mDriftUncertaintyInNsPerSec = parcel.readDouble();
gpsClock.mTimeOfLastHwClockDiscontinuityInNs = parcel.readLong();
gpsClock.mHardwareClockDiscontinuityCount = parcel.readInt();
return gpsClock;
}
@@ -442,6 +442,7 @@ public final class GnssClock implements Parcelable {
}
};
@Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(mFlags);
parcel.writeInt(mLeapSecond);
@@ -453,7 +454,7 @@ public final class GnssClock implements Parcelable {
parcel.writeDouble(mBiasUncertaintyInNs);
parcel.writeDouble(mDriftInNsPerSec);
parcel.writeDouble(mDriftUncertaintyInNsPerSec);
parcel.writeLong(mTimeOfLastHwClockDiscontinuityInNs);
parcel.writeInt(mHardwareClockDiscontinuityCount);
}
@Override
@@ -497,9 +498,9 @@ public final class GnssClock implements Parcelable {
"DriftUncertaintyInNsPerSec",
hasDriftUncertaintyInNsPerSec() ? mDriftUncertaintyInNsPerSec : null));
builder.append(String.format(format, "TimeOfLastHwClockDiscontinuityInNs",
builder.append(String.format(format, "HardwareClockDiscontinuityCount",
getType() == CLOCK_TYPE_LOCAL_HW_TIME
? mTimeOfLastHwClockDiscontinuityInNs : null));
? mHardwareClockDiscontinuityCount : null));
return builder.toString();
}
@@ -515,7 +516,7 @@ public final class GnssClock implements Parcelable {
resetBiasUncertaintyInNs();
resetDriftInNsPerSec();
resetDriftUncertaintyInNsPerSec();
setTimeOfLastHwClockDiscontinuityInNs(Long.MIN_VALUE);
setHardwareClockDiscontinuityCount(Integer.MIN_VALUE);
}
private void setFlag(short flag) {

View File

@@ -24,15 +24,16 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* A class representing a GPS satellite measurement, containing raw and computed information.
* A class representing a GNSS satellite measurement, containing raw and computed information.
*/
public final class GnssMeasurement implements Parcelable {
private int mFlags;
private short mSvid;
private byte mConstellationType;
private double mTimeOffsetInNs;
private short mState;
private long mReceivedGpsTowInNs;
private long mReceivedGpsTowUncertaintyInNs;
private long mReceivedSvTimeInNs;
private long mReceivedSvTimeUncertaintyInNs;
private double mCn0InDbHz;
private double mPseudorangeRateInMetersPerSec;
private double mPseudorangeRateUncertaintyInMetersPerSec;
@@ -59,8 +60,6 @@ public final class GnssMeasurement implements Parcelable {
private double mAzimuthInDeg;
private double mAzimuthUncertaintyInDeg;
private boolean mUsedInFix;
private double mPseudorangeRateCarrierInMetersPerSec;
private double mPseudorangeRateCarrierUncertaintyInMetersPerSec;
// The following enumerations must be in sync with the values declared in gps.h
@@ -82,8 +81,8 @@ public final class GnssMeasurement implements Parcelable {
private static final int HAS_TIME_FROM_LAST_BIT = (1<<14);
private static final int HAS_DOPPLER_SHIFT = (1<<15);
private static final int HAS_DOPPLER_SHIFT_UNCERTAINTY = (1<<16);
private static final int HAS_USED_IN_FIX = (1<<17);
private static final int GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE = (1<<18);
// private static final int HAS_USED_IN_FIX = (1<<17);
private static final int HAS_UNCORRECTED_PSEUDORANGE_RATE = (1<<18);
/** The status of 'loss of lock'. */
@Retention(RetentionPolicy.SOURCE)
@@ -127,37 +126,37 @@ public final class GnssMeasurement implements Parcelable {
public static final byte MULTIPATH_INDICATOR_NOT_USED = 2;
/**
* The state of GPS receiver the measurement is invalid or unknown.
* The state of GNSS receiver the measurement is invalid or unknown.
*/
public static final short STATE_UNKNOWN = 0;
/**
* The state of the GPS receiver is ranging code lock.
* The state of the GNSS receiver is ranging code lock.
*/
public static final short STATE_CODE_LOCK = (1<<0);
/**
* The state of the GPS receiver is in bit sync.
* The state of the GNSS receiver is in bit sync.
*/
public static final short STATE_BIT_SYNC = (1<<1);
/**
*The state of the GPS receiver is in sub-frame sync.
*The state of the GNSS receiver is in sub-frame sync.
*/
public static final short STATE_SUBFRAME_SYNC = (1<<2);
/**
* The state of the GPS receiver has TOW decoded.
* The state of the GNSS receiver has TOW decoded.
*/
public static final short STATE_TOW_DECODED = (1<<3);
/**
* The state of the GPS receiver contains millisecond ambiguity.
* The state of the GNSS receiver contains millisecond ambiguity.
*/
public static final short STATE_MSEC_AMBIGUOUS = (1<<4);
/**
* All the GPS receiver state flags.
* All the GNSS receiver state flags.
*/
private static final short STATE_ALL = STATE_CODE_LOCK | STATE_BIT_SYNC | STATE_SUBFRAME_SYNC
| STATE_TOW_DECODED | STATE_MSEC_AMBIGUOUS;
@@ -199,10 +198,11 @@ public final class GnssMeasurement implements Parcelable {
public void set(GnssMeasurement measurement) {
mFlags = measurement.mFlags;
mSvid = measurement.mSvid;
mConstellationType = measurement.mConstellationType;
mTimeOffsetInNs = measurement.mTimeOffsetInNs;
mState = measurement.mState;
mReceivedGpsTowInNs = measurement.mReceivedGpsTowInNs;
mReceivedGpsTowUncertaintyInNs = measurement.mReceivedGpsTowUncertaintyInNs;
mReceivedSvTimeInNs = measurement.mReceivedSvTimeInNs;
mReceivedSvTimeUncertaintyInNs = measurement.mReceivedSvTimeUncertaintyInNs;
mCn0InDbHz = measurement.mCn0InDbHz;
mPseudorangeRateInMetersPerSec = measurement.mPseudorangeRateInMetersPerSec;
mPseudorangeRateUncertaintyInMetersPerSec =
@@ -231,10 +231,6 @@ public final class GnssMeasurement implements Parcelable {
mAzimuthInDeg = measurement.mAzimuthInDeg;
mAzimuthUncertaintyInDeg = measurement.mAzimuthUncertaintyInDeg;
mUsedInFix = measurement.mUsedInFix;
mPseudorangeRateCarrierInMetersPerSec =
measurement.mPseudorangeRateCarrierInMetersPerSec;
mPseudorangeRateCarrierUncertaintyInMetersPerSec =
measurement.mPseudorangeRateCarrierUncertaintyInMetersPerSec;
}
/**
@@ -259,6 +255,21 @@ public final class GnssMeasurement implements Parcelable {
mSvid = value;
}
/**
* Getst the constellation type.
*/
@GnssStatus.ConstellationType
public byte getConstellationType() {
return mConstellationType;
}
/**
* Sets the constellation type.
*/
public void setConstellationType(@GnssStatus.ConstellationType byte value) {
mConstellationType = value;
}
/**
* Gets the time offset at which the measurement was taken in nanoseconds.
* The reference receiver's time is specified by {@link GnssClock#getTimeInNs()} and should be
@@ -285,7 +296,7 @@ public final class GnssMeasurement implements Parcelable {
* Gets per-satellite sync state.
* It represents the current sync state for the associated satellite.
*
* This value helps interpret {@link #getReceivedGpsTowInNs()}.
* This value helps interpret {@link #getReceivedSvTimeInNs()}.
*/
public short getState() {
return mState;
@@ -333,39 +344,92 @@ public final class GnssMeasurement implements Parcelable {
}
/**
* Gets the received GPS Time-of-Week at the measurement time, in nanoseconds.
* The value is relative to the beginning of the current GPS week.
* Gets the received GNSS satellite time, at the measurement time, in nanoseconds.
*
* Given {@link #getState()} of the GPS receiver, the range of this field can be:
* Searching : [ 0 ] : {@link #STATE_UNKNOWN} is set
* Ranging code lock : [ 0 1 ms ] : {@link #STATE_CODE_LOCK} is set
* Bit sync : [ 0 20 ms ] : {@link #STATE_BIT_SYNC} is set
* Subframe sync : [ 0 6 ms ] : {@link #STATE_SUBFRAME_SYNC} is set
* TOW decoded : [ 0 1 week ] : {@link #STATE_TOW_DECODED} is set
* For GPS &amp; QZSS, this is:
* Received GPS Time-of-Week at the measurement time, in nanoseconds.
* The value is relative to the beginning of the current GPS week.
*
* Given the highest sync state that can be achieved, per each satellite, valid range
* for this field can be:
* Searching : [ 0 ] : STATE_UNKNOWN
* C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK is set
* Bit sync : [ 0 20ms ] : STATE_BIT_SYNC is set
* Subframe sync : [ 0 6s ] : STATE_SUBFRAME_SYNC is set
* TOW decoded : [ 0 1week ] : STATE_TOW_DECODED is set
*
* Note well: if there is any ambiguity in integer millisecond,
* STATE_MSEC_AMBIGUOUS should be set accordingly, in the 'state' field.
*
* This value must be populated if 'state' != STATE_UNKNOWN.
*
* For Glonass, this is:
* Received Glonass time of day, at the measurement time in nanoseconds.
*
* Given the highest sync state that can be achieved, per each satellite, valid range for
* this field can be:
* Searching : [ 0 ] : STATE_UNKNOWN
* C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK is set
* Symbol sync : [ 0 10ms ] : STATE_SYMBOL_SYNC is set
* Bit sync : [ 0 20ms ] : STATE_BIT_SYNC is set
* String sync : [ 0 2s ] : STATE_GLO_STRING_SYNC is set
* Time of day : [ 0 1day ] : STATE_GLO_TOD_DECODED is set
*
* For Beidou, this is:
* Received Beidou time of week, at the measurement time in nanoseconds.
*
* Given the highest sync state that can be achieved, per each satellite, valid range for
* this field can be:
* Searching : [ 0 ] : STATE_UNKNOWN
* C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK is set
* Bit sync (D2) : [ 0 2ms ] : STATE_BDS_D2_BIT_SYNC is set
* Bit sync (D1) : [ 0 20ms ] : STATE_BIT_SYNC is set
* Subframe (D2) : [ 0 0.6s ] : STATE_BDS_D2_SUBFRAME_SYNC is set
* Subframe (D1) : [ 0 6s ] : STATE_SUBFRAME_SYNC is set
* Time of week : [ 0 1week ] : STATE_TOW_DECODED is set
*
* For Galileo, this is:
* Received Galileo time of week, at the measurement time in nanoseconds.
*
* E1BC code lock : [ 0 4ms ] : STATE_GAL_E1BC_CODE_LOCK is set
* E1C 2nd code lock : [ 0 100ms ] : STATE_GAL_E1C_2ND_CODE_LOCK is set
*
* E1B page : [ 0 2s ] : STATE_GAL_E1B_PAGE_SYNC is set
* Time of week : [ 0 1week ] : STATE_GAL_TOW_DECODED is set
*
* For SBAS, this is:
* Received SBAS time, at the measurement time in nanoseconds.
*
* Given the highest sync state that can be achieved, per each satellite, valid range for
* this field can be:
* Searching : [ 0 ] : STATE_UNKNOWN
* C/A code lock : [ 0 1ms ] : STATE_CODE_LOCK is set
* Symbol sync : [ 0 2ms ] : STATE_SYMBOL_SYNC is set
* Message : [ 0 1s ] : STATE_SBAS_SYNC is set
*/
public long getReceivedGpsTowInNs() {
return mReceivedGpsTowInNs;
public long getReceivedSvTimeInNs() {
return mReceivedSvTimeInNs;
}
/**
* Sets the received GPS time-of-week in nanoseconds.
* Sets the received GNSS time in nanoseconds.
*/
public void setReceivedGpsTowInNs(long value) {
mReceivedGpsTowInNs = value;
public void setReceivedSvTimeInNs(long value) {
mReceivedSvTimeInNs = value;
}
/**
* Gets the received GPS time-of-week's uncertainty (1-Sigma) in nanoseconds.
* Gets the received GNSS time uncertainty (1-Sigma) in nanoseconds.
*/
public long getReceivedGpsTowUncertaintyInNs() {
return mReceivedGpsTowUncertaintyInNs;
public long getReceivedSvTimeUncertaintyInNs() {
return mReceivedSvTimeUncertaintyInNs;
}
/**
* Sets the received GPS time-of-week's uncertainty (1-Sigma) in nanoseconds.
* Sets the received GNSS time uncertainty (1-Sigma) in nanoseconds.
*/
public void setReceivedGpsTowUncertaintyInNs(long value) {
mReceivedGpsTowUncertaintyInNs = value;
public void setReceivedSvTimeUncertaintyInNs(long value) {
mReceivedSvTimeUncertaintyInNs = value;
}
/**
@@ -416,7 +480,7 @@ public final class GnssMeasurement implements Parcelable {
* value, {@code false} if it contains an uncorrected value.
*/
public boolean isPseudorangeRateCorrected() {
return !isFlagSet(GPS_MEASUREMENT_HAS_UNCORRECTED_PSEUDORANGE_RATE);
return !isFlagSet(HAS_UNCORRECTED_PSEUDORANGE_RATE);
}
/**
@@ -1160,7 +1224,7 @@ public final class GnssMeasurement implements Parcelable {
}
/**
* Gets a flag indicating whether the GPS represented by the measurement was used for computing
* Gets a flag indicating whether the GNSS represented by the measurement was used for computing
* the most recent fix.
*
* @return A non-null value if the data is available, null otherwise.
@@ -1176,34 +1240,6 @@ public final class GnssMeasurement implements Parcelable {
mUsedInFix = value;
}
/**
* Gets pseudorange rate (based on carrier phase changes) at the timestamp in m/s.
*/
public double getPseudorangeRateCarrierInMetersPerSec() {
return mPseudorangeRateCarrierInMetersPerSec;
}
/**
* Sets pseudorange rate (based on carrier phase changes) at the timestamp in m/s.
*/
public void setPseudorangeRateCarrierInMetersPerSec(double value) {
mPseudorangeRateCarrierInMetersPerSec = value;
}
/**
* Gets 1-Sigma uncertainty of the pseudorange rate carrier.
*/
public double getPseudorangeRateCarrierUncertaintyInMetersPerSec() {
return mPseudorangeRateCarrierUncertaintyInMetersPerSec;
}
/**
* Sets 1-Sigma uncertainty of the pseudorange rate carrier.
*/
public void setPseudorangeRateCarrierUncertaintyInMetersPerSec(double value) {
mPseudorangeRateCarrierUncertaintyInMetersPerSec = value;
}
public static final Creator<GnssMeasurement> CREATOR = new Creator<GnssMeasurement>() {
@Override
public GnssMeasurement createFromParcel(Parcel parcel) {
@@ -1211,10 +1247,11 @@ public final class GnssMeasurement implements Parcelable {
gnssMeasurement.mFlags = parcel.readInt();
gnssMeasurement.mSvid = (short) parcel.readInt();
gnssMeasurement.mConstellationType = parcel.readByte();
gnssMeasurement.mTimeOffsetInNs = parcel.readDouble();
gnssMeasurement.mState = (short) parcel.readInt();
gnssMeasurement.mReceivedGpsTowInNs = parcel.readLong();
gnssMeasurement.mReceivedGpsTowUncertaintyInNs = parcel.readLong();
gnssMeasurement.mReceivedSvTimeInNs = parcel.readLong();
gnssMeasurement.mReceivedSvTimeUncertaintyInNs = parcel.readLong();
gnssMeasurement.mCn0InDbHz = parcel.readDouble();
gnssMeasurement.mPseudorangeRateInMetersPerSec = parcel.readDouble();
gnssMeasurement.mPseudorangeRateUncertaintyInMetersPerSec = parcel.readDouble();
@@ -1241,8 +1278,6 @@ public final class GnssMeasurement implements Parcelable {
gnssMeasurement.mAzimuthInDeg = parcel.readDouble();
gnssMeasurement.mAzimuthUncertaintyInDeg = parcel.readDouble();
gnssMeasurement.mUsedInFix = parcel.readInt() != 0;
gnssMeasurement.mPseudorangeRateCarrierInMetersPerSec = parcel.readDouble();
gnssMeasurement.mPseudorangeRateCarrierUncertaintyInMetersPerSec = parcel.readDouble();
return gnssMeasurement;
}
@@ -1257,10 +1292,11 @@ public final class GnssMeasurement implements Parcelable {
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeInt(mFlags);
parcel.writeInt(mSvid);
parcel.writeByte(mConstellationType);
parcel.writeDouble(mTimeOffsetInNs);
parcel.writeInt(mState);
parcel.writeLong(mReceivedGpsTowInNs);
parcel.writeLong(mReceivedGpsTowUncertaintyInNs);
parcel.writeLong(mReceivedSvTimeInNs);
parcel.writeLong(mReceivedSvTimeUncertaintyInNs);
parcel.writeDouble(mCn0InDbHz);
parcel.writeDouble(mPseudorangeRateInMetersPerSec);
parcel.writeDouble(mPseudorangeRateUncertaintyInMetersPerSec);
@@ -1287,8 +1323,6 @@ public final class GnssMeasurement implements Parcelable {
parcel.writeDouble(mAzimuthInDeg);
parcel.writeDouble(mAzimuthUncertaintyInDeg);
parcel.writeInt(mUsedInFix ? 1 : 0);
parcel.writeDouble(mPseudorangeRateCarrierInMetersPerSec);
parcel.writeDouble(mPseudorangeRateCarrierUncertaintyInMetersPerSec);
}
@Override
@@ -1303,17 +1337,17 @@ public final class GnssMeasurement implements Parcelable {
StringBuilder builder = new StringBuilder("GnssMeasurement:\n");
builder.append(String.format(format, "Svid", mSvid));
builder.append(String.format(format, "ConstellationType", mConstellationType));
builder.append(String.format(format, "TimeOffsetInNs", mTimeOffsetInNs));
builder.append(String.format(format, "State", getStateString()));
builder.append(String.format(
formatWithUncertainty,
"ReceivedGpsTowInNs",
mReceivedGpsTowInNs,
"ReceivedGpsTowUncertaintyInNs",
mReceivedGpsTowUncertaintyInNs));
"ReceivedSvTimeInNs",
mReceivedSvTimeInNs,
"ReceivedSvTimeUncertaintyInNs",
mReceivedSvTimeUncertaintyInNs));
builder.append(String.format(format, "Cn0InDbHz", mCn0InDbHz));
@@ -1413,11 +1447,6 @@ public final class GnssMeasurement implements Parcelable {
builder.append(String.format(format, "UsedInFix", mUsedInFix));
builder.append(String.format(format, "PseudorangeRateCarrierInMetersPerSec",
mPseudorangeRateCarrierInMetersPerSec));
builder.append(String.format(format, "PseudorangeRateCarrierUncertaintyInMetersPerSec",
mPseudorangeRateCarrierUncertaintyInMetersPerSec));
return builder.toString();
}
@@ -1426,8 +1455,8 @@ public final class GnssMeasurement implements Parcelable {
setSvid((short) 0);
setTimeOffsetInNs(Long.MIN_VALUE);
setState(STATE_UNKNOWN);
setReceivedGpsTowInNs(Long.MIN_VALUE);
setReceivedGpsTowUncertaintyInNs(Long.MAX_VALUE);
setReceivedSvTimeInNs(Long.MIN_VALUE);
setReceivedSvTimeUncertaintyInNs(Long.MAX_VALUE);
setCn0InDbHz(Double.MIN_VALUE);
setPseudorangeRateInMetersPerSec(Double.MIN_VALUE);
setPseudorangeRateUncertaintyInMetersPerSec(Double.MIN_VALUE);
@@ -1454,8 +1483,6 @@ public final class GnssMeasurement implements Parcelable {
resetAzimuthInDeg();
resetAzimuthUncertaintyInDeg();
setUsedInFix(false);
setPseudorangeRateCarrierInMetersPerSec(Double.MIN_VALUE);
setPseudorangeRateCarrierUncertaintyInMetersPerSec(Double.MIN_VALUE);
}
private void setFlag(int flag) {

View File

@@ -34,36 +34,33 @@ public final class GnssNavigationMessage implements Parcelable {
/** The type of the GPS Clock. */
@Retention(RetentionPolicy.SOURCE)
@IntDef({MESSAGE_TYPE_UNKNOWN, MESSAGE_TYPE_L1CA, MESSAGE_TYPE_L2CNAV, MESSAGE_TYPE_L5CNAV,
MESSAGE_TYPE_CNAV2})
@IntDef({MESSAGE_TYPE_UNKNOWN, MESSAGE_TYPE_GPS_L1CA, MESSAGE_TYPE_GPS_L2CNAV,
MESSAGE_TYPE_GPS_L5CNAV, MESSAGE_TYPE_GPS_CNAV2, MESSAGE_TYPE_GLO_L1CA, MESSAGE_TYPE_BDS_D1,
MESSAGE_TYPE_BDS_D2, MESSAGE_TYPE_GAL_I, MESSAGE_TYPE_GAL_F})
public @interface GnssNavigationMessageType {}
// The following enumerations must be in sync with the values declared in gps.h
/**
* The type of the navigation message is not available or unknown.
*/
public static final byte MESSAGE_TYPE_UNKNOWN = 0;
/**
* The Navigation Message is of type L1 C/A.
*/
public static final byte MESSAGE_TYPE_L1CA = 1;
/**
* The Navigation Message is of type L1-CNAV.
*/
public static final byte MESSAGE_TYPE_L2CNAV = 2;
/**
* The Navigation Message is of type L5-CNAV.
*/
public static final byte MESSAGE_TYPE_L5CNAV = 3;
/**
* The Navigation Message is of type CNAV-2.
*/
public static final byte MESSAGE_TYPE_CNAV2 = 4;
/** Message type unknown */
public static final short MESSAGE_TYPE_UNKNOWN = 0;
/** GPS L1 C/A message contained in the structure. */
public static final short MESSAGE_TYPE_GPS_L1CA = 0x0101;
/** GPS L2-CNAV message contained in the structure. */
public static final short MESSAGE_TYPE_GPS_L2CNAV = 0x0102;
/** GPS L5-CNAV message contained in the structure. */
public static final short MESSAGE_TYPE_GPS_L5CNAV = 0x0103;
/** GPS CNAV-2 message contained in the structure. */
public static final short MESSAGE_TYPE_GPS_CNAV2 = 0x0104;
/** Glonass L1 CA message contained in the structure. */
public static final short MESSAGE_TYPE_GLO_L1CA = 0x0301;
/** Beidou D1 message contained in the structure. */
public static final short MESSAGE_TYPE_BDS_D1 = 0x0501;
/** Beidou D2 message contained in the structure. */
public static final short MESSAGE_TYPE_BDS_D2 = 0x0502;
/** Galileo I/NAV message contained in the structure. */
public static final short MESSAGE_TYPE_GAL_I = 0x0601;
/** Galileo F/NAV message contained in the structure. */
public static final short MESSAGE_TYPE_GAL_F = 0x0602;
/**
* The Navigation Message Status is 'unknown'.
@@ -83,7 +80,7 @@ public final class GnssNavigationMessage implements Parcelable {
// End enumerations in sync with gps.h
private byte mType;
private short mType;
private short mSvid;
private short mMessageId;
private short mSubmessageId;
@@ -117,14 +114,14 @@ public final class GnssNavigationMessage implements Parcelable {
* Gets the type of the navigation message contained in the object.
*/
@GnssNavigationMessageType
public byte getType() {
public short getType() {
return mType;
}
/**
* Sets the type of the navigation message.
*/
public void setType(@GnssNavigationMessageType byte value) {
public void setType(@GnssNavigationMessageType short value) {
mType = value;
}
@@ -136,14 +133,24 @@ public final class GnssNavigationMessage implements Parcelable {
switch (mType) {
case MESSAGE_TYPE_UNKNOWN:
return "Unknown";
case MESSAGE_TYPE_L1CA:
return "L1 C/A";
case MESSAGE_TYPE_L2CNAV:
return "L2-CNAV";
case MESSAGE_TYPE_L5CNAV:
return "L5-CNAV";
case MESSAGE_TYPE_CNAV2:
return "CNAV-2";
case MESSAGE_TYPE_GPS_L1CA:
return "GPS L1 C/A";
case MESSAGE_TYPE_GPS_L2CNAV:
return "GPS L2-CNAV";
case MESSAGE_TYPE_GPS_L5CNAV:
return "GPS L5-CNAV";
case MESSAGE_TYPE_GPS_CNAV2:
return "GPS CNAV2";
case MESSAGE_TYPE_GLO_L1CA:
return "Glonass L1 C/A";
case MESSAGE_TYPE_BDS_D1:
return "Beidou D1";
case MESSAGE_TYPE_BDS_D2:
return "Beidou D2";
case MESSAGE_TYPE_GAL_I:
return "Galileo I";
case MESSAGE_TYPE_GAL_F:
return "Galileo F";
default:
return "<Invalid:" + mType + ">";
}
@@ -255,7 +262,7 @@ public final class GnssNavigationMessage implements Parcelable {
public GnssNavigationMessage createFromParcel(Parcel parcel) {
GnssNavigationMessage navigationMessage = new GnssNavigationMessage();
navigationMessage.setType(parcel.readByte());
navigationMessage.setType((short) parcel.readInt());
navigationMessage.setSvid((short) parcel.readInt());
navigationMessage.setMessageId((short) parcel.readInt());
navigationMessage.setSubmessageId((short) parcel.readInt());
@@ -283,7 +290,7 @@ public final class GnssNavigationMessage implements Parcelable {
@Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeByte(mType);
parcel.writeInt(mType);
parcel.writeInt(mSvid);
parcel.writeInt(mMessageId);
parcel.writeInt(mSubmessageId);

View File

@@ -16,25 +16,36 @@
package android.location;
import android.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* This class represents the current state of the GNSS engine.
* This class is used in conjunction with the {@link GnssStatusCallback}.
*/
public final class GnssStatus {
/** Unknown constellation type. */
public static final int CONSTELLATION_UNKNOWN = 0;
public static final byte CONSTELLATION_UNKNOWN = 0;
/** Constellation type constant for GPS. */
public static final int CONSTELLATION_GPS = 1;
public static final byte CONSTELLATION_GPS = 1;
/** Constellation type constant for SBAS. */
public static final int CONSTELLATION_SBAS = 2;
public static final byte CONSTELLATION_SBAS = 2;
/** Constellation type constant for Glonass. */
public static final int CONSTELLATION_GLONASS = 3;
public static final byte CONSTELLATION_GLONASS = 3;
/** Constellation type constant for QZSS. */
public static final int CONSTELLATION_QZSS = 4;
public static final byte CONSTELLATION_QZSS = 4;
/** Constellation type constant for Beidou. */
public static final int CONSTELLATION_BEIDOU = 5;
public static final byte CONSTELLATION_BEIDOU = 5;
/** Constellation type constant for Galileo. */
public static final int CONSTELLATION_GALILEO = 6;
public static final byte CONSTELLATION_GALILEO = 6;
/** Constellation type. */
@Retention(RetentionPolicy.SOURCE)
@IntDef({CONSTELLATION_UNKNOWN, CONSTELLATION_GPS, CONSTELLATION_SBAS, CONSTELLATION_GLONASS,
CONSTELLATION_QZSS, CONSTELLATION_BEIDOU, CONSTELLATION_GALILEO})
public @interface ConstellationType {}
// these must match the definitions in gps.h
/** @hide */
@@ -80,9 +91,10 @@ public final class GnssStatus {
* Retrieves the constellation type of the satellite at the specified position.
* @param satIndex the index of the satellite in the list.
*/
public int getConstellationType(int satIndex) {
return (mSvidWithFlags[satIndex] >> CONSTELLATION_TYPE_SHIFT_WIDTH)
& CONSTELLATION_TYPE_MASK;
@ConstellationType
public byte getConstellationType(int satIndex) {
return (byte) ((mSvidWithFlags[satIndex] >> CONSTELLATION_TYPE_SHIFT_WIDTH)
& CONSTELLATION_TYPE_MASK);
}
/**

View File

@@ -147,7 +147,6 @@ public final class GpsStatus {
& GnssStatus.CONSTELLATION_TYPE_MASK;
// Skip all non-GPS satellites.
if (constellationType != GnssStatus.CONSTELLATION_GPS) {
// TODO: translate the defacto pre-N use of prn's >32 to new struct
continue;
}
int prn = svidWithFlags[i] >> GnssStatus.SVID_SHIFT_WIDTH;

View File

@@ -69,7 +69,7 @@ interface ILocationManager
in String packageName);
void removeGnssNavigationMessageListener(in IGnssNavigationMessageListener listener);
int getGpsYearOfHardware();
int getGnssYearOfHardware();
// --- deprecated ---
List<String> getAllProviders();

View File

@@ -1959,11 +1959,11 @@ public class LocationManager {
* @hide
*/
@TestApi
public int getGpsYearOfHardware() {
public int getGnssYearOfHardware() {
try {
return mService.getGpsYearOfHardware();
return mService.getGnssYearOfHardware();
} catch (RemoteException e) {
Log.e(TAG, "RemoteException in getGpsSystemInfo: ", e);
Log.e(TAG, "RemoteException in getGnssSystemInfo: ", e);
return 0;
}
}

View File

@@ -214,7 +214,7 @@ public class LocationManagerService extends ILocationManager.Stub {
private int mCurrentUserId = UserHandle.USER_SYSTEM;
private int[] mCurrentUserProfiles = new int[] { UserHandle.USER_SYSTEM };
private GnssLocationProvider.GpsSystemInfoProvider mGpsSystemInfoProvider;
private GnssLocationProvider.GnssSystemInfoProvider mGnssSystemInfoProvider;
public LocationManagerService(Context context) {
super();
@@ -462,7 +462,7 @@ public class LocationManagerService extends ILocationManager.Stub {
// Create a gps location provider
GnssLocationProvider gnssProvider = new GnssLocationProvider(mContext, this,
mLocationHandler.getLooper());
mGpsSystemInfoProvider = gnssProvider.getGpsSystemInfoProvider();
mGnssSystemInfoProvider = gnssProvider.getGnssSystemInfoProvider();
mGnssStatusProvider = gnssProvider.getGnssStatusProvider();
mNetInitiatedListener = gnssProvider.getNetInitiatedListener();
addProviderLocked(gnssProvider);
@@ -990,12 +990,12 @@ public class LocationManagerService extends ILocationManager.Stub {
}
/**
* Returns the system information of the GPS hardware.
* Returns the system information of the GNSS hardware.
*/
@Override
public int getGpsYearOfHardware() {
public int getGnssYearOfHardware() {
if (mGnssNavigationMessageProvider != null) {
return mGpsSystemInfoProvider.getGpsYearOfHardware();
return mGnssSystemInfoProvider.getGnssYearOfHardware();
} else {
return 0;
}

View File

@@ -1684,25 +1684,25 @@ public class GnssLocationProvider implements LocationProviderInterface {
/**
* Called from native code to inform us the hardware information.
*/
private void setGpsYearOfHardware(int yearOfHardware) {
if (DEBUG) Log.d(TAG, "setGpsYearOfHardware called with " + yearOfHardware);
private void setGnssYearOfHardware(int yearOfHardware) {
if (DEBUG) Log.d(TAG, "setGnssYearOfHardware called with " + yearOfHardware);
mYearOfHardware = yearOfHardware;
}
public interface GpsSystemInfoProvider {
public interface GnssSystemInfoProvider {
/**
* Returns the year of GPS hardware.
*/
int getGpsYearOfHardware();
int getGnssYearOfHardware();
}
/**
* @hide
*/
public GpsSystemInfoProvider getGpsSystemInfoProvider() {
return new GpsSystemInfoProvider() {
public GnssSystemInfoProvider getGnssSystemInfoProvider() {
return new GnssSystemInfoProvider() {
@Override
public int getGpsYearOfHardware() {
public int getGnssYearOfHardware() {
return mYearOfHardware;
}
};

View File

@@ -42,7 +42,7 @@ static jmethodID method_reportSvStatus;
static jmethodID method_reportAGpsStatus;
static jmethodID method_reportNmea;
static jmethodID method_setEngineCapabilities;
static jmethodID method_setGpsYearOfHardware;
static jmethodID method_setGnssYearOfHardware;
static jmethodID method_xtraDownloadRequest;
static jmethodID method_reportNiNotification;
static jmethodID method_requestRefLocation;
@@ -133,11 +133,10 @@ static void sv_status_callback(GpsSvStatus* sv_status)
for (size_t i = 0; i < sGnssSvListSize; i++) {
GnssSvInfo& info = sGnssSvList[i];
info.svid = sv_status->sv_list[i].prn;
// TODO: implement the correct logic to derive the constellation type
// based on PRN ranges.
if (info.svid >=1 && info.svid <= 32) {
info.constellation = GNSS_CONSTELLATION_GPS;
} else {
ALOGD("Unknown constellation type with Svid = %d.", info.svid);
info.constellation = GNSS_CONSTELLATION_UNKNOWN;
}
info.snr = sv_status->sv_list[i].snr;
@@ -198,10 +197,10 @@ static void nmea_callback(GpsUtcTime timestamp, const char* nmea, int length)
checkAndClearExceptionFromCallback(env, __FUNCTION__);
}
static void set_system_info_callback(const GpsSystemInfo* info) {
static void set_system_info_callback(const GnssSystemInfo* info) {
ALOGD("set_system_info_callback: year_of_hw=%d\n", info->year_of_hw);
JNIEnv* env = AndroidRuntime::getJNIEnv();
env->CallVoidMethod(mCallbacksObj, method_setGpsYearOfHardware,
env->CallVoidMethod(mCallbacksObj, method_setGnssYearOfHardware,
info->year_of_hw);
checkAndClearExceptionFromCallback(env, __FUNCTION__);
}
@@ -536,7 +535,7 @@ static void android_location_GnssLocationProvider_class_init_native(JNIEnv* env,
method_reportAGpsStatus = env->GetMethodID(clazz, "reportAGpsStatus", "(II[B)V");
method_reportNmea = env->GetMethodID(clazz, "reportNmea", "(J)V");
method_setEngineCapabilities = env->GetMethodID(clazz, "setEngineCapabilities", "(I)V");
method_setGpsYearOfHardware = env->GetMethodID(clazz, "setGpsYearOfHardware", "(I)V");
method_setGnssYearOfHardware = env->GetMethodID(clazz, "setGnssYearOfHardware", "(I)V");
method_xtraDownloadRequest = env->GetMethodID(clazz, "xtraDownloadRequest", "()V");
method_reportNiNotification = env->GetMethodID(clazz, "reportNiNotification",
"(IIIIILjava/lang/String;Ljava/lang/String;IILjava/lang/String;)V");
@@ -1074,7 +1073,9 @@ const char *const JavaMethodHelper<int16_t>::signature_ = "(S)V";
template<>
const char *const JavaMethodHelper<uint16_t>::signature_ = "(S)V";
template<>
const char *const JavaMethodHelper<int>::signature_ = "(I)V";
const char *const JavaMethodHelper<int32_t>::signature_ = "(I)V";
template<>
const char *const JavaMethodHelper<uint32_t>::signature_ = "(I)V";
template<>
const char *const JavaMethodHelper<int64_t>::signature_ = "(J)V";
template<>
@@ -1092,36 +1093,22 @@ static jobject translate_gps_clock(JNIEnv* env, GpsClock* clock) {
JavaObject object(env, "android/location/GnssClock");
GpsClockFlags flags = clock->flags;
SET_IF(GPS_CLOCK_HAS_LEAP_SECOND, LeapSecond, clock->leap_second);
SET_IF(GNSS_CLOCK_HAS_LEAP_SECOND, LeapSecond, clock->leap_second);
SET(Type, clock->type);
SET(TimeInNs, clock->time_ns);
SET_IF(GPS_CLOCK_HAS_TIME_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_TIME_UNCERTAINTY,
TimeUncertaintyInNs,
clock->time_uncertainty_ns);
SET_IF(GPS_CLOCK_HAS_FULL_BIAS, FullBiasInNs, clock->full_bias_ns);
SET_IF(GPS_CLOCK_HAS_BIAS, BiasInNs, clock->bias_ns);
SET_IF(GPS_CLOCK_HAS_BIAS_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_FULL_BIAS, FullBiasInNs, clock->full_bias_ns);
SET_IF(GNSS_CLOCK_HAS_BIAS, BiasInNs, clock->bias_ns);
SET_IF(GNSS_CLOCK_HAS_BIAS_UNCERTAINTY,
BiasUncertaintyInNs,
clock->bias_uncertainty_ns);
SET_IF(GPS_CLOCK_HAS_DRIFT, DriftInNsPerSec, clock->drift_nsps);
SET_IF(GPS_CLOCK_HAS_DRIFT_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_DRIFT, DriftInNsPerSec, clock->drift_nsps);
SET_IF(GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY,
DriftUncertaintyInNsPerSec,
clock->drift_uncertainty_nsps);
/*
if (flags & GPS_CLOCK_TYPE_LOCAL_HW_TIME) {
if (size == sizeof(GnssClock)) {
jmethodID setterMethod =
env->GetMethodID(gpsClockClass,
"setTimeOfLastHwClockDiscontinuityInNs",
longSignature);
env->CallVoidMethod(gpsClockObject,
setterMethod,
reinterpret_cast<GnssClock*>(clock)->time_of_last_hw_clock_discontinuity_ns);
}
}
*/
return object.get();
}
@@ -1129,25 +1116,23 @@ static jobject translate_gnss_clock(JNIEnv* env, GnssClock* clock) {
JavaObject object(env, "android/location/GnssClock");
GpsClockFlags flags = clock->flags;
SET_IF(GPS_CLOCK_HAS_LEAP_SECOND, LeapSecond, clock->leap_second);
SET(Type, clock->type);
SET_IF(GNSS_CLOCK_HAS_LEAP_SECOND, LeapSecond, clock->leap_second);
SET(Type, static_cast<uint8_t>(GPS_CLOCK_TYPE_LOCAL_HW_TIME));
SET(TimeInNs, clock->time_ns);
SET_IF(GPS_CLOCK_HAS_TIME_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_TIME_UNCERTAINTY,
TimeUncertaintyInNs,
clock->time_uncertainty_ns);
SET_IF(GPS_CLOCK_HAS_FULL_BIAS, FullBiasInNs, clock->full_bias_ns);
SET_IF(GPS_CLOCK_HAS_BIAS, BiasInNs, clock->bias_ns);
SET_IF(GPS_CLOCK_HAS_BIAS_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_FULL_BIAS, FullBiasInNs, clock->full_bias_ns);
SET_IF(GNSS_CLOCK_HAS_BIAS, BiasInNs, clock->bias_ns);
SET_IF(GNSS_CLOCK_HAS_BIAS_UNCERTAINTY,
BiasUncertaintyInNs,
clock->bias_uncertainty_ns);
SET_IF(GPS_CLOCK_HAS_DRIFT, DriftInNsPerSec, clock->drift_nsps);
SET_IF(GPS_CLOCK_HAS_DRIFT_UNCERTAINTY,
SET_IF(GNSS_CLOCK_HAS_DRIFT, DriftInNsPerSec, clock->drift_nsps);
SET_IF(GNSS_CLOCK_HAS_DRIFT_UNCERTAINTY,
DriftUncertaintyInNsPerSec,
clock->drift_uncertainty_nsps);
SET_IF(GPS_CLOCK_TYPE_LOCAL_HW_TIME,
TimeOfLastHwClockDiscontinuityInNs,
clock->time_of_last_hw_clock_discontinuity_ns);
SET(HardwareClockDiscontinuityCount, clock->hw_clock_discontinuity_count);
return object.get();
}
@@ -1156,12 +1141,18 @@ static jobject translate_gps_measurement(JNIEnv* env,
GpsMeasurement* measurement) {
JavaObject object(env, "android/location/GnssMeasurement");
GpsMeasurementFlags flags = measurement->flags;
SET(Svid, static_cast<int16_t>(measurement->prn));
if (measurement->prn >= 1 || measurement->prn <= 32) {
SET(ConstellationType, static_cast<uint8_t>(GNSS_CONSTELLATION_GPS));
} else {
ALOGD("Unknown constellation type with Svid = %d.", measurement->prn);
SET(ConstellationType,
static_cast<uint8_t>(GNSS_CONSTELLATION_UNKNOWN));
}
SET(TimeOffsetInNs, measurement->time_offset_ns);
SET(State, measurement->state);
SET(ReceivedGpsTowInNs, measurement->received_gps_tow_ns);
SET(ReceivedGpsTowUncertaintyInNs,
SET(ReceivedSvTimeInNs, measurement->received_gps_tow_ns);
SET(ReceivedSvTimeUncertaintyInNs,
measurement->received_gps_tow_uncertainty_ns);
SET(Cn0InDbHz, measurement->c_n0_dbhz);
SET(PseudorangeRateInMetersPerSec, measurement->pseudorange_rate_mps);
@@ -1171,57 +1162,57 @@ static jobject translate_gps_measurement(JNIEnv* env,
SET(AccumulatedDeltaRangeInMeters, measurement->accumulated_delta_range_m);
SET(AccumulatedDeltaRangeUncertaintyInMeters,
measurement->accumulated_delta_range_uncertainty_m);
SET_IF(GPS_MEASUREMENT_HAS_PSEUDORANGE,
SET_IF(GNSS_MEASUREMENT_HAS_PSEUDORANGE,
PseudorangeInMeters,
measurement->pseudorange_m);
SET_IF(GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY,
PseudorangeUncertaintyInMeters,
measurement->pseudorange_uncertainty_m);
SET_IF(GPS_MEASUREMENT_HAS_CODE_PHASE,
SET_IF(GNSS_MEASUREMENT_HAS_CODE_PHASE,
CodePhaseInChips,
measurement->code_phase_chips);
SET_IF(GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY,
CodePhaseUncertaintyInChips,
measurement->code_phase_uncertainty_chips);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY,
CarrierFrequencyInHz,
measurement->carrier_frequency_hz);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_CYCLES,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_CYCLES,
CarrierCycles,
measurement->carrier_cycles);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_PHASE,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_PHASE,
CarrierPhase,
measurement->carrier_phase);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY,
CarrierPhaseUncertainty,
measurement->carrier_phase_uncertainty);
SET(LossOfLock, measurement->loss_of_lock);
SET_IF(GPS_MEASUREMENT_HAS_BIT_NUMBER, BitNumber, measurement->bit_number);
SET_IF(GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT,
SET_IF(GNSS_MEASUREMENT_HAS_BIT_NUMBER, BitNumber, measurement->bit_number);
SET_IF(GNSS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT,
TimeFromLastBitInMs,
measurement->time_from_last_bit_ms);
SET_IF(GPS_MEASUREMENT_HAS_DOPPLER_SHIFT,
SET_IF(GNSS_MEASUREMENT_HAS_DOPPLER_SHIFT,
DopplerShiftInHz,
measurement->doppler_shift_hz);
SET_IF(GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY,
DopplerShiftUncertaintyInHz,
measurement->doppler_shift_uncertainty_hz);
SET(MultipathIndicator, measurement->multipath_indicator);
SET_IF(GPS_MEASUREMENT_HAS_SNR, SnrInDb, measurement->snr_db);
SET_IF(GPS_MEASUREMENT_HAS_ELEVATION,
SET_IF(GNSS_MEASUREMENT_HAS_SNR, SnrInDb, measurement->snr_db);
SET_IF(GNSS_MEASUREMENT_HAS_ELEVATION,
ElevationInDeg,
measurement->elevation_deg);
SET_IF(GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY,
ElevationUncertaintyInDeg,
measurement->elevation_uncertainty_deg);
SET_IF(GPS_MEASUREMENT_HAS_AZIMUTH,
SET_IF(GNSS_MEASUREMENT_HAS_AZIMUTH,
AzimuthInDeg,
measurement->azimuth_deg);
SET_IF(GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY,
AzimuthUncertaintyInDeg,
measurement->azimuth_uncertainty_deg);
SET(UsedInFix,
(flags & GPS_MEASUREMENT_HAS_USED_IN_FIX) && measurement->used_in_fix);
(flags & GNSS_MEASUREMENT_HAS_USED_IN_FIX) && measurement->used_in_fix);
return object.get();
}
@@ -1232,11 +1223,12 @@ static jobject translate_gnss_measurement(JNIEnv* env,
GpsMeasurementFlags flags = measurement->flags;
SET(Svid, measurement->svid);
SET(ConstellationType, measurement->constellation);
SET(TimeOffsetInNs, measurement->time_offset_ns);
SET(State, measurement->state);
SET(ReceivedGpsTowInNs, measurement->received_gps_tow_ns);
SET(ReceivedGpsTowUncertaintyInNs,
measurement->received_gps_tow_uncertainty_ns);
SET(ReceivedSvTimeInNs, measurement->received_sv_time_in_ns);
SET(ReceivedSvTimeUncertaintyInNs,
measurement->received_sv_time_uncertainty_in_ns);
SET(Cn0InDbHz, measurement->c_n0_dbhz);
SET(PseudorangeRateInMetersPerSec, measurement->pseudorange_rate_mps);
SET(PseudorangeRateUncertaintyInMetersPerSec,
@@ -1245,62 +1237,56 @@ static jobject translate_gnss_measurement(JNIEnv* env,
SET(AccumulatedDeltaRangeInMeters, measurement->accumulated_delta_range_m);
SET(AccumulatedDeltaRangeUncertaintyInMeters,
measurement->accumulated_delta_range_uncertainty_m);
SET_IF(GPS_MEASUREMENT_HAS_PSEUDORANGE,
SET_IF(GNSS_MEASUREMENT_HAS_PSEUDORANGE,
PseudorangeInMeters,
measurement->pseudorange_m);
SET_IF(GPS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_PSEUDORANGE_UNCERTAINTY,
PseudorangeUncertaintyInMeters,
measurement->pseudorange_uncertainty_m);
SET_IF(GPS_MEASUREMENT_HAS_CODE_PHASE,
SET_IF(GNSS_MEASUREMENT_HAS_CODE_PHASE,
CodePhaseInChips,
measurement->code_phase_chips);
SET_IF(GPS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_CODE_PHASE_UNCERTAINTY,
CodePhaseUncertaintyInChips,
measurement->code_phase_uncertainty_chips);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_FREQUENCY,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_FREQUENCY,
CarrierFrequencyInHz,
measurement->carrier_frequency_hz);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_CYCLES,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_CYCLES,
CarrierCycles,
measurement->carrier_cycles);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_PHASE,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_PHASE,
CarrierPhase,
measurement->carrier_phase);
SET_IF(GPS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_CARRIER_PHASE_UNCERTAINTY,
CarrierPhaseUncertainty,
measurement->carrier_phase_uncertainty);
SET(LossOfLock, measurement->loss_of_lock);
SET_IF(GPS_MEASUREMENT_HAS_BIT_NUMBER, BitNumber, measurement->bit_number);
SET_IF(GPS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT,
SET_IF(GNSS_MEASUREMENT_HAS_BIT_NUMBER, BitNumber, measurement->bit_number);
SET_IF(GNSS_MEASUREMENT_HAS_TIME_FROM_LAST_BIT,
TimeFromLastBitInMs,
measurement->time_from_last_bit_ms);
SET_IF(GPS_MEASUREMENT_HAS_DOPPLER_SHIFT,
SET_IF(GNSS_MEASUREMENT_HAS_DOPPLER_SHIFT,
DopplerShiftInHz,
measurement->doppler_shift_hz);
SET_IF(GPS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_DOPPLER_SHIFT_UNCERTAINTY,
DopplerShiftUncertaintyInHz,
measurement->doppler_shift_uncertainty_hz);
SET(MultipathIndicator, measurement->multipath_indicator);
SET_IF(GPS_MEASUREMENT_HAS_SNR, SnrInDb, measurement->snr_db);
SET_IF(GPS_MEASUREMENT_HAS_ELEVATION,
SET_IF(GNSS_MEASUREMENT_HAS_SNR, SnrInDb, measurement->snr_db);
SET_IF(GNSS_MEASUREMENT_HAS_ELEVATION,
ElevationInDeg,
measurement->elevation_deg);
SET_IF(GPS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_ELEVATION_UNCERTAINTY,
ElevationUncertaintyInDeg,
measurement->elevation_uncertainty_deg);
SET_IF(GPS_MEASUREMENT_HAS_AZIMUTH,
SET_IF(GNSS_MEASUREMENT_HAS_AZIMUTH,
AzimuthInDeg,
measurement->azimuth_deg);
SET_IF(GPS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY,
SET_IF(GNSS_MEASUREMENT_HAS_AZIMUTH_UNCERTAINTY,
AzimuthUncertaintyInDeg,
measurement->azimuth_uncertainty_deg);
SET(UsedInFix,
(flags & GPS_MEASUREMENT_HAS_USED_IN_FIX) && measurement->used_in_fix);
SET(PseudorangeRateCarrierInMetersPerSec,
measurement->pseudorange_rate_carrier_mps);
SET(PseudorangeRateCarrierUncertaintyInMetersPerSec,
measurement->pseudorange_rate_carrier_uncertainty_mps);
(flags & GNSS_MEASUREMENT_HAS_USED_IN_FIX) && measurement->used_in_fix);
return object.get();
}
@@ -1480,8 +1466,18 @@ static jobject translate_gps_navigation_message(JNIEnv* env, GpsNavigationMessag
return NULL;
}
JavaObject object(env, "android/location/GnssNavigationMessage");
SET(Type, message->type);
SET(Svid, static_cast<int16_t>(message->prn));
if (message->prn >=1 && message->prn <= 32) {
SET(ConstellationType, static_cast<uint8_t>(GNSS_CONSTELLATION_GPS));
// Legacy driver doesn't set the higher byte to constellation type
// correctly. Set the higher byte to 'GPS'.
SET(Type, static_cast<int16_t>(message->type | 0x0100));
} else {
ALOGD("Unknown constellation type with Svid = %d.", message->prn);
SET(ConstellationType,
static_cast<uint8_t>(GNSS_CONSTELLATION_UNKNOWN));
SET(Type, static_cast<int16_t>(GNSS_NAVIGATION_MESSAGE_TYPE_UNKNOWN));
}
SET(MessageId, message->message_id);
SET(SubmessageId, message->submessage_id);
object.callSetter("setData", data, dataLength);