summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2017-08-06 16:35:08 -0700
committerSiddharth Ray <siddharthr@google.com>2017-08-09 10:44:54 -0700
commit029a2a2c936fe6f4c978ecfc60698d4cb531c3f4 (patch)
tree23948c4af486d73e276ca7a036ca865840142398
parentfe5db8fbedcc5d2a8fcc6e3996e37853090e609d (diff)
downloadgps-029a2a2c936fe6f4c978ecfc60698d4cb531c3f4.tar.gz
move the triggering of injectFeatureConfig to GnssAdapter
Currently LocDualContext::getLocBgContext() call triggers injectFeatureConfig() call, which may be rather time consuming in modem. LocDualContext::getLocBgContext() is being called by a number of non HAL processes, which may cause the premium config be repeated injected to modem in best case, or race conditions that may incur temporarily rejections on subsequent commands into modem, in worst case. Moved injectFeatureConfig() into GnssAdapter::setConfigCommand() to ensure it only happens in HAL process Bug: 36391306 CRs-Fixed: 2089449 Change-Id: I26f4da1dac211e02f1e25cd71b17cbc7b524198a
-rw-r--r--msm8998/core/LocDualContext.cpp12
-rw-r--r--msm8998/gnss/GnssAdapter.cpp1
2 files changed, 4 insertions, 9 deletions
diff --git a/msm8998/core/LocDualContext.cpp b/msm8998/core/LocDualContext.cpp
index c6a8896..9c2f61a 100644
--- a/msm8998/core/LocDualContext.cpp
+++ b/msm8998/core/LocDualContext.cpp
@@ -96,7 +96,6 @@ ContextBase* LocDualContext::getLocFgContext(LocThread::tCreate tCreator,
if(NULL == mInjectContext) {
LOC_LOGD("%s:%d]: mInjectContext is FgContext", __func__, __LINE__);
mInjectContext = mFgContext;
- injectFeatureConfig(mInjectContext);
}
pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex);
@@ -121,7 +120,6 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator,
if(NULL == mInjectContext) {
LOC_LOGD("%s:%d]: mInjectContext is BgContext", __func__, __LINE__);
mInjectContext = mBgContext;
- injectFeatureConfig(mInjectContext);
}
pthread_mutex_unlock(&LocDualContext::mGetLocContextMutex);
@@ -134,13 +132,9 @@ ContextBase* LocDualContext::getLocBgContext(LocThread::tCreate tCreator,
void LocDualContext :: injectFeatureConfig(ContextBase *curContext)
{
- LOC_LOGD("%s:%d]: Enter", __func__, __LINE__);
- if(curContext == mInjectContext) {
- LOC_LOGD("%s:%d]: Calling LBSProxy (%p) to inject feature config",
- __func__, __LINE__, ((LocDualContext *)mInjectContext)->mLBSProxy);
- ((LocDualContext *)mInjectContext)->mLBSProxy->injectFeatureConfig(curContext);
- }
- LOC_LOGD("%s:%d]: Exit", __func__, __LINE__);
+ LOC_LOGd("Calling LBSProxy (%p) to inject feature config",
+ ((LocDualContext *)mInjectContext)->mLBSProxy);
+ ((LocDualContext *)mInjectContext)->mLBSProxy->injectFeatureConfig(curContext);
}
LocDualContext::LocDualContext(const MsgTask* msgTask,
diff --git a/msm8998/gnss/GnssAdapter.cpp b/msm8998/gnss/GnssAdapter.cpp
index bc1fee1..efff63c 100644
--- a/msm8998/gnss/GnssAdapter.cpp
+++ b/msm8998/gnss/GnssAdapter.cpp
@@ -504,6 +504,7 @@ GnssAdapter::setConfigCommand()
mAdapter(adapter),
mApi(api) {}
inline virtual void proc() const {
+ LocDualContext::injectFeatureConfig(mAdapter.getContext());
mApi.setSUPLVersion(mAdapter.convertSuplVersion(ContextBase::mGps_conf.SUPL_VER));
mApi.setLPPConfig(mAdapter.convertLppProfile(ContextBase::mGps_conf.LPP_PROFILE));
mApi.setSensorControlConfig(ContextBase::mSap_conf.SENSOR_USAGE,