From 042c48f869d45945aa2da0e2a4230f017e16d431 Mon Sep 17 00:00:00 2001 From: Wyatt Riley Date: Fri, 6 Oct 2017 14:59:25 -0700 Subject: mItarSpeedLimitExceeded thread safety Change-Id: Ia8e2378001ba2ffb71925814c95f5a587109c4f3 Fixes: 63941819 Test: Basic build & GPS sanity check --- .../core/java/com/android/server/location/GnssLocationProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java index 0aa6a90e3efb..e41c17df8ca1 100644 --- a/services/core/java/com/android/server/location/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/GnssLocationProvider.java @@ -417,7 +417,11 @@ public class GnssLocationProvider implements LocationProviderInterface { // stops output right at 600m/s, depriving this of the information of a device that reaches // greater than 600m/s, and higher than the speed of sound to avoid impacting most use cases. private static final float ITAR_SPEED_LIMIT_METERS_PER_SECOND = 400.0F; - private boolean mItarSpeedLimitExceeded = false; + + // TODO: improve comment + // Volatile to ensure that potentially near-concurrent outputs from HAL + // react to this value change promptly + private volatile boolean mItarSpeedLimitExceeded = false; // GNSS Metrics private GnssMetrics mGnssMetrics; -- cgit v1.2.3-59-g8ed1b