This commit is contained in:
Victor Shcherb 2018-06-03 17:48:45 +02:00
parent e76ea77a5b
commit b5f5cb3cfe

View file

@ -876,7 +876,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
if (loc != null) { if (loc != null) {
int counter = locationRequestsCounter.incrementAndGet(); int counter = locationRequestsCounter.incrementAndGet();
if (counter >= REQUESTS_BEFORE_CHECK_LOCATION && locationRequestsCounter.compareAndSet(counter, 0)) { if (counter >= REQUESTS_BEFORE_CHECK_LOCATION && locationRequestsCounter.compareAndSet(counter, 0)) {
if (System.currentTimeMillis() - lastTimeGPSLocationFixed > LOCATION_TIMEOUT_TO_BE_STALE) { if (System.currentTimeMillis() - lastTimeLocationFixed > LOCATION_TIMEOUT_TO_BE_STALE) {
location = null; location = null;
} }
} }