mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
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.
|
||||
* Note that the returned track object does not have any track points
|
||||
* attached. Use {@link #getTrackPoints(Track, int)} to load the track points.
|
||||
* Note that the returned track object does not have any track points attached.
|
||||
* Use {@link #getLocationIterator(long, long, boolean, LocationFactory)} to load
|
||||
* the track points.
|
||||
*
|
||||
* @param id desired unique track id
|
||||
* @return a Track object, or null if not found
|
||||
@@ -189,24 +190,14 @@ public interface MyTracksProviderUtils {
|
||||
Track getTrack(long id);
|
||||
|
||||
/**
|
||||
* Retrieves all tracks without track points. If no tracks exist an empty
|
||||
* list will be returned. Use {@link #getTrackPoints(Track, int)} to load
|
||||
* the track points.
|
||||
* Retrieves all tracks without track points. If no tracks exist, an empty
|
||||
* list will be returned. Use {@link #getLocationIterator(long, long, boolean, LocationFactory)}
|
||||
* to load the track points.
|
||||
*
|
||||
* @return a list of all the recorded tracks
|
||||
*/
|
||||
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.
|
||||
* 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;
|
||||
}
|
||||
|
||||
@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
|
||||
public Cursor getTracksCursor(String selection) {
|
||||
Cursor cursor = contentResolver.query(
|
||||
|
||||
Reference in New Issue
Block a user