Add NI_SUPL_DENY_ON_NFW_LOCKED configuration

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

Change-Id: I0a769c4696751069d5a034dde8569ecfcf63b41a
CRs-fixed: 2550126
This commit is contained in:
Dante Russo 2019-10-22 08:18:52 -07:00
parent 91c053b772
commit 386a741309
3 changed files with 13 additions and 0 deletions

View file

@ -92,6 +92,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'}, {"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
{"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED", {"CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED",
&mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, NULL, 'n'}, &mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED, 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[] = const loc_param_s_type ContextBase::mSap_conf_table[] =
@ -191,6 +192,8 @@ void ContextBase::readConfig()
/* default configuration QTI GNSS H/W */ /* default configuration QTI GNSS H/W */
mGps_conf.GNSS_DEPLOYMENT = 0; mGps_conf.GNSS_DEPLOYMENT = 0;
mGps_conf.CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED = 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_GPS_CONF, mGps_conf_table);
UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table);

View file

@ -75,6 +75,7 @@ typedef struct loc_gps_cfg_s
uint32_t CP_MTLR_ES; uint32_t CP_MTLR_ES;
uint32_t GNSS_DEPLOYMENT; uint32_t GNSS_DEPLOYMENT;
uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED; uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED;
uint32_t NI_SUPL_DENY_ON_NFW_LOCKED;
} loc_gps_cfg_s_type; } loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number /* NOTE: the implementaiton of the parser casts number

View file

@ -3676,6 +3676,15 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
else { else {
mAdapter.requestNiNotify(mNotify, mData, false); mAdapter.requestNiNotify(mNotify, mData, false);
} }
} else if ((mAdapter.mSupportNfwControl || 0 == mAdapter.getAfwControlId()) &&
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 { } else {
mAdapter.requestNiNotify(mNotify, mData, false); mAdapter.requestNiNotify(mNotify, mData, false);
} }