Fix for bug 1087: (Voice Announcements for Pace in min/mi broken).

Voice announcements were always reporting 0 minutes 0 seconds if system was
configured for Pace.  Bug was caused by an incorrect cast of variable
'speed' to long (speed is a double). The casting was resulting in the variable
'speed' being changed to 0.

http://code.google.com/p/mytracks/issues/detail?id=1087
This commit is contained in:
Psychol
2012-07-30 23:06:33 -05:00
parent cbfcaaeb59
commit 599b220523
@@ -216,7 +216,7 @@ public class StatusAnnouncerTask implements PeriodicTask {
} else {
speed = speed == 0 ? 0.0 : 1 / speed;
int paceId = metricUnits ? R.string.voice_pace_per_kilometer : R.string.voice_pace_per_mile;
rate = context.getString(paceId, getAnnounceTime((long) speed * HOUR_TO_MILLISECOND));
rate = context.getString(paceId, getAnnounceTime((long) (speed * HOUR_TO_MILLISECOND)));
}
int totalDistanceId = metricUnits ? R.plurals.voiceTotalDistanceKilometers