Assume GPS provides always time (removed workaround).

This commit is contained in:
Dennis Guse
2019-12-26 09:41:37 +01:00
parent d692329975
commit 422c2c02ce
@@ -1062,14 +1062,7 @@ public class ContentProviderUtils {
values.put(TrackPointsColumns.LONGITUDE, (int) (location.getLongitude() * 1E6));
values.put(TrackPointsColumns.LATITUDE, (int) (location.getLatitude() * 1E6));
long time = location.getTime();
// TODO: Check if this is really necessary!
// Hack for Samsung phones that don't properly populate the time field
if (time == 0) {
Log.w(TAG, "location has no timestamp; setting current time");
time = System.currentTimeMillis();
}
values.put(TrackPointsColumns.TIME, time);
values.put(TrackPointsColumns.TIME, location.getTime());
if (location.hasAltitude()) {
values.put(TrackPointsColumns.ALTITUDE, location.getAltitude());
}