diff --git a/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java index 2dd891ac2..586228b25 100644 --- a/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java @@ -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 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. diff --git a/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java index 33bfb6eef..5d134effb 100644 --- a/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java +++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtilsImpl.java @@ -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(