Ignoring highly inaccurate location updates.
This commit is contained in:
parent
71a1456611
commit
75a73d97fd
|
|
@ -101,6 +101,18 @@ public class LocationLoggingService extends Service implements LocationListener
|
|||
return;
|
||||
}
|
||||
|
||||
if(!newLocation.hasAccuracy())
|
||||
{
|
||||
Log.d(TAG, "New location does not have accuracy. Ignoring it.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(newLocation.getAccuracy() > 100)
|
||||
{
|
||||
Log.d(TAG, "New location's accuracy is above 100 meters. Ignoring it.");
|
||||
return;
|
||||
}
|
||||
|
||||
lastLocation = newLocation;
|
||||
sendLocationToTelegram(lastLocation);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue