From 13a60b0d41c740448ea39ca19842c7b193c61efd Mon Sep 17 00:00:00 2001 From: destradaa Date: Thu, 15 Jan 2015 18:36:01 -0800 Subject: 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 --- location/java/android/location/GpsNavigationMessageEvent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'location') 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; -- cgit v1.1