msm8974-common: gps: Correct week rollover timestamps
This adjustment will help with applications checking the time coming from gps. Some applictions will consider times in the far past as an error. Change-Id: I69d6971249c4898ac3895f725e46f268cdb2b00d
This commit is contained in:
parent
2a42d86692
commit
b5d2115316
1 changed files with 6 additions and 0 deletions
|
@ -240,6 +240,12 @@ void LocApiBase::reportPosition(UlpLocation &location,
|
||||||
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
location.gpsLocation.bearing, location.gpsLocation.accuracy,
|
||||||
location.gpsLocation.timestamp, location.rawDataSize,
|
location.gpsLocation.timestamp, location.rawDataSize,
|
||||||
location.rawData, status, loc_technology_mask);
|
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.
|
// loop through adapters, and deliver to all adapters.
|
||||||
TO_ALL_LOCADAPTERS(
|
TO_ALL_LOCADAPTERS(
|
||||||
mLocAdapters[i]->reportPosition(location,
|
mLocAdapters[i]->reportPosition(location,
|
||||||
|
|
Loading…
Add table
Reference in a new issue