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:
Jimmy Shih
2012-08-24 17:46:16 -07:00
parent 41278eb137
commit 296cd81167
5 changed files with 47 additions and 55 deletions
@@ -746,17 +746,6 @@ public class MyTracksProviderUtilsImplTest extends AndroidTestCase {
assertEquals(11, providerUtils.getTrackPointCursor(trackId, 0, 1000, false).getCount());
}
/**
* Tests the method {@link MyTracksProviderUtilsImpl#getLastTrackPoint(long)}.
*/
public void testGetLastTrackPoint() {
// Insert track, point at first.
long trackId = System.currentTimeMillis();
Track track = getTrack(trackId, 10);
insertTrackWithLocations(track);
checkLocation(9, providerUtils.getLastTrackPoint(trackId));
}
/**
* Tests the method {@link MyTracksProviderUtilsImpl#getLastTrackPointId(long)}.
*/