summaryrefslogtreecommitdiff
path: root/gnss/GnssAdapter.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2018-07-03 10:45:56 -0700
committerKevin Tang <zhikait@codeaurora.org>2018-07-03 10:45:56 -0700
commit56c4dd442074bad94c2ef1483ecfc328703f8557 (patch)
treea4c49a927f56b593d58c434b0e81015d174efecc /gnss/GnssAdapter.h
parent271cfd8a00f97f13a937877cc8ef66ef0392a087 (diff)
downloadgps-56c4dd442074bad94c2ef1483ecfc328703f8557.tar.gz
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
Diffstat (limited to 'gnss/GnssAdapter.h')
-rw-r--r--gnss/GnssAdapter.h18
1 files changed, 18 insertions, 0 deletions
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