GPS reports wrong time when affected by GPS week rollover on S10

Search This thread

lkjsoiuew

Senior Member
Nov 17, 2010
117
3
It shows sonething in 2003 now. It is said it only affects "older devices".
https://gitlab.com/LineageOS/issues/android/-/issues/1446 says it was fixed in LineageOS in 2020.
Why do I have this bug now on an S10 with the latest official Lineage 19.1 for beyond1lte?

gnss.png
 

lkjsoiuew

Senior Member
Nov 17, 2010
117
3
Apparently it was just bad reception ... but it is strange nevertheless.

No it's still happening even with perfect conditions.
 
Last edited:

lkjsoiuew

Senior Member
Nov 17, 2010
117
3
That fix apparently works for beyond1lte, too.
Diff:
--- hardware/qcom/gps/core/LocApiBase.cpp~      2023-02-06 09:49:31.000000000 +0100
+++ hardware/qcom/gps/core/LocApiBase.cpp       2023-02-06 22:36:25.225063952 +0100
@@ -243,6 +243,12 @@
              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,
(if it wasn't fixed elsewhere in the source since the last official download package ... is that so much behind the source? ...)
 
Last edited: