FR 46082 - SUPL Network Setup Improvements

Adding enhancement to ATL messages to allow
sending bearer type and apn type mask values.

CRs-Fixed: 2209227
Change-Id: I09a294946610f26de4760a0fba6f13083f8752f3
This commit is contained in:
Saurabh Srivastava 2018-05-18 00:05:32 +05:30 committed by Gerrit - the friendly Code Review server
parent 365919e004
commit d462c0add3
9 changed files with 61 additions and 41 deletions

View file

@ -130,7 +130,7 @@ bool LocAdapterBase::
DEFAULT_IMPL(false) DEFAULT_IMPL(false)
bool LocAdapterBase:: bool LocAdapterBase::
requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/) requestATL(int /*connHandle*/, LocAGpsType /*agps_type*/, LocApnTypeMask /*mask*/)
DEFAULT_IMPL(false) DEFAULT_IMPL(false)
bool LocAdapterBase:: bool LocAdapterBase::
@ -138,7 +138,7 @@ bool LocAdapterBase::
DEFAULT_IMPL(false) DEFAULT_IMPL(false)
bool LocAdapterBase:: bool LocAdapterBase::
requestSuplES(int /*connHandle*/) requestSuplES(int /*connHandle*/, LocApnTypeMask /*mask*/)
DEFAULT_IMPL(false) DEFAULT_IMPL(false)
bool LocAdapterBase:: bool LocAdapterBase::

View file

@ -144,9 +144,9 @@ public:
virtual bool requestXtraData(); virtual bool requestXtraData();
virtual bool requestTime(); virtual bool requestTime();
virtual bool requestLocation(); virtual bool requestLocation();
virtual bool requestATL(int connHandle, LocAGpsType agps_type); virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask);
virtual bool releaseATL(int connHandle); virtual bool releaseATL(int connHandle);
virtual bool requestSuplES(int connHandle); virtual bool requestSuplES(int connHandle, LocApnTypeMask mask);
virtual bool reportDataCallOpened(); virtual bool reportDataCallOpened();
virtual bool reportDataCallClosed(); virtual bool reportDataCallClosed();
virtual bool requestNiNotifyEvent(const GnssNiNotification &notify, const void* data); virtual bool requestNiNotifyEvent(const GnssNiNotification &notify, const void* data);

View file

@ -374,10 +374,10 @@ void LocApiBase::requestLocation()
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation()); TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestLocation());
} }
void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type) void LocApiBase::requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask)
{ {
// loop through adapters, and deliver to the first handling adapter. // loop through adapters, and deliver to the first handling adapter.
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type)); TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestATL(connHandle, agps_type, mask));
} }
void LocApiBase::releaseATL(int connHandle) void LocApiBase::releaseATL(int connHandle)
@ -386,10 +386,10 @@ void LocApiBase::releaseATL(int connHandle)
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle)); TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->releaseATL(connHandle));
} }
void LocApiBase::requestSuplES(int connHandle) void LocApiBase::requestSuplES(int connHandle, LocApnTypeMask mask)
{ {
// loop through adapters, and deliver to the first handling adapter. // loop through adapters, and deliver to the first handling adapter.
TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle)); TO_1ST_HANDLING_LOCADAPTERS(mLocAdapters[i]->requestSuplES(connHandle, mask));
} }
void LocApiBase::reportDataCallOpened() void LocApiBase::reportDataCallOpened()
@ -455,7 +455,7 @@ DEFAULT_IMPL(LOC_API_ADAPTER_ERR_SUCCESS)
void LocApiBase:: void LocApiBase::
atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/, atlOpenStatus(int /*handle*/, int /*is_succ*/, char* /*apn*/, uint32_t /*apnLen*/,
AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/) AGpsBearerType /*bear*/, LocAGpsType /*agpsType*/, LocApnTypeMask /*mask*/)
DEFAULT_IMPL() DEFAULT_IMPL()
void LocApiBase:: void LocApiBase::

View file

@ -147,9 +147,9 @@ public:
void requestXtraData(); void requestXtraData();
void requestTime(); void requestTime();
void requestLocation(); void requestLocation();
void requestATL(int connHandle, LocAGpsType agps_type); void requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask);
void releaseATL(int connHandle); void releaseATL(int connHandle);
void requestSuplES(int connHandle); void requestSuplES(int connHandle, LocApnTypeMask mask);
void reportDataCallOpened(); void reportDataCallOpened();
void reportDataCallClosed(); void reportDataCallClosed();
void requestNiNotify(GnssNiNotification &notify, const void* data); void requestNiNotify(GnssNiNotification &notify, const void* data);
@ -181,7 +181,7 @@ public:
virtual void virtual void
atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen, atlOpenStatus(int handle, int is_succ, char* apn, uint32_t apnLen,
AGpsBearerType bear, LocAGpsType agpsType); AGpsBearerType bear, LocAGpsType agpsType, LocApnTypeMask mask);
virtual void virtual void
atlCloseStatus(int handle, int is_succ); atlCloseStatus(int handle, int is_succ);
virtual void virtual void

View file

@ -26,13 +26,14 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_Agps" #define LOG_TAG "LocSvc_Agps"
#include <Agps.h> #include <Agps.h>
#include <loc_pla.h> #include <loc_pla.h>
#include <ContextBase.h> #include <ContextBase.h>
#include <loc_timer.h> #include <loc_timer.h>
#include <inttypes.h>
/* -------------------------------------------------------------------- /* --------------------------------------------------------------------
* AGPS State Machine Methods * AGPS State Machine Methods
@ -361,13 +362,13 @@ void AgpsStateMachine::notifyEventToSubscriber(
case AGPS_EVENT_GRANTED: case AGPS_EVENT_GRANTED:
mAgpsManager->mAtlOpenStatusCb( mAgpsManager->mAtlOpenStatusCb(
subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(), subscriberToNotify->mConnHandle, 1, getAPN(), getAPNLen(),
getBearer(), mAgpsType); getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL);
break; break;
case AGPS_EVENT_DENIED: case AGPS_EVENT_DENIED:
mAgpsManager->mAtlOpenStatusCb( mAgpsManager->mAtlOpenStatusCb(
subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(), subscriberToNotify->mConnHandle, 0, getAPN(), getAPNLen(),
getBearer(), mAgpsType); getBearer(), mAgpsType, LOC_APN_TYPE_MASK_SUPL);
break; break;
case AGPS_EVENT_UNSUBSCRIBE: case AGPS_EVENT_UNSUBSCRIBE:
@ -572,7 +573,7 @@ void DSStateMachine :: retryCallback()
mAgpsManager->mSendMsgToAdapterQueueFn( mAgpsManager->mSendMsgToAdapterQueueFn(
new AgpsMsgRequestATL( new AgpsMsgRequestATL(
mAgpsManager, subscriber->mConnHandle, mAgpsManager, subscriber->mConnHandle,
LOC_AGPS_TYPE_SUPL_ES)); LOC_AGPS_TYPE_SUPL_ES, subscriber->mApnTypeMask));
} }
/* Overridden method /* Overridden method
@ -662,7 +663,8 @@ void DSStateMachine::notifyEventToSubscriber(
case AGPS_EVENT_GRANTED: case AGPS_EVENT_GRANTED:
mAgpsManager->mAtlOpenStatusCb( mAgpsManager->mAtlOpenStatusCb(
subscriberToNotify->mConnHandle, 1, NULL, 0, subscriberToNotify->mConnHandle, 1, NULL, 0,
AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES); AGPS_APN_BEARER_INVALID, LOC_AGPS_TYPE_SUPL_ES,
LOC_APN_TYPE_MASK_EMERGENCY);
break; break;
case AGPS_EVENT_DENIED: case AGPS_EVENT_DENIED:
@ -672,7 +674,7 @@ void DSStateMachine::notifyEventToSubscriber(
mAgpsManager->mSendMsgToAdapterQueueFn( mAgpsManager->mSendMsgToAdapterQueueFn(
new AgpsMsgRequestATL( new AgpsMsgRequestATL(
mAgpsManager, subscriberToNotify->mConnHandle, mAgpsManager, subscriberToNotify->mConnHandle,
LOC_AGPS_TYPE_SUPL)); LOC_AGPS_TYPE_SUPL, subscriberToNotify->mApnTypeMask));
break; break;
case AGPS_EVENT_UNSUBSCRIBE: case AGPS_EVENT_UNSUBSCRIBE:
@ -767,10 +769,10 @@ AgpsStateMachine* AgpsManager::getAgpsStateMachine(AGpsExtType agpsType) {
return NULL; return NULL;
} }
void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask){
LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d", LOC_LOGD("AgpsManager::requestATL(): connHandle %d, agpsType %d apnTypeMask %" PRIu64,
connHandle, agpsType); connHandle, agpsType, mask);
AgpsStateMachine* sm = getAgpsStateMachine(agpsType); AgpsStateMachine* sm = getAgpsStateMachine(agpsType);
@ -778,12 +780,12 @@ void AgpsManager::requestATL(int connHandle, AGpsExtType agpsType){
LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType); LOC_LOGE("No AGPS State Machine for agpsType: %d", agpsType);
mAtlOpenStatusCb( mAtlOpenStatusCb(
connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType); connHandle, 0, NULL, 0, AGPS_APN_BEARER_INVALID, agpsType, mask);
return; return;
} }
/* Invoke AGPS SM processing */ /* Invoke AGPS SM processing */
AgpsSubscriber subscriber(connHandle, false, false); AgpsSubscriber subscriber(connHandle, false, false, mask);
sm->setCurrentSubscriber(&subscriber); sm->setCurrentSubscriber(&subscriber);
/* If DS State Machine, wait for close complete */ /* If DS State Machine, wait for close complete */

