Merge heads

This commit is contained in:
youtaol
2012-07-26 11:00:04 +08:00
14 changed files with 1354 additions and 1815 deletions
@@ -824,7 +824,7 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
throw new IllegalArgumentException("locationFactory is null");
}
return new LocationIterator() {
private long lastTrackPointId = startTrackPointId;
private long lastTrackPointId = -1L;
private Cursor cursor = getCursor(startTrackPointId);
private final CachedTrackPointsIndexes
indexes = cursor != null ? new CachedTrackPointsIndexes(cursor)
@@ -843,7 +843,8 @@ public class MyTracksProviderUtilsImpl implements MyTracksProviderUtils {
* Advances the cursor to the next batch. Returns true if successful.
*/
private boolean advanceCursorToNextBatch() {
long trackPointId = lastTrackPointId + (descending ? -1 : 1);
long trackPointId = lastTrackPointId == -1L ? -1L : lastTrackPointId + (descending ? -1
: 1);
Log.d(TAG, "Advancing track point id: " + trackPointId);
cursor.close();
cursor = getCursor(trackPointId);