summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Cailean <mcailean@codeaurora.org>2019-05-01 13:19:19 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2020-12-11 11:32:00 -0800
commit5b08f5c588593efa335ebf83a99df3be6c7ffdfd (patch)
tree3e534d5a22a0db8cb5795e8f518abeda853f85f9
parent18e36f9f421caab6c2c886b93e4dc98b9ff8ed61 (diff)
Process CP_MTLR in emergency in different conditions
Prcess CP_MTLR based on a new configuration item Change-Id: I9351f574f0b1a4bad2b88f2627ab188ac1522e92 CRs-fixed: 2444954
-rw-r--r--core/ContextBase.cpp2
-rw-r--r--core/ContextBase.h1
-rw-r--r--etc/gps.conf5
-rw-r--r--gnss/GnssAdapter.cpp16
4 files changed, 18 insertions, 6 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index b55b758..e434d47 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -92,6 +92,7 @@ const loc_param_s_type ContextBase::mGps_conf_table[] =
{"GNSS_DEPLOYMENT", &mGps_conf.GNSS_DEPLOYMENT, NULL, 'n'},
{"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' },
};
const loc_param_s_type ContextBase::mSap_conf_table[] =
@@ -126,6 +127,7 @@ void ContextBase::readConfig()
mGps_conf.SUPL_VER = 0x10000;
mGps_conf.SUPL_MODE = 0x1;
mGps_conf.SUPL_ES = 0;
+ mGps_conf.CP_MTLR_ES = 0;
mGps_conf.SUPL_HOST[0] = 0;
mGps_conf.SUPL_PORT = 0;
mGps_conf.CAPABILITIES = 0x7;
diff --git a/core/ContextBase.h b/core/ContextBase.h
index 280316c..967f6c3 100644
--- a/core/ContextBase.h
+++ b/core/ContextBase.h
@@ -79,6 +79,7 @@ typedef struct loc_gps_cfg_s
uint32_t POSITION_ASSISTED_CLOCK_ESTIMATOR_ENABLED;
uint32_t GNSS_DEPLOYMENT;
uint32_t CUSTOM_NMEA_GGA_FIX_QUALITY_ENABLED;
+ uint32_t CP_MTLR_ES;
} loc_gps_cfg_s_type;
/* NOTE: the implementaiton of the parser casts number
diff --git a/etc/gps.conf b/etc/gps.conf
index 0efc73e..8af4038 100644
--- a/etc/gps.conf
+++ b/etc/gps.conf
@@ -341,3 +341,8 @@ D_LEVEL_MAX_CAPACITY = 300
V_LEVEL_TIME_DEPTH = 200
V_LEVEL_MAX_CAPACITY = 400
+#####################################
+# CP_MTLR_ES
+#####################################
+# CP MTLR ES, 1=enable, 0=disable
+CP_MTLR_ES=0
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index bd36e90..575183b 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -4225,16 +4225,20 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
mNotify(notify),
mData(data) {}
inline virtual void proc() const {
- if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type ||
- GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
+ if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type) {
if (mAdapter.getE911State() ||
- ((GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES) &&
- (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type))) {
+ (GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES)) {
mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
- }
- else {
+ } else {
mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData);
}
+ } else if (GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
+ if (mAdapter.getE911State() &&
+ (1 == ContextBase::mGps_conf.CP_MTLR_ES)) {
+ mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
+ } else {
+ mAdapter.requestNiNotify(mNotify, mData);
+ }
} else {
mAdapter.requestNiNotify(mNotify, mData);
}