14.1+15.1: GPS week rollover fix

16.0: 279492
17.1: 278135

also switch to alternate Xtra servers
https://developer.gemalto.com/threads/gps-time-info-error
This commit is contained in:
Tad 2020-08-09 12:14:29 -04:00
parent 887ebb84c5
commit 2f83043c68
5 changed files with 206 additions and 0 deletions

View File

@ -0,0 +1,105 @@
From 67a2a14cf94f41a11d73cd76aac01fb02f4b6399 Mon Sep 17 00:00:00 2001
From: jlask <jason972000@gmail.com>
Date: Tue, 19 May 2020 10:04:37 -0500
Subject: [PATCH] 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
---
core/LocApiBase.cpp | 7 +++++++
msm8084/core/LocApiBase.cpp | 7 +++++++
msm8909/core/LocApiBase.cpp | 7 +++++++
msm8960/core/LocApiBase.cpp | 6 ++++++
msm8974/core/LocApiBase.cpp | 6 ++++++
5 files changed, 33 insertions(+)
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index f56694e..a284080 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -243,6 +243,13 @@ 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 = 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,
diff --git a/msm8084/core/LocApiBase.cpp b/msm8084/core/LocApiBase.cpp
index 152243f..aed4cdd 100644
--- a/msm8084/core/LocApiBase.cpp
+++ b/msm8084/core/LocApiBase.cpp
@@ -237,6 +237,13 @@ 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 = 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,
diff --git a/msm8909/core/LocApiBase.cpp b/msm8909/core/LocApiBase.cpp
index 01aba47..a0315aa 100644
--- a/msm8909/core/LocApiBase.cpp
+++ b/msm8909/core/LocApiBase.cpp
@@ -243,6 +243,13 @@ 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 = 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,
diff --git a/msm8960/core/LocApiBase.cpp b/msm8960/core/LocApiBase.cpp
index 82c7692..ad384d2 100644
--- a/msm8960/core/LocApiBase.cpp
+++ b/msm8960/core/LocApiBase.cpp
@@ -197,6 +197,12 @@ 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,
diff --git a/msm8974/core/LocApiBase.cpp b/msm8974/core/LocApiBase.cpp
index 6969fe5..9367012 100644
--- a/msm8974/core/LocApiBase.cpp
+++ b/msm8974/core/LocApiBase.cpp
@@ -226,6 +226,12 @@ 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,

View File

@ -0,0 +1,89 @@
From 895557ea85e34d3f969955f234186c5a0afab0a9 Mon Sep 17 00:00:00 2001
From: jlask <jason972000@gmail.com>
Date: Tue, 19 May 2020 10:04:37 -0500
Subject: [PATCH] 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
---
core/LocApiBase.cpp | 7 +++++++
msm8909/core/LocApiBase.cpp | 7 +++++++
msm8960/core/LocApiBase.cpp | 6 ++++++
msm8974/core/LocApiBase.cpp | 6 ++++++
4 files changed, 26 insertions(+)
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index f56694e..a284080 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -243,6 +243,13 @@ 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 = 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,
diff --git a/msm8909/core/LocApiBase.cpp b/msm8909/core/LocApiBase.cpp
index 01aba47..a0315aa 100644
--- a/msm8909/core/LocApiBase.cpp
+++ b/msm8909/core/LocApiBase.cpp
@@ -243,6 +243,13 @@ 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 = 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,
diff --git a/msm8960/core/LocApiBase.cpp b/msm8960/core/LocApiBase.cpp
index f50d3e1..e6fb8cb 100644
--- a/msm8960/core/LocApiBase.cpp
+++ b/msm8960/core/LocApiBase.cpp
@@ -196,6 +196,12 @@ 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,
diff --git a/msm8974/core/LocApiBase.cpp b/msm8974/core/LocApiBase.cpp
index 6969fe5..9367012 100644
--- a/msm8974/core/LocApiBase.cpp
+++ b/msm8974/core/LocApiBase.cpp
@@ -226,6 +226,12 @@ 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,
--
2.26.2

View File

@ -395,6 +395,9 @@ hardenLocationConf() {
#Switch gpsOneXtra to IZatCloud (invalid certificate)
sed -i '/xtrapath/!s|://xtra|://xtrapath|' "$gpsConfig" &>/dev/null || true;
sed -i 's|gpsonextra.net|izatcloud.net|' "$gpsConfig" &>/dev/null || true;
sed -i 's|xtrapath1|xtrapath4|' "$gpsConfig" &>/dev/null || true;
sed -i 's|xtrapath2|xtrapath5|' "$gpsConfig" &>/dev/null || true;
sed -i 's|xtrapath3|xtrapath6|' "$gpsConfig" &>/dev/null || true;
#Enable HTTPS (IZatCloud supports HTTPS)
sed -i 's|http://xtrapath|https://xtrapath|' "$gpsConfig" &>/dev/null || true;
#sed -i 's|http://gllto|https://gllto|' "$gpsConfig" &>/dev/null || true; XXX: GLPals has an invaid certificate
@ -431,6 +434,9 @@ hardenLocationFWB() {
#Switch gpsOneXtra to IZatCloud (invalid certificate)
sed -i '/xtrapath/!s|://xtra|://xtrapath|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
sed -i 's|gpsonextra.net|izatcloud.net|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
sed -i 's|xtrapath1|xtrapath4|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
sed -i 's|xtrapath2|xtrapath5|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
sed -i 's|xtrapath3|xtrapath6|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
#Enable HTTPS (IZatCloud supports HTTPS)
sed -i 's|http://xtrapath|https://xtrapath|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true;
#sed -i 's|http://gllto|https://gllto|' "$dir"/frameworks/base/core/res/res/values*/*.xml &>/dev/null || true; XXX: GLPals has an invaid certificate

View File

@ -121,6 +121,9 @@ enterAndClear "hardware/ti/wlan";
git apply "$DOS_PATCHES/android_hardware_ti_wlan/209209.patch"; #wl12xx: Update SR and MR firmwares versions
git apply "$DOS_PATCHES/android_hardware_ti_wlan/209210.patch"; #wl12xx: Update SR PLT firmwares
enterAndClear "hardware/qcom/gps";
git apply "$DOS_PATCHES/android_hardware_qcom_gps/0001-rollover.patch"; #fix week rollover
if enter "kernel/wireguard"; then
if [ "$DOS_WIREGUARD_INCLUDED" = false ]; then rm Android.mk; fi;
#Remove system information from HTTP requests

View File

@ -115,6 +115,9 @@ awk -i inplace '!/mPermissionReviewRequired = Build.PERMISSIONS_REVIEW_REQUIRED/
awk -i inplace '!/\|\| context.getResources\(\).getBoolean\(/' service/java/com/android/server/wifi/WifiServiceImpl.java;
awk -i inplace '!/com.android.internal.R.bool.config_permissionReviewRequired/' service/java/com/android/server/wifi/WifiServiceImpl.java;
enterAndClear "hardware/qcom/gps";
git apply "$DOS_PATCHES_COMMON/android_hardware_qcom_gps/0001-rollover.patch"; #fix week rollover
if enter "kernel/wireguard"; then
if [ "$DOS_WIREGUARD_INCLUDED" = false ]; then rm Android.mk; fi;
#Remove system information from HTTP requests