summaryrefslogtreecommitdiff
path: root/core/ContextBase.cpp
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2016-02-04 10:03:40 -0800
committerKevin Tang <zhikait@codeaurora.org>2016-02-04 10:03:40 -0800
commit1aeb6bad84c0afd0e032c3d4d7e33959501e18f1 (patch)
tree3518628e958d4e939b72e1d32a1618e6056e653d /core/ContextBase.cpp
parentdb367819e26af1a6b8cb013e0dcda575d242c732 (diff)
parent89f41a9b1602ce82ea6272f2a3be8595fb4b6058 (diff)
downloadgps-1aeb6bad84c0afd0e032c3d4d7e33959501e18f1.tar.gz
Merging m_master changes to oe_master
Merging LA m_master changes to oe_master merge head - 89f41a9b1602ce82ea6272f2a3be8595fb4b6058 Change-Id: I9010487f1d6f3d2e30a568b441bc5f9b719a0fb1
Diffstat (limited to 'core/ContextBase.cpp')
-rw-r--r--core/ContextBase.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp
index b2869bb..58dc8a7 100644
--- a/core/ContextBase.cpp
+++ b/core/ContextBase.cpp
@@ -69,13 +69,28 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
// first if can not be MPQ
if (TARGET_MPQ != loc_get_target()) {
- if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask))) {
- // only RPC is the option now
- void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW);
- if (NULL != handle) {
+ 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 (NULL != getter) {
- locApi = (*getter)(mMsgTask, exMask);
+ 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);
+ }
}
}
}
@@ -84,7 +99,7 @@ LocApiBase* ContextBase::createLocApi(LOC_API_ADAPTER_EVENT_MASK_T exMask)
// locApi could still be NULL at this time
// we would then create a dummy one
if (NULL == locApi) {
- locApi = new LocApiBase(mMsgTask, exMask);
+ locApi = new LocApiBase(mMsgTask, exMask, this);
}
return locApi;