From 9e585cb7bfbbf602555fe7b8e737ff64083ac7f4 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Mon, 24 Feb 2014 11:13:57 -0800 Subject: Inject feature config This change injects feature config through using the first available context CRs-fixed: 616544 Change-Id: Idea5bd8acfff729589c071f20bec18679c89ab25 --- core/ContextBase.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/ContextBase.cpp') diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index 1bd138e..e5a5014 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -65,13 +65,13 @@ 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))) { + if (NULL == (locApi = mLBSProxy->getLocApi(mMsgTask, exMask, this))) { // only RPC is the option now void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); if (NULL != handle) { getLocApi_t* getter = (getLocApi_t*)dlsym(handle, "getLocApi"); if (NULL != getter) { - locApi = (*getter)(mMsgTask, exMask); + locApi = (*getter)(mMsgTask, exMask, this); } } } @@ -80,7 +80,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; -- cgit v1.2.3 From fd8712acd22d2edb8936ffdd2f85b23241e08c82 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Tue, 27 May 2014 17:10:23 -0700 Subject: Add option to fallback to LocApiV02 In case the lbs or izat libs are not present, fall back to LocApiV02 to obtain the qmi client handle. This change will enable basic GPS functionality without lbs or izat lib dependencies CRs-fixed: 649065 Change-Id: Ic2c8418d785e891ad0a660a615cd5111fafc4ff2 --- core/ContextBase.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'core/ContextBase.cpp') diff --git a/core/ContextBase.cpp b/core/ContextBase.cpp index e5a5014..9f6c4aa 100644 --- a/core/ContextBase.cpp +++ b/core/ContextBase.cpp @@ -66,14 +66,29 @@ 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, this))) { - // only RPC is the option now - void* handle = dlopen("libloc_api-rpc-qc.so", RTLD_NOW); - if (NULL != handle) { + 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) { + 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); + } + } + } } } -- cgit v1.2.3