diff options
author | destradaa <destradaa@google.com> | 2015-01-15 18:36:01 -0800 |
---|---|---|
committer | destradaa <destradaa@google.com> | 2015-01-23 10:26:17 -0800 |
commit | 13a60b0d41c740448ea39ca19842c7b193c61efd (patch) | |
tree | 2ea5b94cf67b90031101e5a4d8963aa9334719c3 /location | |
parent | 34efbcedac4157b1e92fcd8fd746ba2754b44858 (diff) | |
download | frameworks_base-13a60b0d41c740448ea39ca19842c7b193c61efd.zip frameworks_base-13a60b0d41c740448ea39ca19842c7b193c61efd.tar.gz frameworks_base-13a60b0d41c740448ea39ca19842c7b193c61efd.tar.bz2 |
Fix race condition generating READY and NOT_SUPPORTED statuses.
The race condition only affects when the client registers for several (all) location listeners.
And the side efects are benign: only the measurement and navigation message status are incurrectly
being sent to the application, but there are no crashes or any real data from GPS being
misscommunicated.
Also:
- cache the last reported status to filter sending notifications when no changes have occurred
- do some cleanup and refactoring in the code changed
Change-Id: I0692e6b70847dc1ee092d7a05a2c6ba3cd9fa147
Diffstat (limited to 'location')
-rw-r--r-- | location/java/android/location/GpsNavigationMessageEvent.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/location/java/android/location/GpsNavigationMessageEvent.java b/location/java/android/location/GpsNavigationMessageEvent.java index bd6921c..7452721 100644 --- a/location/java/android/location/GpsNavigationMessageEvent.java +++ b/location/java/android/location/GpsNavigationMessageEvent.java @@ -36,18 +36,18 @@ public class GpsNavigationMessageEvent implements Parcelable { * The system does not support tracking of GPS Navigation Messages. This status will not change * in the future. */ - public static int STATUS_NOT_SUPPORTED = 0; + public static final int STATUS_NOT_SUPPORTED = 0; /** * GPS Navigation Messages are successfully being tracked, it will receive updates once they are * available. */ - public static int STATUS_READY = 1; + public static final int STATUS_READY = 1; /** * GPS provider or Location is disabled, updated will not be received until they are enabled. */ - public static int STATUS_GPS_LOCATION_DISABLED = 2; + public static final int STATUS_GPS_LOCATION_DISABLED = 2; private final GpsNavigationMessage mNavigationMessage; |