summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2020-12-28 13:31:46 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2020-12-28 13:31:46 -0800
commitceab78668aaaf497622bd67f13e1ca16bcca1a53 (patch)
treec016ef600c5c1c20719df84a4b30dc85dd5be02c
parent64910a0babc4415a68c7731834ae83d04876e4c8 (diff)
parentedb42238b9bc5c964a9a8fe36d0e22eae6ef9391 (diff)
Merge "Fix case where Emergency SUPL NI should be denied"
-rw-r--r--core/ContextBase.cpp2
-rw-r--r--gnss/GnssAdapter.cpp22
2 files changed, 14 insertions, 10 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index ee37a0f..de28d8c 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -194,7 +194,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 a0d36f6..afc6a89 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -4236,7 +4236,19 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
mAdapter.getE911State()) || // older modems
(LOC_IN_EMERGENCY_SET == mEmergencyState); // newer modems
- if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) {
+ if ((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);
@@ -4252,14 +4264,6 @@ 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);
}