mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-26 15:53:36 +00:00
[android] Fix jump of current location point (#10658)
* Remove check bypass for fused location updates Signed-off-by: kavikhalique <kavikhalique3@gmail.com> * discard close co-ord updates from different providers Signed-off-by: kavikhalique <kavikhalique3@gmail.com> * reject older timestamps Signed-off-by: kavikhalique <kavikhalique3@gmail.com> --------- Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
2ec2bf42a5
commit
0c4694a2cf
@@ -213,7 +213,7 @@ public class LocationHelper implements BaseLocationProvider.Listener
|
||||
|
||||
if (mSavedLocation != null)
|
||||
{
|
||||
if (!LocationUtils.isFromFusedProvider(location) && !LocationUtils.isLocationBetterThanLast(location, mSavedLocation))
|
||||
if (!LocationUtils.isLocationBetterThanLast(location, mSavedLocation))
|
||||
{
|
||||
Logger.d(TAG, "The new " + location + " is worse than the last " + mSavedLocation);
|
||||
return;
|
||||
|
||||
@@ -84,6 +84,9 @@ public class LocationUtils
|
||||
|
||||
public static boolean isLocationBetterThanLast(@NonNull Location newLocation, @NonNull Location lastLocation)
|
||||
{
|
||||
if (newLocation.getElapsedRealtimeNanos() < lastLocation.getElapsedRealtimeNanos())
|
||||
return false;
|
||||
|
||||
// As described in isAccuracySatisfied, GPS may have zero accuracy "for some reasons".
|
||||
if (isFromGpsProvider(lastLocation) && lastLocation.getAccuracy() == 0.0f)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user