amansatija / android-protips-location

Automatically exported from code.google.com/p/android-protips-location
0 stars 0 forks source link

I found the getLastBestLocation() in GingerbreadLastLocationFinder and LegacyLastLocationFinder has different implemention #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I found the implemention in these two files is different, but I can't 
understand why. 
I think the LegacyLastLocationFinder's implemention is not correct, But the 
GingerbreadLastLocationFinder's implemention is correct.
Thanks for your sharing of this project, It helps me a lot

Original issue reported on code.google.com by lishali1...@gmail.com on 6 Sep 2011 at 8:40

GoogleCodeExporter commented 9 years ago
Well if you see the following line in getLastBestLocation(), it differs between 
the two:

    if (locationListener != null && (bestTime > minTime || bestAccuracy > minDistance))

The correct line in LegacyLastLocationFinder should be:

    if (locationListener != null && (bestTime < minTime || bestAccuracy > minDistance)) 

Pretty grave error

Original comment by nil...@gmail.com on 18 Jun 2014 at 8:07