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 005129874..b4258411c 100644
--- a/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java
+++ b/MyTracksLib/src/com/google/android/apps/mytracks/content/MyTracksProviderUtils.java
@@ -13,458 +13,412 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
+
package com.google.android.apps.mytracks.content;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.location.Location;
+import android.location.LocationManager;
import android.net.Uri;
import java.util.Iterator;
import java.util.List;
/**
- * Utility to access data from the mytracks content provider.
- *
+ * Utilities to access data from the My Tracks content provider.
+ *
* @author Rodrigo Damazio
*/
-public interface MyTracksProviderUtils {
+interface MyTracksProviderUtils {
/**
- * Authority (first part of URI) for the MyTracks content provider:
- */
- public static final String AUTHORITY = "com.google.android.maps.mytracks";
-
- /**
- * Deletes all tracks (including track points) from the provider.
- */
- void deleteAllTracks();
-
- /**
- * Deletes a track with the given track id.
- *
- * @param trackId the unique track id
- */
- void deleteTrack(long trackId);
-
- /**
- * Deletes a way point with the given way point id.
- * This will also correct the next statistics way point after the deleted one
- * to reflect the deletion.
- * The generator is needed to stitch together statistics waypoints.
- *
- * @param waypointId the unique way point id
- * @param descriptionGenerator the class to generate descriptions
- */
- void deleteWaypoint(long waypointId,
- DescriptionGenerator descriptionGenerator);
-
- /**
- * Finds the next statistics waypoint after the given waypoint.
- *
- * @param waypoint a given waypoint
- * @return the next statistics waypoint, or null if none found.
- */
- Waypoint getNextStatisticsWaypointAfter(Waypoint waypoint);
-
- /**
- * Updates the waypoint in the provider.
- *
- * @param waypoint
- * @return true if successful
- */
- boolean updateWaypoint(Waypoint waypoint);
-
- /**
- * Finds the first recorded location from the location provider.
- *
- * @return the first location, or null if no locations available
- */
- Location getFirstLocation();
-
- /**
- * Finds the last recorded location from the location provider.
- *
- * @return the last location, or null if no locations available
- */
- Location getLastLocation();
-
- /**
- * Finds the first recorded waypoint for a given track from the location
+ * The authority (the first part of the URI) for the My Tracks content
* provider.
- * This is a special waypoint that holds the stats for current segment.
- *
- * @param trackId the id of the track the waypoint belongs to
- * @return the first waypoint, or null if no waypoints available
*/
- Waypoint getFirstWaypoint(long trackId);
+ String AUTHORITY = "com.google.android.maps.mytracks";
/**
- * Finds the given waypoint from the location provider.
- *
- * @param waypointId
- * @return the waypoint, or null if it does not exist
- */
- Waypoint getWaypoint(long waypointId);
-
- /**
- * Finds the last recorded location id from the track points provider.
- *
- * @param trackId find last location on this track
- * @return the location id, or -1 if no locations available
- */
- long getLastLocationId(long trackId);
-
- /**
- * Finds the id of the 1st waypoint for a given track.
- * The 1st waypoint is special as it contains the stats for the current
- * segment.
- *
- * @param trackId find last location on this track
- * @return the waypoint id, or -1 if no waypoints are available
- */
- long getFirstWaypointId(long trackId);
-
- /**
- * Finds the id of the 1st waypoint for a given track.
- * The 1st waypoint is special as it contains the stats for the current
- * segment.
- *
- * @param trackId find last location on this track
- * @return the waypoint id, or -1 if no waypoints are available
- */
- long getLastWaypointId(long trackId);
-
- /**
- * Gets the next marker number.
- *
- * @param trackId the track id
- * @param statistics true for statistics marker, false for waypoint marker
- * @return the next number or -1 if unable to get the value
- */
- int getNextMarkerNumber(long trackId, boolean statistics);
-
- /**
- * Finds the last recorded track from the track provider.
- *
- * @return the last track, or null if no tracks available
- */
- Track getLastTrack();
-
- /**
- * Finds the last recorded track id from the tracks provider.
- *
- * @return the track id, or -1 if no tracks available
- */
- long getLastTrackId();
-
- /**
- * Finds a location by given unique id.
- *
- * @param id the desired id
- * @return a Location object, or null if not found
- */
- Location getLocation(long id);
-
- /**
- * Creates a cursor over the locations in the track points provider which
- * iterates over a given range of unique ids.
- * Caller owns the returned cursor and is responsible for closing it.
- *
- * @param trackId the id of the track for which to get the points
- * @param minTrackPointId the minimum id for the track points
- * @param maxLocations maximum number of locations retrieved
- * @param descending if true the results will be returned in descending id
- * order (latest location first)
- * @return A cursor over the selected range of locations
- */
- Cursor getLocationsCursor(long trackId, long minTrackPointId,
- int maxLocations, boolean descending);
-
- /**
- * Creates a cursor over the waypoints of a track.
- * Caller owns the returned cursor and is responsible for closing it.
- *
- * @param trackId the id of the track for which to get the points
- * @param minWaypointId the minimum id for the track points
- * @param maxWaypoints the maximum number of waypoints to return
- * @return A cursor over the selected range of locations
- */
- Cursor getWaypointsCursor(long trackId, long minWaypointId,
- int maxWaypoints);
-
- /**
- * Creates a cursor over waypoints with the given selection.
- * Caller owns the returned cursor and is responsible for closing it.
- *
- * @param selection a given selection
- * @param selectionArgs arguments for the given selection
- * @param order the order in which to return results
- * @param maxWaypoints the maximum number of waypoints to return
- * @return a cursor of the selected waypoints
- */
- Cursor getWaypointsCursor(String selection, String[] selectionArgs, String order, int maxWaypoints);
-
- /**
- * Finds a track by given unique track id.
- * 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
- */
- Track getTrack(long id);
-
- /**
- * 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
+ * Gets all the tracks. If no track exists, an empty list is returned.
+ *
+ * Note that the returned tracks do not have any track points attached.
*/
List