Fix presence mode #97

Merged
s416204 merged 1 commits from fix-presence-mode into develop 2018-12-18 19:15:18 +01:00
2 changed files with 9 additions and 0 deletions
Showing only changes of commit ac3e8310d1 - Show all commits

View File

@ -330,7 +330,12 @@ public class BackgroundLocalizationService extends Service {
String locationLevel = PrefUtils.getLocationLevel(getApplicationContext());
String status = (PrefUtils.isStatusEnabled(getApplicationContext())) ? PrefUtils.getUserStatus(getApplicationContext()) : "";
if (locationLevel.equals(SharingLevel.PRESENCE.toString())) {
if(!MapUtils.checkIfCoordinateIsValid(latitude,longitude)){
return null;
}
latitude = presenceLatitude;
longitude = presenceLongitude;
approximatedBuildingPart = presenceApproximatedName;

View File

@ -77,6 +77,10 @@ public class MapUtils {
return outsideLatitudeRange.contains(coordinate.getLatitude()) && outsideLongitudeRange.contains(coordinate.getLongitude());
}
public static Boolean checkIfCoordinateIsValid(Double latitude, Double longitude){
return Const.buildingLatitudeRange.contains(latitude) && Const.buildingLongitudeRange.contains(longitude);
}
// Function for marker animation
public static class LatLngEvaluator implements TypeEvaluator<LatLng> {
// Method is used to interpolate the marker animation.