summaryrefslogtreecommitdiff
path: root/gnss/GnssAdapter.cpp
diff options
context:
space:
mode:
authorMike Cailean <mcailean@codeaurora.org>2019-04-24 11:33:20 -0700
committerMike Cailean <mcailean@codeaurora.org>2019-04-30 09:27:41 -0700
commitd6d55a4948301d76a8489a5a166acd1b1385e4a1 (patch)
treee52294314ee4a87d70bd7761178a120658f620ef /gnss/GnssAdapter.cpp
parent9b1ce8887233de61c476bff6d114be9b4ac9aa68 (diff)
downloadgps-d6d55a4948301d76a8489a5a166acd1b1385e4a1.tar.gz
Send SUPL notification to the framework for
E911 sessions only (older modems) Change-Id: Icd317f6e4b042c31afc63011596689d5fb35135f CRs-fixed: 2441292
Diffstat (limited to 'gnss/GnssAdapter.cpp')
-rw-r--r--gnss/GnssAdapter.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index 2039465..fe0fc9b 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -94,7 +94,8 @@ GnssAdapter::GnssAdapter() :
mPowerOn(false),
mAllowFlpNetworkFixes(0),
mGnssEnergyConsumedCb(nullptr),
- mPowerStateCb(nullptr)
+ mPowerStateCb(nullptr),
+ mIsE911Session(NULL)
{
LOC_LOGD("%s]: Constructor %p", __func__, this);
mLocPositionMode.mode = LOC_POSITION_MODE_INVALID;
@@ -3367,21 +3368,36 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification &notify, const void*
struct MsgReportNiNotify : public LocMsg {
GnssAdapter& mAdapter;
+ LocApiBase& mApi;
const GnssNiNotification mNotify;
const void* mData;
inline MsgReportNiNotify(GnssAdapter& adapter,
+ LocApiBase& api,
const GnssNiNotification& notify,
const void* data) :
LocMsg(),
mAdapter(adapter),
+ mApi(api),
mNotify(notify),
mData(data) {}
inline virtual void proc() const {
- mAdapter.requestNiNotify(mNotify, mData);
+ if (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type ||
+ GNSS_NI_TYPE_CONTROL_PLANE == mNotify.type) {
+ if (mAdapter.getE911State() ||
+ ((GNSS_CONFIG_SUPL_EMERGENCY_SERVICES_NO == ContextBase::mGps_conf.SUPL_ES) &&
+ (GNSS_NI_TYPE_EMERGENCY_SUPL == mNotify.type))) {
+ mApi.informNiResponse(GNSS_NI_RESPONSE_ACCEPT, mData);
+ }
+ else {
+ mApi.informNiResponse(GNSS_NI_RESPONSE_DENY, mData);
+ }
+ } else {
+ mAdapter.requestNiNotify(mNotify, mData);
+ }
}
};
- sendMsg(new MsgReportNiNotify(*this, notify, data));
+ sendMsg(new MsgReportNiNotify(*this, *mLocApi, notify, data));
return true;
}