diff options
author | Dante Russo <drusso@codeaurora.org> | 2019-12-05 16:12:12 -0800 |
---|---|---|
committer | Dante Russo <drusso@codeaurora.org> | 2019-12-05 17:12:03 -0800 |
commit | fb232bd36c8a7084ceef2fb441703acbc83be90e (patch) | |
tree | f4475991ebc9244c815bf3f0831c96c6ff8da983 | |
parent | a43430218337739c0c1143dc55474d1036d50558 (diff) | |
download | gps-fb232bd36c8a7084ceef2fb441703acbc83be90e.tar.gz |
Fix case where Emergency SUPL NI should be denied
Emergency and non-emergency SUPL NI Requests
should be denied under the following conditions:
- Device is NOT in an Emergency Call Session
- NI Request does NOT have Privacy Override
- NFW is locked
- Config item NI_SUPL_DENY_ON_NFW_LOCKED = 1
Also, config item NI_SUPL_DENY_ON_NFW_LOCKED
is set to 1 (true) by default
Change-Id: If66107fdbbefc2438e9fa2adf958f7750c08c1db
CRs-fixed: 2581083
-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); } |