diff options
author | Shinru Han <shinruhan@google.com> | 2018-07-24 12:21:27 +0800 |
---|---|---|
committer | Shinru Han <shinruhan@google.com> | 2018-07-24 12:31:21 +0800 |
commit | 777634e5f220df8fbcbadedae0c05b1b60702d9f (patch) | |
tree | ebd3d227923a44eec52a7a1b48ad4c3f0929e703 | |
parent | 6c07d7339ef5a36a79404f69a5290f0bc102a463 (diff) | |
download | gps-777634e5f220df8fbcbadedae0c05b1b60702d9f.tar.gz |
Register AGPS request event after SSR
Bug: 111380734
Test: SUPL pass after SSR
Change-Id: I870e802de81dd81fb76eafa23116a98b82b8090a
-rw-r--r-- | msm8998/gnss/GnssAdapter.cpp | 7 | ||||
-rw-r--r-- | msm8998/gnss/GnssAdapter.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/msm8998/gnss/GnssAdapter.cpp b/msm8998/gnss/GnssAdapter.cpp index e14cf28..1896108 100644 --- a/msm8998/gnss/GnssAdapter.cpp +++ b/msm8998/gnss/GnssAdapter.cpp @@ -64,7 +64,8 @@ GnssAdapter::GnssAdapter() : mControlCallbacks(), mPowerVoteId(0), mNiData(), - mAgpsManager() + mAgpsManager(), + mAgpsInitialized(false) { LOC_LOGD("%s]: Constructor %p", __func__, this); mUlpPositionMode.mode = LOC_POSITION_MODE_INVALID; @@ -1004,6 +1005,9 @@ GnssAdapter::updateClientsEventMask() mask |= LOC_API_ADAPTER_BIT_GNSS_MEASUREMENT; } } + if (true == getAgpsInitialized()) { + mask |= LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST; + } updateEvtMask(mask, LOC_REGISTRATION_MASK_SET); } @@ -2392,6 +2396,7 @@ void GnssAdapter::initAgpsCommand(void* statusV4Cb){ mAgpsManager->createAgpsStateMachines(); + mAdapter.setAgpsInitialized(true); /* Register for AGPS event mask */ mAdapter.updateEvtMask(LOC_API_ADAPTER_BIT_LOCATION_SERVER_REQUEST, LOC_REGISTRATION_MASK_ENABLED); diff --git a/msm8998/gnss/GnssAdapter.h b/msm8998/gnss/GnssAdapter.h index d857558..e8cebd5 100644 --- a/msm8998/gnss/GnssAdapter.h +++ b/msm8998/gnss/GnssAdapter.h @@ -99,6 +99,7 @@ class GnssAdapter : public LocAdapterBase { /* ==== AGPS ========================================================*/ // This must be initialized via initAgps() AgpsManager mAgpsManager; + bool mAgpsInitialized; /*==== CONVERSION ===================================================================*/ static void convertOptions(LocPosMode& out, const LocationOptions& options); @@ -191,6 +192,8 @@ public: const char* apnName, int apnLen, LocApnIpType ipType); void dataConnClosedCommand(AGpsExtType agpsType); void dataConnFailedCommand(AGpsExtType agpsType); + inline void setAgpsInitialized(bool value) { mAgpsInitialized = value; } + inline bool getAgpsInitialized() { return mAgpsInitialized; } /* ======== RESPONSES ================================================================== */ void reportResponse(LocationError err, uint32_t sessionId); |