diff options
author | qctecmdr <qctecmdr@localhost> | 2019-05-01 11:37:59 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-05-01 11:37:59 -0700 |
commit | 4d6bb2da93570f07d874e2a76519518c6d4b163f (patch) | |
tree | 119993bb7f31f06c8d2cfbbdec5eba9b687f7e8e /gnss | |
parent | 3e62412eb0233619684ecdbc39b19cbc8ebbdc93 (diff) | |
parent | d6d55a4948301d76a8489a5a166acd1b1385e4a1 (diff) | |
download | gps-4d6bb2da93570f07d874e2a76519518c6d4b163f.tar.gz |
Merge "Send SUPL notification to the framework for E911 sessions only (older modems)"
Diffstat (limited to 'gnss')
-rw-r--r-- | gnss/GnssAdapter.cpp | 22 | ||||
-rw-r--r-- | gnss/GnssAdapter.h | 8 |
2 files changed, 27 insertions, 3 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 436681a..e1143fd 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; @@ -3394,21 +3395,36 @@ GnssAdapter::requestNiNotifyEvent(const GnssNiNotification ¬ify, 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; } diff --git a/gnss/GnssAdapter.h b/gnss/GnssAdapter.h index ae5f5f1..6f652e6 100644 --- a/gnss/GnssAdapter.h +++ b/gnss/GnssAdapter.h @@ -165,8 +165,10 @@ class GnssAdapter : public LocAdapterBase { /* ==== NFW =========================================================================== */ NfwStatusCb mNfwCb; + IsInEmergencySession mIsE911Session; inline void initNfw(const NfwCbInfo& cbInfo) { mNfwCb = (NfwStatusCb)cbInfo.visibilityControlCb; + mIsE911Session = (IsInEmergencySession)cbInfo.isInEmergencySession; } /* ==== ODCPI ========================================================================== */ @@ -396,6 +398,12 @@ public: mNfwCb(notification); } } + inline bool getE911State(void) { + if (NULL != mIsE911Session) { + return mIsE911Session(); + } + return false; + } /*======== GNSSDEBUG ================================================================*/ bool getDebugReport(GnssDebugReport& report); |