summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2020-12-27 16:46:53 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2020-12-27 16:46:53 -0800
commita891b8fcf12e139e2b53445483a192f49af1b471 (patch)
treeea65a6c8aff710507a20793182bf0ea3e39729ce
parent33ec7c1010a18d011fd2d972a7866e745d56935e (diff)
parentde8af557e2b05bac026d884deea231cf44a0398a (diff)
Merge "Add NI_SUPL_DENY_ON_NFW_LOCKED configuration"
-rw-r--r--core/ContextBase.cpp3
-rw-r--r--core/ContextBase.h1
-rw-r--r--gnss/GnssAdapter.cpp8
3 files changed, 12 insertions, 0 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index e434d47..ee37a0f 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -93,6 +93,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED",
&mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'},
{"CP_MTLR_ES", &mGps_conf.CP_MTLR_ES, NULL, 'n' },
+ {"NI_SUPL_DENY_ON_NFW_LOCKED", &mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED, NULL, 'n'},
};
const loc_param_s_type ContextBase::mSap_conf_table[] =
@@ -192,6 +193,8 @@ void ContextBase::readConfig()
/* default configuration QTI GNSS H/W */
mGps_conf.GNSS_DEPLOYMENT = 0;
mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 0;
+ /* default configuration for NI_SUPL_DENY_ON_NFW_LOCKED */
+ mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED = 0;
UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table);
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);
diff --git a/core/ContextBase.h b/core/ContextBase.h
index 967f6c3..c995c9b 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -80,6 +80,7 @@ typedef struct loc_gps_cfg_s
uint32_t GNSS_DEPLOYMENT;
uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED;
uint32_t CP_MTLR_ES;
+ uint32_t NI_SUPL_DENY_ON_NFW_LOCKED;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index 4b6f436..a0d36f6 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -4252,6 +4252,14 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
else {
mAdapter.requestNiNotify(mNotify, mData, false);
}
+ } else if (GNSS_NI_TYPE_SUPL == mNotify.type && !bIsInEmergency &&
+ !(GNSS_NI_OPTIONS_PRIVACY_OVERRIDE_BIT & mNotify.options) &&
+ (GNSS_CONFIG_GPS_LOCK_NI & ContextBase::mGps_conf.GPS_LOCK) &&
+ 1 == ContextBase::mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED) {
+ // If 'Q' Lock behavior OR 'P' Lock behavior and GNSS is Locked
+ // If an NI SUPL Request that does not have Privacy Override option comes when
+ // NFW is locked and config item NI_SUPL_DENY_ON_NFW_LOCKED = 1, then deny it
+ mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData);
} else {
mAdapter.requestNiNotify(mNotify, mData, false);
}