After user edit the track. Update recorded track statistics immediately and update recording track statistics in track recording service.

Change some code style.
This commit is contained in:
youtaol
2013-10-23 17:14:45 +08:00
parent d64b1c74f4
commit c68ec5ed9a
8 changed files with 83 additions and 116 deletions
@@ -226,7 +226,7 @@ public class TripStatisticsUpdaterTest extends TestCase {
startTime + (timeOffset + i) * TEN_SECONDS);
tripStatisticsUpdater.addLocation(location,
PreferencesUtils.RECORDING_DISTANCE_INTERVAL_DEFAULT, ActivityType.FOOT,
PreferencesUtils.STATS_WEIGHT_DEFAULT);
PreferencesUtils.STATS_WEIGHT_DEFAULT, true);
tripStatistics = tripStatisticsUpdater.getTripStatistics();
assertEquals((timeOffset + i) * TEN_SECONDS, tripStatistics.getTotalTime());
@@ -273,7 +273,7 @@ public class TripStatisticsUpdaterTest extends TestCase {
locationOffset, locationOffset * .001, 0, startTime + (i + timeOffset) * TEN_SECONDS);
tripStatisticsUpdater.addLocation(location,
PreferencesUtils.RECORDING_DISTANCE_INTERVAL_DEFAULT, ActivityType.FOOT,
PreferencesUtils.STATS_WEIGHT_DEFAULT);
PreferencesUtils.STATS_WEIGHT_DEFAULT, false);
tripStatistics = tripStatisticsUpdater.getTripStatistics();
assertEquals((i + timeOffset) * TEN_SECONDS, tripStatistics.getTotalTime());
@@ -311,7 +311,7 @@ public class TripStatisticsUpdaterTest extends TestCase {
startTime + (timeOffset + i) * TEN_SECONDS);
tripStatisticsUpdater.addLocation(location,
PreferencesUtils.RECORDING_DISTANCE_INTERVAL_DEFAULT, ActivityType.FOOT,
PreferencesUtils.STATS_WEIGHT_DEFAULT);
PreferencesUtils.STATS_WEIGHT_DEFAULT, true);
tripStatistics = tripStatisticsUpdater.getTripStatistics();
assertTrue(tripStatistics.getMovingTime() <= tripStatistics.getTotalTime());