diff options
author | destradaa <destradaa@google.com> | 2014-11-07 00:07:30 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-07 00:07:30 +0000 |
commit | 031550a31e56bb8300ba9d1225004581ec156777 (patch) | |
tree | 7ff7ec53077c87bfda0f28fd6ca0ff64bb7f2007 /location/java/android/location/GpsMeasurementsEvent.java | |
parent | 587cdde2e2bf7e833e433c1edd6e8078832e327c (diff) | |
parent | 9ed36c42d8c3731b8ca631292881110eb8897cec (diff) | |
download | frameworks_base-031550a31e56bb8300ba9d1225004581ec156777.zip frameworks_base-031550a31e56bb8300ba9d1225004581ec156777.tar.gz frameworks_base-031550a31e56bb8300ba9d1225004581ec156777.tar.bz2 |
am 9ed36c42: Merge "Add support for GPS measurement/navigation message capabilities. b/16727892 b/16815124" into lmp-mr1-dev automerge: 992b9aa
* commit '9ed36c42d8c3731b8ca631292881110eb8897cec':
Add support for GPS measurement/navigation message capabilities. b/16727892 b/16815124
Diffstat (limited to 'location/java/android/location/GpsMeasurementsEvent.java')
-rw-r--r-- | location/java/android/location/GpsMeasurementsEvent.java | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/location/java/android/location/GpsMeasurementsEvent.java b/location/java/android/location/GpsMeasurementsEvent.java index e04ed81..94ca920 100644 --- a/location/java/android/location/GpsMeasurementsEvent.java +++ b/location/java/android/location/GpsMeasurementsEvent.java @@ -32,6 +32,24 @@ import java.util.Collections; * @hide */ public class GpsMeasurementsEvent implements Parcelable { + + /** + * The system does not support tracking of GPS Measurements. This status will not change in the + * future. + */ + public static final int STATUS_NOT_SUPPORTED = 0; + + /** + * GPS Measurements are successfully being tracked, it will receive updates once they are + * available. + */ + public static final int STATUS_READY = 1; + + /** + * GPS provider or Location is disabled, updates will not be received until they are enabled. + */ + public static final int STATUS_GPS_LOCATION_DISABLED = 2; + private final GpsClock mClock; private final Collection<GpsMeasurement> mReadOnlyMeasurements; @@ -43,7 +61,16 @@ public class GpsMeasurementsEvent implements Parcelable { * @hide */ public interface Listener { + + /** + * Returns the latest collected GPS Measurements. + */ void onGpsMeasurementsReceived(GpsMeasurementsEvent eventArgs); + + /** + * Returns the latest status of the GPS Measurements sub-system. + */ + void onStatusChanged(int status); } public GpsMeasurementsEvent(GpsClock clock, GpsMeasurement[] measurements) { @@ -103,7 +130,9 @@ public class GpsMeasurementsEvent implements Parcelable { public void writeToParcel(Parcel parcel, int flags) { parcel.writeParcelable(mClock, flags); - GpsMeasurement[] measurementsArray = mReadOnlyMeasurements.toArray(new GpsMeasurement[0]); + int measurementsCount = mReadOnlyMeasurements.size(); + GpsMeasurement[] measurementsArray = + mReadOnlyMeasurements.toArray(new GpsMeasurement[measurementsCount]); parcel.writeInt(measurementsArray.length); parcel.writeTypedArray(measurementsArray, flags); } |