diff options
author | qctecmdr <qctecmdr@localhost> | 2019-12-18 20:10:00 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-12-18 20:10:00 -0800 |
commit | e4f786e0a7211cf5baaeffcba0f51581b2d79f12 (patch) | |
tree | 5c5c1c287e1c41a83e726e98b7eee791aa6752c4 | |
parent | d71529af0f5b103cdbe2679148bd7268cb4713b8 (diff) | |
parent | fb232bd36c8a7084ceef2fb441703acbc83be90e (diff) | |
download | gps-e4f786e0a7211cf5baaeffcba0f51581b2d79f12.tar.gz |
Merge "Fix case where Emergency SUPL NI should be denied"
-rw-r--r-- | core/ContextBase.cpp | 2 | ||||
-rw-r--r-- | gnss/GnssAdapter.cpp | 24 |
2 files changed, 15 insertions, 11 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 3b8ffc6..3eb4973 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -193,7 +193,7 @@ void ContextBase::readConfig() 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; + mGps_conf.NI_SUPL_DENY_ON_NFW_LOCKED = 1; UTIL_READ_CONF(LOC_PATH_GPS_CONF, mGps_conf_table); UTIL_READ_CONF(LOC_PATH_SAP_CONF, mSap_conf_table); diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 5ce7b18..3fd3bb6 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3800,7 +3800,20 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* mAdapter.getE911State()) || // older modems (LOC_IN_EMERGENCY_SET == mEmergencyState); // newer modems - if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) { + if ((mAdapter.mSupportNfwControl || 0 == mAdapter.getAfwControlId()) && + (GNSS_NI_TYPE_SUPL == mNotify.type || GNSS_NI_TYPE_EMERGENCY_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 all these conditions are TRUE, then deny the NI Request: + -'Q' Lock behavior OR 'P' Lock behavior and GNSS is Locked + -NI SUPL Request type or NI SUPL Emergency Request type + -NOT in an Emergency Call Session + -NOT Privacy Override option + -NFW is locked and config item NI_SUPL_DENY_ON_NFW_LOCKED = 1 */ + mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData); + } else if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) { bInformNiAccept = bIsInEmergency || (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES); @@ -3816,15 +3829,6 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, const void* else { 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 { mAdapter.requestNiNotify(mNotify, mData, false); } |