forked from upstream-mirrors/OpenTracks
Get rid of unused getTrackPoints(...).
This commit is contained in:
+6
-15
@@ -180,8 +180,9 @@ public interface MyTracksProviderUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a track by given unique track id.
|
* Finds a track by given unique track id.
|
||||||
* Note that the returned track object does not have any track points
|
* Note that the returned track object does not have any track points attached.
|
||||||
* attached. Use {@link #getTrackPoints(Track, int)} to load the track points.
|
* Use {@link #getLocationIterator(long, long, boolean, LocationFactory)} to load
|
||||||
|
* the track points.
|
||||||
*
|
*
|
||||||
* @param id desired unique track id
|
* @param id desired unique track id
|
||||||
* @return a Track object, or null if not found
|
* @return a Track object, or null if not found
|
||||||
@@ -189,24 +190,14 @@ public interface MyTracksProviderUtils {
|
|||||||
Track getTrack(long id);
|
Track getTrack(long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves all tracks without track points. If no tracks exist an empty
|
* Retrieves all tracks without track points. If no tracks exist, an empty
|
||||||
* list will be returned. Use {@link #getTrackPoints(Track, int)} to load
|
* list will be returned. Use {@link #getLocationIterator(long, long, boolean, LocationFactory)}
|
||||||
* the track points.
|
* to load the track points.
|
||||||
*
|
*
|
||||||
* @return a list of all the recorded tracks
|
* @return a list of all the recorded tracks
|
||||||
*/
|
*/
|
||||||
List<Track> getAllTracks();
|
List<Track> getAllTracks();
|
||||||
|
|
||||||
/**
|
|
||||||
* Loads the track points for a given track.
|
|
||||||
*
|
|
||||||
* @param track assumes that startId and stopId are filled in correctly
|
|
||||||
* @param maxPoints maximum number of points to load, or -1 for no limit
|
|
||||||
* (oldest ones will be discarded)
|
|
||||||
* @return the id of the last location in the track
|
|
||||||
*/
|
|
||||||
long getTrackPoints(Track track, int maxPoints);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a cursor over the tracks provider with a given selection.
|
* Creates a cursor over the tracks provider with a given selection.
|
||||||
* Caller gets to own the returned cursor. Don't forget to close it.
|
* Caller gets to own the returned cursor. Don't forget to close it.
|
||||||
|
|||||||
-29
@@ -877,35 +877,6 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
|
|||||||
return tracks;
|
return tracks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getTrackPoints(Track track, int maxPoints) {
|
|
||||||
long lastId = -1;
|
|
||||||
Cursor cursor = getLocationsCursor(track.getId(), -1, maxPoints, true);
|
|
||||||
if (cursor == null) {
|
|
||||||
Log.w(TAG, "Cannot get a locations cursor!");
|
|
||||||
return lastId;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
final int idColumnIdx =
|
|
||||||
cursor.getColumnIndexOrThrow(TrackPointsColumns._ID);
|
|
||||||
if (cursor.moveToLast()) {
|
|
||||||
do {
|
|
||||||
Location location = createLocation(cursor);
|
|
||||||
if (location == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
track.addLocation(location);
|
|
||||||
lastId = cursor.getLong(idColumnIdx);
|
|
||||||
} while (cursor.moveToPrevious());
|
|
||||||
}
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
Log.w(TAG, "Caught unexpected exception.", e);
|
|
||||||
} finally {
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
return lastId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cursor getTracksCursor(String selection) {
|
public Cursor getTracksCursor(String selection) {
|
||||||
Cursor cursor = contentResolver.query(
|
Cursor cursor = contentResolver.query(
|
||||||
|
|||||||
Reference in New Issue
Block a user