diff options
author | Bruno Martins <bgcngm@gmail.com> | 2016-11-16 23:40:24 +0000 |
---|---|---|
committer | davidevinavil <davidevinavil@gmail.com> | 2017-01-21 18:27:40 +0100 |
commit | db17d990d994300016c7e88cecad7de81f5e79e5 (patch) | |
tree | 8c1ec061f63ef1271b03bccc22fe945e6f6b6000 /gps/core/ContextBase.cpp | |
parent | b6b44db0293d2e81356ae8f35c2583f6129ea62c (diff) |
z2_plus: Update GPS stack
* Tag LA.UM.5.5.r1-00100-8x96.0
Change-Id: I18cd979799001ccbaae6d08d07f907689ac5a00a
Diffstat (limited to 'gps/core/ContextBase.cpp')
-rw-r--r-- | gps/core/ContextBase.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp index 971354d..d2f9070 100644 --- a/gps/core/ContextBase.cpp +++ b/gps/core/ContextBase.cpp @@ -35,7 +35,7 @@ #include <ContextBase.h> #include <msg_q.h> #include <loc_target.h> -#include <log_util.h> +#include <platform_lib_includes.h> #include <loc_log.h> namespace loc_core { @@ -73,6 +73,10 @@ LBSProxyBase* ContextBase::getLBSProxy(const char* libName) proxy = (*getter)(); } } + else + { + LOC_LOGW("%s:%d]: FAILED TO LOAD libname: %s\n", __func__, __LINE__, libName); + } if (NULL == proxy) { proxy = new LBSProxyBase(); } @@ -84,30 +88,29 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask) { LocApiBase* locApi = NULL; - // first if can not be MPQ - if (TARGET_MPQ != loc_get_target()) { - if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { - void *handle = NULL; - //try to see if LocApiV02 is present - if((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { - LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__); - getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); - if(getter != NULL) { - LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); - } + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { + void *handle = NULL; + //try to see if LocApiV02 is present + if ((handle = dlopen("libloc_api_v02.so", RTLD_NOW)) != NULL) { + LOC_LOGD("%s:%d]: libloc_api_v02.so is present", __func__, __LINE__); + getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); + if (getter != NULL) { + LOC_LOGD("%s:%d]: getter is not NULL for LocApiV02", __func__, + __LINE__); + locApi = (*getter)(mMsgTask, exMask, this); } - // only RPC is the option now - else { - LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC", - __func__, __LINE__); - handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { - getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); - if (NULL != getter) { - LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, __LINE__); - locApi = (*getter)(mMsgTask, exMask, this); - } + } + // only RPC is the option now + else { + LOC_LOGD("%s:%d]: libloc_api_v02.so is NOT present. Trying RPC", + __func__, __LINE__); + handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); + if (NULL != handle) { + getLocApi_t* getter = (getLocApi_t*) dlsym(handle, "getLocApi"); + if (NULL != getter) { + LOC_LOGD("%s:%d]: getter is not NULL in RPC", __func__, + __LINE__); + locApi = (*getter)(mMsgTask, exMask, this); } } } |