From 56c4dd442074bad94c2ef1483ecfc328703f8557 Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Tue, 3 Jul 2018 10:45:56 -0700 Subject: GPS: block CPI injection for those fixes orginate from modem GNSS adapter to block CPI injection for CPI originates from modem. One source of the fix is QNP fix from modem. Only fixes that comes within time threshold and with latitude and longitude falls within the same proximity will be blocked. Change-Id: If67a164d1e1c75735979f048a9f8dc93f0b0a41f CRs-fixed: 2260721 --- gnss/GnssAdapter.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gnss/GnssAdapter.h') diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index 319ea6b..695caf8 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -76,6 +76,19 @@ typedef struct { uint32_t svIdOffset; } NmeaSvMeta; +typedef struct { + double latitude; + double longitude; + float accuracy; + // the CPI will be blocked until the boot time + // specified in blockedTillTsMs + int64_t blockedTillTsMs; + // CPIs whose both latitude and longitude differ + // no more than latLonThreshold will be blocked + // in units of degree + double latLonDiffThreshold; +} BlockCPIInfo; + using namespace loc_core; namespace loc_core { @@ -124,6 +137,9 @@ class GnssAdapter : public LocAdapterBase { std::string mServerUrl; XtraSystemStatusObserver mXtraObserver; + /* === Misc ===================================================================== */ + BlockCPIInfo mBlockCPIInfo; + /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const TrackingOptions& trackingOptions); static void convertLocation(Location& out, const UlpLocation& ulpLocation, @@ -336,6 +352,8 @@ public: void injectLocationCommand(double latitude, double longitude, float accuracy); void injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty); + void blockCPICommand(double latitude, double longitude, float accuracy, + int blockDurationMsec, double latLonDiffThreshold); }; #endif //GNSS_ADAPTER_H -- cgit v1.2.3