View file

@ -41,9 +41,10 @@
* Passed in by Adapter to AgpsManager */ * Passed in by Adapter to AgpsManager */
typedef std::function<void( typedef std::function<void(
int handle, int isSuccess, char* apn, uint32_t apnLen, int handle, int isSuccess, char* apn, uint32_t apnLen,
AGpsBearerType bearerType, AGpsExtType agpsType)> AgpsAtlOpenStatusCb; AGpsBearerType bearerType, AGpsExtType agpsType,
LocApnTypeMask mask)> AgpsAtlOpenStatusCb;
typedef std::function<void(int handle, int isSuccess)> AgpsAtlCloseStatusCb; typedef std::function<void(int handle, int isSuccess)> AgpsAtlCloseStatusCb;
/* DS Client control APIs /* DS Client control APIs
* Passed in by Adapter to AgpsManager */ * Passed in by Adapter to AgpsManager */
@ -109,12 +110,15 @@ public:
* inactive state. */ * inactive state. */
bool mWaitForCloseComplete; bool mWaitForCloseComplete;
bool mIsInactive; bool mIsInactive;
LocApnTypeMask mApnTypeMask;
inline AgpsSubscriber( inline AgpsSubscriber(
int connHandle, bool waitForCloseComplete, bool isInactive) : int connHandle, bool waitForCloseComplete, bool isInactive,
LocApnTypeMask apnTypeMask) :
mConnHandle(connHandle), mConnHandle(connHandle),
mWaitForCloseComplete(waitForCloseComplete), mWaitForCloseComplete(waitForCloseComplete),
mIsInactive(isInactive) {} mIsInactive(isInactive),
mApnTypeMask(apnTypeMask) {}
inline virtual ~AgpsSubscriber() {} inline virtual ~AgpsSubscriber() {}
inline virtual bool equals(const AgpsSubscriber *s) const inline virtual bool equals(const AgpsSubscriber *s) const
@ -122,7 +126,7 @@ public:
inline virtual AgpsSubscriber* clone() inline virtual AgpsSubscriber* clone()
{ return new AgpsSubscriber( { return new AgpsSubscriber(
mConnHandle, mWaitForCloseComplete, mIsInactive); } mConnHandle, mWaitForCloseComplete, mIsInactive, mApnTypeMask); }
}; };
/* AGPS STATE MACHINE */ /* AGPS STATE MACHINE */
@ -306,7 +310,7 @@ public:
void createAgpsStateMachines(); void createAgpsStateMachines();
/* Process incoming ATL requests */ /* Process incoming ATL requests */
void requestATL(int connHandle, AGpsExtType agpsType); void requestATL(int connHandle, AGpsExtType agpsType, LocApnTypeMask mask);
void releaseATL(int connHandle); void releaseATL(int connHandle);
/* Process incoming DS Client data call events */ /* Process incoming DS Client data call events */
@ -354,11 +358,12 @@ struct AgpsMsgRequestATL: public LocMsg {
AgpsManager* mAgpsManager; AgpsManager* mAgpsManager;
int mConnHandle; int mConnHandle;
AGpsExtType mAgpsType; AGpsExtType mAgpsType;
LocApnTypeMask mApnTypeMask;
inline AgpsMsgRequestATL(AgpsManager* agpsManager, int connHandle, inline AgpsMsgRequestATL(AgpsManager* agpsManager, int connHandle,
AGpsExtType agpsType) : AGpsExtType agpsType, LocApnTypeMask mask) :
LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle), mAgpsType( LocMsg(), mAgpsManager(agpsManager), mConnHandle(connHandle),
agpsType) { mAgpsType(agpsType), mApnTypeMask(mask) {
LOC_LOGV("AgpsMsgRequestATL"); LOC_LOGV("AgpsMsgRequestATL");
} }
@ -366,7 +371,7 @@ struct AgpsMsgRequestATL: public LocMsg {
inline virtual void proc() const { inline virtual void proc() const {
LOC_LOGV("AgpsMsgRequestATL::proc()"); LOC_LOGV("AgpsMsgRequestATL::proc()");
mAgpsManager->requestATL(mConnHandle, mAgpsType); mAgpsManager->requestATL(mConnHandle, mAgpsType, mApnTypeMask);
} }
}; };

