From 39e34de194c0b1d4dc23e5eed05a63ad3b791393 Mon Sep 17 00:00:00 2001 From: haohuang Date: Thu, 15 Aug 2019 22:09:11 +0800 Subject: AgpsManager supports two clients AgpsManager supports two clients, QCOM AGPS Stack is to handle ATL type WWAN, AFW AGPS stack is used to handle ATL type SUPL and SUPL emergency. Change-Id: Id43c4919a1ae67d739e055c7fb5ba3abacc70b34 CRs-Fixed: 2509244 --- gnss/GnssAdapter.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'gnss/GnssAdapter.cpp') diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 47e5527..f813c58 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -80,7 +80,6 @@ GnssAdapter::GnssAdapter() : mGnssSvTypeConfigCb(nullptr), mNiData(), mAgpsManager(), - mAgpsCbInfo(), mOdcpiRequestCb(nullptr), mOdcpiRequestActive(false), mOdcpiTimer(this), @@ -2078,10 +2077,9 @@ GnssAdapter::updateClientsEventMask() mask); } - if (mAgpsCbInfo.statusV4Cb != NULL) { + if (mAgpsManager.isRegistered()) { mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; } - // Add ODCPI handling if (nullptr != mOdcpiRequestCb) { mask |= LOC_API_ADAPTER_BIT_REQUEST_WIFI; @@ -4111,27 +4109,17 @@ void GnssAdapter::initDefaultAgpsCommand() { /* INIT LOC AGPS MANAGER */ void GnssAdapter::initAgps(const AgpsCbInfo& cbInfo) { - LOC_LOGD("%s]: mAgpsCbInfo.cbPriority - %d; cbInfo.cbPriority - %d", - __func__, mAgpsCbInfo.cbPriority, cbInfo.cbPriority) + LOC_LOGD("%s]:cbInfo.atlType - %d", __func__, cbInfo.atlType); if (!((ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSB) || (ContextBase::mGps_conf.CAPABILITIES & LOC_GPS_CAPABILITY_MSA))) { return; } - if (mAgpsCbInfo.cbPriority > cbInfo.cbPriority) { - return; - } else { - mAgpsCbInfo = cbInfo; - - mAgpsManager.registerFrameworkStatusCallback((AgnssStatusIpV4Cb)cbInfo.statusV4Cb); - - mAgpsManager.createAgpsStateMachines(); - - /* Register for AGPS event mask */ - updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, - LOC_REGISTRATION_MASK_ENABLED); - } + mAgpsManager.createAgpsStateMachines(cbInfo); + /* Register for AGPS event mask */ + updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, + LOC_REGISTRATION_MASK_ENABLED); } void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){ -- cgit v1.2.3