forked from upstream-mirrors/OpenTracks
In TrackRecordingService, fix the code on detecting if a location
is already inserted in the database. In TripStatisticsUpdater, improve total distance accuracy by taking into account the last point in a segment.
This commit is contained in:
@@ -211,13 +211,6 @@ public interface MyTracksProviderUtils {
|
||||
*/
|
||||
public Location createTrackPoint(Cursor cursor);
|
||||
|
||||
/**
|
||||
* Gets the last location for a track. Returns null if it doesn't exist.
|
||||
*
|
||||
* @param trackId the track id
|
||||
*/
|
||||
public Location getLastTrackPoint(long trackId);
|
||||
|
||||
/**
|
||||
* Gets the last location id for a track. Returns -1L if it doesn't exist.
|
||||
*
|
||||
|
||||
-11
@@ -697,17 +697,6 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
|
||||
return location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location getLastTrackPoint(long trackId) {
|
||||
if (trackId < 0) {
|
||||
return null;
|
||||
}
|
||||
String selection = TrackPointsColumns._ID + "=(select max(" + TrackPointsColumns._ID + ") from "
|
||||
+ TrackPointsColumns.TABLE_NAME + " WHERE " + TrackPointsColumns.TRACKID + "=?)";
|
||||
String[] selectionArgs = new String[] { Long.toString(trackId) };
|
||||
return findTrackPointBy(selection, selectionArgs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getLastTrackPointId(long trackId) {
|
||||
if (trackId < 0) {
|
||||
|
||||
Reference in New Issue
Block a user