Rename constants

This commit is contained in:
Alexander Sytnyk 2017-07-20 18:39:33 +03:00
parent 0d1053ed6c
commit fca9925aa1
3 changed files with 4 additions and 4 deletions

View file

@ -48,8 +48,8 @@ public class OsmAndLocationProvider implements SensorEventListener {
public static final String SIMULATED_PROVIDER = "OsmAnd";
public static final long LOCATION_SHELF_LIFE = 1000 * 60 * 60; // 60 minutes
public static final long LOCATION_SHELF_LIFE_FOR_ICON = 1000 * 60 * 5; // 5 minutes
public static final long STALE_LOCATION_TIMEOUT = 1000 * 60 * 60; // 60 minutes
public static final long STALE_LOCATION_TIMEOUT_FOR_ICON = 1000 * 60 * 5; // 5 minutes
public interface OsmAndLocationListener {
void updateLocation(net.osmand.Location location);

View file

@ -76,7 +76,7 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
private boolean isLocationOutdated() {
if (locationProvider.getLastKnownLocation() != null) {
return System.currentTimeMillis() - locationProvider.getLastKnownLocation().getTime() >
OsmAndLocationProvider.LOCATION_SHELF_LIFE_FOR_ICON;
OsmAndLocationProvider.STALE_LOCATION_TIMEOUT_FOR_ICON;
}
return false;
}

View file

@ -194,7 +194,7 @@ public class MapMarkersWidgetsFactory {
} else if (lastKnownPosition == null) {
loc = null;
} else {
if (System.currentTimeMillis() - lastKnownPosition.getTime() < OsmAndLocationProvider.LOCATION_SHELF_LIFE) {
if (System.currentTimeMillis() - lastKnownPosition.getTime() < OsmAndLocationProvider.STALE_LOCATION_TIMEOUT) {
loc = new LatLon(lastKnownPosition.getLatitude(), lastKnownPosition.getLongitude());
} else {
loc = null;