summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
authordestradaa <destradaa@google.com>2014-07-22 09:59:43 -0700
committerdestradaa <destradaa@google.com>2014-07-22 10:03:28 -0700
commit81cabb8a7fb5b61f16bf49c2757ccb51bc88e708 (patch)
tree764694ca6dc9e33b2a812c6d795de7e654fb63d8 /location
parentcaf26263a7e186882c1875f022530324852fe75f (diff)
downloadframeworks_base-81cabb8a7fb5b61f16bf49c2757ccb51bc88e708.zip
frameworks_base-81cabb8a7fb5b61f16bf49c2757ccb51bc88e708.tar.gz
frameworks_base-81cabb8a7fb5b61f16bf49c2757ccb51bc88e708.tar.bz2
Add uncertainty for GPS received TOW field.
b/16463499 Change-Id: I5dde8a2737d9345eb7f77edc64ab7286254a65e4
Diffstat (limited to 'location')
-rw-r--r--location/java/android/location/GpsMeasurement.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/location/java/android/location/GpsMeasurement.java b/location/java/android/location/GpsMeasurement.java
index 2272ac3..591a6ca 100644
--- a/location/java/android/location/GpsMeasurement.java
+++ b/location/java/android/location/GpsMeasurement.java
@@ -33,6 +33,7 @@ public class GpsMeasurement implements Parcelable {
private double mTimeOffsetInNs;
private short mState;
private long mReceivedGpsTowInNs;
+ private long mReceivedGpsTowUncertaintyInNs;
private double mCn0InDbHz;
private double mPseudorangeRateInMetersPerSec;
private double mPseudorangeRateUncertaintyInMetersPerSec;
@@ -171,6 +172,7 @@ public class GpsMeasurement implements Parcelable {
mTimeOffsetInNs = measurement.mTimeOffsetInNs;
mState = measurement.mState;
mReceivedGpsTowInNs = measurement.mReceivedGpsTowInNs;
+ mReceivedGpsTowUncertaintyInNs = measurement.mReceivedGpsTowUncertaintyInNs;
mCn0InDbHz = measurement.mCn0InDbHz;
mPseudorangeRateInMetersPerSec = measurement.mPseudorangeRateInMetersPerSec;
mPseudorangeRateUncertaintyInMetersPerSec =
@@ -318,6 +320,20 @@ public class GpsMeasurement implements Parcelable {
}
/**
+ * Gets the received GPS time-of-week's uncertainty (1-Sigma) in nanoseconds.
+ */
+ public long getReceivedGpsTowUncertaintyInNs() {
+ return mReceivedGpsTowUncertaintyInNs;
+ }
+
+ /**
+ * Sets the received GPS time-of-week's uncertainty (1-Sigma) in nanoseconds.
+ */
+ public void setReceivedGpsTowUncertaintyInNs(long value) {
+ mReceivedGpsTowUncertaintyInNs = value;
+ }
+
+ /**
* Gets the Carrier-to-noise density in dB-Hz.
* Range: [0, 63].
*
@@ -1129,6 +1145,7 @@ public class GpsMeasurement implements Parcelable {
gpsMeasurement.mTimeOffsetInNs = parcel.readDouble();
gpsMeasurement.mState = (short) parcel.readInt();
gpsMeasurement.mReceivedGpsTowInNs = parcel.readLong();
+ gpsMeasurement.mReceivedGpsTowUncertaintyInNs = parcel.readLong();
gpsMeasurement.mCn0InDbHz = parcel.readDouble();
gpsMeasurement.mPseudorangeRateInMetersPerSec = parcel.readDouble();
gpsMeasurement.mPseudorangeRateUncertaintyInMetersPerSec = parcel.readDouble();
@@ -1171,6 +1188,7 @@ public class GpsMeasurement implements Parcelable {
parcel.writeDouble(mTimeOffsetInNs);
parcel.writeInt(mState);
parcel.writeLong(mReceivedGpsTowInNs);
+ parcel.writeLong(mReceivedGpsTowUncertaintyInNs);
parcel.writeDouble(mCn0InDbHz);
parcel.writeDouble(mPseudorangeRateInMetersPerSec);
parcel.writeDouble(mPseudorangeRateUncertaintyInMetersPerSec);
@@ -1216,7 +1234,12 @@ public class GpsMeasurement implements Parcelable {
builder.append(String.format(format, "State", getStateString()));
- builder.append(String.format(format, "ReceivedGpsTowInNs", mReceivedGpsTowInNs));
+ builder.append(String.format(
+ formatWithUncertainty,
+ "ReceivedGpsTowInNs",
+ mReceivedGpsTowInNs,
+ "ReceivedGpsTowUncertaintyInNs",
+ mReceivedGpsTowUncertaintyInNs));
builder.append(String.format(format, "Cn0InDbHz", mCn0InDbHz));
@@ -1321,6 +1344,7 @@ public class GpsMeasurement implements Parcelable {
setTimeOffsetInNs(Long.MIN_VALUE);
setState(STATE_UNKNOWN);
setReceivedGpsTowInNs(Long.MIN_VALUE);
+ setReceivedGpsTowUncertaintyInNs(Long.MAX_VALUE);
setCn0InDbHz(Double.MIN_VALUE);
setPseudorangeRateInMetersPerSec(Double.MIN_VALUE);
setPseudorangeRateUncertaintyInMetersPerSec(Double.MIN_VALUE);