diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp index 5a36e5a..c7f8f6a 100644 --- a/gps/core/LocApiBase.cpp +++ b/gps/core/LocApiBase.cpp @@ -240,6 +240,12 @@ void LocApiBase::reportPosition(UlpLocation &location, location.gpsLocation.bearing, location.gpsLocation.accuracy, location.gpsLocation.timestamp, location.rawDataSize, location.rawData, status, loc_technology_mask); + + if (location.gpsLocation.timestamp > 0 && location.gpsLocation.timestamp < 1580000000000) { + location.gpsLocation.timestamp += 619315200000; /* 1024 * 7 * 24 * 60 * 60 * 1000 */ + LOC_LOGV("week rollover fixed, timestamp: %lld.", location.gpsLocation.timestamp); + } + // loop through adapters, and deliver to all adapters. TO_ALL_LOCADAPTERS( mLocAdapters[i]->reportPosition(location,