View file

@ -26,6 +26,7 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
*/ */
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_GnssAdapter" #define LOG_TAG "LocSvc_GnssAdapter"
#include <inttypes.h> #include <inttypes.h>
@ -93,10 +94,10 @@ GnssAdapter::GnssAdapter() :
/* Set ATL open/close callbacks */ /* Set ATL open/close callbacks */
AgpsAtlOpenStatusCb atlOpenStatusCb = AgpsAtlOpenStatusCb atlOpenStatusCb =
[this](int handle, int isSuccess, char* apn, uint32_t apnLen, [this](int handle, int isSuccess, char* apn, uint32_t apnLen,
AGpsBearerType bearerType, AGpsExtType agpsType) { AGpsBearerType bearerType, AGpsExtType agpsType, LocApnTypeMask mask) {
mLocApi->atlOpenStatus( mLocApi->atlOpenStatus(
handle, isSuccess, apn, apnLen, bearerType, agpsType); handle, isSuccess, apn, apnLen, bearerType, agpsType, mask);
}; };
AgpsAtlCloseStatusCb atlCloseStatusCb = AgpsAtlCloseStatusCb atlCloseStatusCb =
[this](int handle, int isSuccess) { [this](int handle, int isSuccess) {
@ -2870,12 +2871,12 @@ void GnssAdapter::initAgpsCommand(const AgpsCbInfo& cbInfo){
* Triggers the AGPS state machine to setup AGPS call for below WWAN types: * Triggers the AGPS state machine to setup AGPS call for below WWAN types:
* eQMI_LOC_WWAN_TYPE_INTERNET_V02 * eQMI_LOC_WWAN_TYPE_INTERNET_V02
* eQMI_LOC_WWAN_TYPE_AGNSS_V02 */ * eQMI_LOC_WWAN_TYPE_AGNSS_V02 */
bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType){ bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType, LocApnTypeMask mask){
LOC_LOGI("GnssAdapter::requestATL"); LOC_LOGI("GnssAdapter::requestATL");
sendMsg( new AgpsMsgRequestATL( sendMsg( new AgpsMsgRequestATL(
&mAgpsManager, connHandle, (AGpsExtType)agpsType)); &mAgpsManager, connHandle, (AGpsExtType)agpsType, mask));
return true; return true;
} }
@ -2885,12 +2886,12 @@ bool GnssAdapter::requestATL(int connHandle, LocAGpsType agpsType){
* eQMI_LOC_SERVER_REQUEST_OPEN_V02 * eQMI_LOC_SERVER_REQUEST_OPEN_V02
* Triggers the AGPS state machine to setup AGPS call for below WWAN types: * Triggers the AGPS state machine to setup AGPS call for below WWAN types:
* eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 */ * eQMI_LOC_WWAN_TYPE_AGNSS_EMERGENCY_V02 */
bool GnssAdapter::requestSuplES(int connHandle){ bool GnssAdapter::requestSuplES(int connHandle, LocApnTypeMask mask){
LOC_LOGI("GnssAdapter::requestSuplES"); LOC_LOGI("GnssAdapter::requestSuplES");
sendMsg( new AgpsMsgRequestATL( sendMsg( new AgpsMsgRequestATL(
&mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES)); &mAgpsManager, connHandle, LOC_AGPS_TYPE_SUPL_ES, mask));
return true; return true;
} }

View file

@ -252,9 +252,9 @@ public:
virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet); virtual void reportSvMeasurementEvent(GnssSvMeasurementSet &svMeasurementSet);
virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial); virtual void reportSvPolynomialEvent(GnssSvPolynomial &svPolynomial);
virtual bool requestATL(int connHandle, LocAGpsType agps_type); virtual bool requestATL(int connHandle, LocAGpsType agps_type, LocApnTypeMask mask);
virtual bool releaseATL(int connHandle); virtual bool releaseATL(int connHandle);
virtual bool requestSuplES(int connHandle); virtual bool requestSuplES(int connHandle, LocApnTypeMask mask);
virtual bool reportDataCallOpened(); virtual bool reportDataCallOpened();
virtual bool reportDataCallClosed(); virtual bool reportDataCallClosed();
virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc, virtual bool reportZppBestAvailableFix(LocGpsLocation &zppLoc,

View file

@ -158,6 +158,18 @@ typedef int16_t AGpsBearerType;
#define AGPS_APN_BEARER_IPV6 2 #define AGPS_APN_BEARER_IPV6 2
#define AGPS_APN_BEARER_IPV4V6 3 #define AGPS_APN_BEARER_IPV4V6 3
typedef uint64_t LocApnTypeMask;
#define LOC_APN_TYPE_MASK_DEFAULT ((LocApnTypeMask)0x0000000000000001ull) /**< Denotes APN type for Default/Internet traffic */
#define LOC_APN_TYPE_MASK_IMS ((LocApnTypeMask)0x0000000000000002ull) /**< Denotes APN type for IP Multimedia Subsystem */
#define LOC_APN_TYPE_MASK_MMS ((LocApnTypeMask)0x0000000000000004ull) /**< Denotes APN type for Multimedia Messaging Service */
#define LOC_APN_TYPE_MASK_DUN ((LocApnTypeMask)0x0000000000000008ull) /**< Denotes APN type for Dial Up Network */
#define LOC_APN_TYPE_MASK_SUPL ((LocApnTypeMask)0x0000000000000010ull) /**< Denotes APN type for Secure User Plane Location */
#define LOC_APN_TYPE_MASK_HIPRI ((LocApnTypeMask)0x0000000000000020ull) /**< Denotes APN type for High Priority Mobile Data */
#define LOC_APN_TYPE_MASK_FOTA ((LocApnTypeMask)0x0000000000000040ull) /**< Denotes APN type for over the air administration */
#define LOC_APN_TYPE_MASK_CBS ((LocApnTypeMask)0x0000000000000080ull) /**< Denotes APN type for Carrier Branded Services */
#define LOC_APN_TYPE_MASK_IA ((LocApnTypeMask)0x0000000000000100ull) /**< Denotes APN type for Initial Attach */
#define LOC_APN_TYPE_MASK_EMERGENCY ((LocApnTypeMask)0x0000000000000200ull) /**< Denotes APN type for emergency */
typedef enum { typedef enum {
AGPS_CB_PRIORITY_LOW = 1, AGPS_CB_PRIORITY_LOW = 1,
AGPS_CB_PRIORITY_MED = 2, AGPS_CB_PRIORITY_MED = 2,