aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlask <jason972000@gmail.com>2020-05-19 10:04:37 -0500
committerJeferson Oliveira <jroliveira.oliveira301@gmail.com>2021-04-06 19:25:52 +0200
commit5e0d5cd0c62d8d98c181e5e4c6f7919afac5b4bf (patch)
treeeff641ac5032e176f4a1b7a9390ac9f36f5ec0d5
parent95c08dac8ad324e9ed3193ce9769224485abee3b (diff)
victara: 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
-rw-r--r--gps/core/LocApiBase.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp
index 80e2375..271c2bc 100644
--- a/gps/core/LocApiBase.cpp
+++ b/gps/core/LocApiBase.cpp
@@ -222,6 +222,11 @@ void LocApiBase::reportPosition(UlpLocation &location,
enum loc_sess_status status,
LocPosTechMask loc_technology_mask)
{
+ if (location.gpsLocation.timestamp > 0 && location.gpsLocation.timestamp <1580000000000) {
+ location.gpsLocation.timestamp = location.gpsLocation.timestamp + 619315200000;
+ 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,