Addressing comments I originally made on Sandor's change.

This commit is contained in:
Rodrigo Damazio
2010-09-27 21:02:52 -03:00
parent 5733224f8d
commit d7c6761841
28 changed files with 243 additions and 158 deletions
@@ -175,6 +175,8 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
@Override
public void fillLocation(Cursor cursor, Location location) {
location.reset();
int idxLatitude = cursor.getColumnIndexOrThrow(TrackPointsColumns.LATITUDE);
int idxLongitude =
cursor.getColumnIndexOrThrow(TrackPointsColumns.LONGITUDE);
@@ -865,7 +867,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
cursor.getColumnIndexOrThrow(TrackPointsColumns._ID);
do {
if (reuseLocations) {
fillLocation(cursor, buffer.location(cursor.getLong(idColumnIdx)));
fillLocation(cursor, buffer.add(cursor.getLong(idColumnIdx)));
} else {
Location location = createLocation(cursor);
if (location == null) {
@@ -874,7 +876,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
buffer.add(location, cursor.getLong(idColumnIdx));
}
} while (cursor.moveToNext());
if (buffer.getLocationsLoaded() == 0) {
Log.w(MyTracksProvider.TAG, "No locations read.");
buffer.resetAt(startingPoint + buffer.getSize());