Replace cached location with current
This commit is contained in:
parent
87e8368856
commit
5f05110d0d
1 changed files with 1 additions and 2 deletions
|
@ -867,8 +867,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
|
|||
if (loc != null) {
|
||||
int counter = locationRequestsCounter.incrementAndGet();
|
||||
if (counter >= REQUESTS_BEFORE_CHECK_LOCATION && locationRequestsCounter.compareAndSet(counter, 0)) {
|
||||
net.osmand.Location cached = cachedLocation;
|
||||
if (cached != null && System.currentTimeMillis() - cached.getTime() > LOCATION_TIMEOUT_TO_BE_STALE) {
|
||||
if (System.currentTimeMillis() - loc.getTime() > LOCATION_TIMEOUT_TO_BE_STALE) {
|
||||
location = null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue